> I've also tried to find an alternative approach to solving this problem
> by using the external interrupt 2 on Port D, Pin 2 (the UART 1 recieve
> PIN) to trigger upon getting a start bit and then to setup a timer and
> read the pin's value at the correct intervals. However I can't get the
> interrupt to trigger at all. I've isolated out the interrupt code and
> tried to trigger the interrupt by just touching a line from the "V" line
> on the UART to the interrupt pin, but I still can't make it trigger the
> interrupt. The code (for avrgcc) is attached, if anyone can figure out
> what i've done wrong in setting up the interrupt rountine please let me
> know. The code also includes a polling mode which I've used to test the
> input line and that works fine.
Just wanted to make sure that you were aware that the ATMega128 has
two hardware UARTs. So it isn't clear to me why you would want to use
INT2 to do a software UART when you could jsut use the hardware UART.
Or are you trying to do the trick where you rely on the 0v and 5v to
work with an external device that has RS-232 outputs? You'll
definitely want some kind of protection circuitry on the input side.
If a device presents a real -12v you could fry your robostix.
Which pin are you connecting your input to? (you mention interrupt pin
- but I just wanted to clarify exactly which physical pin you're using
on the robostix.
I don't see anything obvious wrong with your code. I'll try compiling
it and running it on my robostix when I get home.
Vancouver, BC, Canada