Arduino Pro Micro and MAX 3232

Hi,

PROBLEM #1:
I have a Pro Micro I have been trying to hookup to my Ham Radio Transceiver. In order to do this I have used a MAX-3232CES, taken the output from the radio and ran it through the MAX3232. The output from that has been patched into the RX1 pin of the Arduino. The radio sends data enclosed in a header which starts with 'FF' 'FF'.

When the radio starts sending on the Arduino all I do is:

void loop()
{

while(RIG.available() > 0)
{
unsigned int val = RIG.read();
Serial.println(val, HEX);
}
}

As far as I can tell the packets from the radio are the correct length, baud rate is set correctly (9600) but the actual output doesn't match. The above code outputs:

80
80

for the the first two bytes of the header, instead of:

FE
FE

None of the data from the radio seems to match, like it is only receiving part of the message. I have tried changing the baud rates, but that doesn't help. Anyone have any ideas? The radio works fine when connected to the laptop.

PROBLEM #2:
Connecting the output from the MAX3232 to the TX0 on the Arduino causes the input to stop working.

Thanks.

matt

RIG.available ? Is that part of some library?
Consider posting your entire sketch (between "code tags") and your circuit.
[Don't be lame - draw it out and take a picture or work it out in Paint, and attach that - see Additional Options, lower left.]

if (Serial.available() > 0)

Hi,

sure I can post it, not much there...

#define RIG Serial1

#define DEBUG 1

#define READSWR 0
#define READFREQ 1
#define READPOWER 2
#define READMODE 3

#define ICOM7000 0x70
#define ICOM706MKIIG 0x58
#define ICOM706MKII 0x4E
#define ICOM706 0x48

#define MODE_RTTY 0x04;
#define THIS_ADDR 0xBB;

// The computer address is 0x01 and is "hard-coded" since there's only
// one device other than the rig itself on the bus and that is the Arduino

void setup()
{
RIG.begin(9600);
}

void loop()
{
while(RIG.available() > 0)
{
unsigned int val = RIG.read();
Serial.print(val, HEX);
Serial.print(" -- ");
Serial.println(val);
}
}

I have attached the diagram for the MAX 3232 (diagram shows a MAX232 which I have tested and that I have the exact same issue with). So, PIN 13 is connected to RX0 and PIN 14 is connected to TX1 on the Arduino. I am using a surface mount MAX3232 you can see here (bit.ly/1mLLaJq ).

-matt

Are you just doing a blind copy&paste and hoping for the best?

I dropped a big clue for you in the last line of my previous reply.
Here's another
http://arduino.cc/en/Serial/available

I don't think that circuit is appropriate to the context here (esp. that "C5").
See dwg attached.

Guess I forgot to attach the dwg (NO - had to rename it)

3232max.JPG

The C5 and the associated coils are to prevent any RFI from entering the circuit. This works just fine, as I have used it, for a laptop.

Not sure on the 'hint'. Are you saying I should use a while-loop to clear out the buffer prior to letting the loop() method continue? Keep in mind the amount of data coming through is 'small' each packet only has 8 bytes at max and there is little to no chatter on the line.

-matt

This isn't a laptop.
Perhaps you could explain the merit of jumpering pin 11 to 12.
Loopback?
I think that presents a problem.

if(Serial.available() > 0)  // if data from external device presents
{
  byte xcvrdatum = Serial.read();  // put the data somewhere
}
Serial.print(xcvrdatum, HEX);
  1. The input requires jumpering as the input is a single line TTL input. The data arrives in NRZ format. I have checked this on the Oscilloscope and it works as described. Jumpering is most probably not the issue. These exact same circuits have been in use for nearly 3 decades and they work just fine.

  2. Not sure why doing the print to the other serial port outside of the IF-statement is an issue - please keep in mind that for the test all the transceiver sends is 10 bytes of information, so overflow of the input buffer is not a problem in the test. However I have tested that, nonetheless and it makes no difference.

mtatro:

  1. The input requires jumpering as the input is a single line TTL input. The data arrives in NRZ format. I have checked this on the Oscilloscope and it works as described. Jumpering is most probably not the issue. These exact same circuits have been in use for nearly 3 decades and they work just fine.

"They work just fine" on something entirely different.
You stated:
"PIN 13 is connected to RX0 and PIN 14 is connected to TX1 on the Arduino"
Pins 13 and 14 of the MAX232 are supposed to go to the RS232 device (the radio, if it's an RS232 compliant port - Is It?)
The Arduino pins are not RS232 at all - they are TTL/5V.

Refer to the dwg in my previous post (Reply #3)

The only MAXx232 pins that have any business going to any Arduino I/O pin are 9, 10, 11, 12

I don't see a dwg on post #3...

It's there - as an attachment. No?
Reply #3

The datasheet is at
http://datasheets.maximintegrated.com/en/ds/MAX3222-MAX3241.pdf

Look at page 12, "Typical Operating Circuits", your device is there on the right.