Talking back with the USBtinyISP

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
craignied
 
Posts: 5
Joined: Tue Jan 24, 2012 11:50 am

Talking back with the USBtinyISP

Post by craignied »

I'm a noob to AVRs, and really impressed with the USBtinyISP. I've been happily coding an Atmega328P with the gcc and avrdude tools on a Linux box, and have come to the point where I'd really enjoy having the AVR talk back to the Linux box while running. (The 2 7-segment character LCD I have in my project only goes so far in telling me what's happening inside while the AVR is running :D .) Can anyone point me to basic instructions, example code, etc., to set up an Atmega328P so that it can send characters to a terminal on a Linux box to which it is attached? I'm assuming this is possible.

Many thanks in advance!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Talking back with the USBtinyISP

Post by adafruit »

you should probably use an Arduino for what you want, the USBtiny is for programming chips

User avatar
sdb
 
Posts: 31
Joined: Thu Jan 12, 2012 4:24 am

Re: Talking back with the USBtinyISP

Post by sdb »

It can in theory be done with the USBtiny used as an SPI to USB converter, and there have been discussions on the forum in the past about making it work for debugging. If you are looking for a challenge I believe this would be a good one. Not too easy, but possible. Read the previous forum discussion. Start your code from there and with the usbtiny code inside avrdude and the PC code used for the Spoke POV. Extract the relevant parts and integrate into your solution.

The easiest way is to use the serial built into the ATmega328 instead of the SPI.

The ATmega328 has RxD and TxD lines, but they operate at the VCC level (5v or less) of the chip.

You can use a level shifter (max232 or some transistors) to convert to RS232 voltages and connect those lines to a serial port on your computer.

Or you can instead use a USB to serial converter on those lines and connect to a USB port on your computer. Suitable converters include the http://www.adafruit.com/products/284 or the packaged up https://www.adafruit.com/products/70 and similar products elsewhere. Make sure you understand the voltage discussion on those product pages.

I prefer the USB converter approach.

User avatar
sdb
 
Posts: 31
Joined: Thu Jan 12, 2012 4:24 am

Re: Talking back with the USBtinyISP

Post by sdb »

http://forums.adafruit.com/viewtopic.ph ... 939#p57681 is one relevant discussion and especially don't miss USBtinyISP_SPI.zip as attached by 'sgoadhouse'.

(can't seem to edit my post, so I post again. oh well.)

User avatar
craignied
 
Posts: 5
Joined: Tue Jan 24, 2012 11:50 am

Re: Talking back with the USBtinyISP

Post by craignied »

adafruit: I should have been more clear: If I had wanted to use an Arduino for this application, having it talk back would be trivial. But I don't, hence my question.

sdb: Thanks, I'll take a look!!

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”