A question about serial communication with an orangutan

I had a few questions about the serial communication on an orangutan mega168.

  • Are the serial communications at TTL levels? The orangutan will be communicating with a device that has a serial header at TTL levels (A Linksys WRT54g) so there would be no point in stepping up to RS-232 levels and then stepping back down again would there?
  • Where exactly would I connect the serial lines to the orangutan? Would the serial communication use I/O ports or is there a special place to connect the lines?
  • Is there any example code for serial communication on the orangutans? I would probably use orangutan-lib’s UART code.
  • Yes, the serial communication is at TTL levels, so you don’t need to convert it.
  • Yes, the built in serial hardware uses two of the I/O ports, PD0 is the RX pin, and PD1 is the TX pin. Both are brought out to the I/O header on the Orangutan mega168
  • The Orangutan-Lib code is fine, also the ATMega168 datasheet has example C functoins for initializing the UART (serial hardware) on page 179, transmitting a byte on page 180, and receiving a byte on page 183. The example receiving function is pretty lame, since it just waits around forever until it receives a byte. Orangutan-lib has interrupt-based serial byte receiving functions, so your code can be doing other things than just waiting around for the next byte. If you want to customize the functions and really understand how they work, you might find this example code a little simpler.

You might also search around the forums a bit, and feel free to ask more questions.

-Adam

thanks for the help!