Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

atmega328 and max232

Status
Not open for further replies.

gtr_stitch

New Member
So I got my hands on a couple of atmega328 chips...just cause. I want to eventually get an arduino uno and Ethernet, but that's for later. In the meantime, I thought it would be fun to try and make my own arduino (so im not completely lost when trying to program a real one when I get it). Most of the schems and diagrams for a DIY arduino are pretty straightforward. My curiosity is communication between my PC and my diyduino. I can use a max232, right? Just do a standard wireup of the 232 and connect the tx/rx lines of both devices accordingly. That should work right? I've done a lot of googling and it seems straightforward as well, but I've learned that some things can be too simple to be true. Any advice?
Thanks in advance!
 
You should be able to use the MAX232 to wire between the ATmega328 and the PC.

You can test the MAX232 with a loop-back test.

If you run a terminal emulator on the PC, and turn off local echo, and link pins 2 and 3 of the 9 way D connector, you should see what you type, but not if the pins aren't linked. That proves your terminal emulator is working.

You then link up your MAX232, with all its capacitors, with pins 7 and 8 to the pins 2 and 3 of the 9 way D connectors. (I can't remember whether pin 2 or 3 of the 9 way D connector goes to pin 7 of the MAX232). Pin 5 of the 9 way D connector is ground and is connected to pin 15 of the MAX232

Then you do another loopback test. If you link pins 9 and 10 of the MAX 232, you should see on the terminal emulator what you have typed, but not if you don't link them. If that works, your MAX232 is working correctly.
 
Awesome thanks! Quick question though...would pins 11,12,13 and 14 work the same respectively? According to the datasheet there are two pairs of i/o pins...
Either way I greatly appreciate the advice!
 
Yes, there are two RS232 transmitters and two RS232 receivers in the MAX232 and you can use either transmitter and either receiver. You do have to use a transmitter to send signals to the computer at RS232 levels and a receiver to receive signals from the computer.

I don't think that I have ever needed more than one transmitter and one receiver in any application. I use the ones on pins 7, 8, 9 and 10 because the signal path is directly across the IC and I find that easier to remember.
 
Did the loop test for terminal and max232 and everything worked like a charm :) can't wait for my atmega to come in! Thanks again, diver!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top