Author Topic: MAX232ECN to Atmega 328P Microprocessor  (Read 3004 times)

0 Members and 1 Guest are viewing this topic.

Offline Daniel BingamonTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
MAX232ECN to Atmega 328P Microprocessor
« on: May 06, 2023, 08:28:35 pm »
I have been working on connecting an RS232 port to an Atmega 328P Microprocessor.
In this I have an DE9 connector with pin 2, 3 & 5 in use.
Pin 3 of the DE9 going to pin 13 of the MAX232 chip.
Pin 2 of the DE9 going to pin 14 of the MAX232.
All the capacitors in place.
Pin 11 of MAX232 going to the pin 3 of the 328P.
Pin 12 of MAX232 going to pin 2 of the 328P.
I can't seem to get it to transmit data.   The pin 11 of the MAX232 is putting out 3.28V and regardless of whether the 328P is in the socket or not.
For some reason the 328P can't pull the line low.
I'll try to post of schematic and board diagram in the next post.
 

Offline Daniel BingamonTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: MAX232ECN to Atmega 328P Microprocessor
« Reply #1 on: May 06, 2023, 08:34:03 pm »
PCB Diagram
Also note, the TVS diodes are not installed on the board.
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 240
  • Country: gb
Re: MAX232ECN to Atmega 328P Microprocessor
« Reply #2 on: May 07, 2023, 07:41:07 pm »
Would first ask if you have proven the 328 has been programmed / fused up correctly and is working ok with your crystal ?

The simplest way to check your Max232 is working is to run a simple loop back test as shown below if you are able  or are you stuck with some predefined code you cannot change ?
If not, do you have an Arduino board you can run that looopback test straight to that boards Max232 ?

Never used what I assume are leds on the Tx/Rx lines, might be better to remove them until the circuit proven.

https://support.arduino.cc/hc/en-us/articles/360020366520-How-to-do-a-loopback-test


 

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 983
  • Country: us
Re: MAX232ECN to Atmega 328P Microprocessor
« Reply #3 on: May 07, 2023, 07:56:43 pm »
The schematics would be helpful. Hopefully with standard part libraries - so that we do not need to look up the data sheets for the proper PIN number - pin function matches.

The most common issue in serial comm IMO is mixing up TX/RX, ending up connecting TX to TX, RX to RX. Have you checked for that?
 

Offline Daniel BingamonTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: MAX232ECN to Atmega 328P Microprocessor
« Reply #4 on: May 08, 2023, 12:20:07 am »
Thanks for the comments.   The 328 was programmed on an Arduino board and the program was tested there.
Also, I have removed the Atmega 328 and jumpered pins 2 and 3 and got echo back on the PC.

I've used LED on TX and RX RS232 lines in the past with no problems.
If I ground the TX pin with the Atmega removed the RS232 side goes positive and illuminates the LED.   When TTL side of the MAX232 is grounded, the RS232 should go positive, when TTL is high, RS232 should go negative - and it does.   I'm beginning to think that there processor is not starting on this board but is starting when plugged into the Arduino board.
 

Offline Daniel BingamonTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: MAX232ECN to Atmega 328P Microprocessor
« Reply #5 on: May 08, 2023, 12:33:26 am »
Do the two capacitors on either side of the crystal have to be 22pF, will 20pF suffice?
 

Offline Daniel BingamonTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: MAX232ECN to Atmega 328P Microprocessor
« Reply #6 on: May 08, 2023, 01:32:44 am »
Status update.   I now have transmit working.   One of the two capacitors for the crystal looked different, color wasn't the same - I replaced it and now it transmits.
I think the other cap was bigger than 20pF, like 220 or something.   Two 20pf's works fine.
 
The following users thanked this post: dobsonr741


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->