Electronics > Electronics

Serial communications with PonyProg or AVR ISP?

(1/3) > >>

Before I go and break anything, does anyone know if I can output rprintf("hello!") statements from my AVR though either/both the PonyProg and AVR ISP programmers to say Hyperterminal?

I managed to get the uart and rprintf functions to compile without error (using AVRlib), but nothing is appearing in my Hyperterminal connection . . . perhaps I am doing it wrong, but want to make sure I wont break anything before I debug . . .

I really couldn't say. I do all my programing from gumstix to robostix and I use the same serial line to program as I do to send stuff back so i'm guessing it would be ok.....

No, you can't. The programmer connects to MISO and MOSI, which are the SPI programming pins. You need an RS-232 -> TTL converter, and you need to hook it to the pins marked TxD and RxD (pins 2 & 3). You also need to connect ground.

I see on your schematic you are using those two pins to control the servos - you might want to change that to use pins 4 & 5 instead, keeping pins 2 & 3 available.


That's an example of a simple USB -> TTL converter. Hook Tx on that board to Rx on the AVR, and vice versa for Rx. Leave 3.3 volts unconnected (the USB board is powered from USB).

- Jon

so i was playing with UARTs on an atMega8 last week making a PWM motor controller. (will document the process soon. promise.)

so i'm presuming the AVR ISP programmer you are using is the same as mine here. mine connects to  MOSI, MISO and SCK (pins 17,18 and 19 on the atMega8).
so the UART works on the RXD and TXD pins (pins 2 and 3 on the atMega8).
(i'm guessing Jesse's robostix uses a boot loader to upload the program through the UART.)

so, what you will need to do, get a max232 level shifter to convert the AVRs ttl voltages to the higher voltages needed for a PC serial port.
hook it all up like this: http://homepage.hispeed.ch/peterfleury/avr-uart.html

once you have that done and since you are using the AVRlib code, have a look at the example code in this file in the AVRlib package:

if you have any more problems let me know as i have this working at the moment.

interestingly enough, i couldn't get accurate enough timing with an external cristal while using the UART so i have to use the internal oscillator.
with the external cristal i was just getting junk through the serial connection unless i slowed the baud rate right down.
obviously i'm doing something wrong but i can't work out what.
anyway, it works fine for me with the internal oscillator.


ha. snap!



[0] Message Index

[#] Next page

Go to full version