UART on Baby Orangutan

I have a couple of questions that hopefully someone can answer…

Is the serial port on a laptop 'typically ’ working at TTL levels (0-5v) or at -5v to +5v? I am wondering if I need a Max232 to change levels…

I have some sample code for setting up the UART on ATmega48 devices it includes a formula for calculating UBRR given a Baud rate and a oscillator frequency.

#define MYUBRR (FOSC/16/BAUD-1)

Is FOSC 20Mhz on the Baby Orangutan?

I have connected the Baby Orangutan to my laptop serial port and I am getting a steady stream of the wrong characters so I am trying to find out if my baud rate is set wrong or if the levels are wrong.

Thanks // M

Hello,

Some laptop serial ports operate at something close to the 0-5v range, but the signals will definitely be inverted. You can easily measure what the serial output voltage is to see what your particular laptop does. You can use a transistor with a pull-up as an inverter for your PCout/AVR in line. For sending from the AVR, you’ll need to invert or generate inverted serial in software (the UART won’t do it). Even if the laptop voltages are above your supply rails, the threshold could be around a few volts, allowing your system to work without RS-232 drivers.

Fosc is 20 MHz.

- Jan