Hi,
I have a GPS pack that send serial data with "NMEA" format.I'm going to connect it to an AVR MCU (atmega32). The baud rate of the GPS output (nmea) is 4800 . I set the baud rate but I did'nt get the correct answer. I changed the frequency and after that data changed too but srill it was wrong. What should I do?
Should I chang the frequency or baud rate?
Assuming you've got the AVR set to correctly read 4800?, then there's nothing to change - either it's right, or it's not!.
Assuming it is right?, the data might need inverting? - If you're using a software UART you can simply do it in software, if it's a hardware UART you most probably need a hardware inverter.
MAX232's invert the polarity of the data passing through them, so UART's are generally designed to use inverted signals, and the MAX232 inversion corrects it. If you're not using a MAX232, then you need an inverter of some kind.
My PIC RS232 tutorial goes into more detail, the PIC part might not help you much, but the RS232 part will.
But I'm reading data from a PS2 port of the GPS which doesn't need to be inverted.I connected the GPS to the MCU by using this port.
the GPS has got a female ps2 port which is connected to it directly and a cable for connecting tothe pc that has got 3 head, one of them is male ps2 for the GPS and another male PS2 for power and a rs232 for data.
and we show the information in a LCD.
If the output from the GPS can go directly to the PC then it must be correct RS232 polarity (assuming there's no inverter and level converter in the lead?), so add a MAX232 to your AVR serial pins.
Try using a Resistor (say 10k) and a 5v1 zener to pull the level of the RS232 output to 5Volts. Now feed this signal into the Atmel, if it all works well, then the TTL output is probably inverted
As, many already has pointed out, if you could connect the GPS directly to a PC and monitor it on hyperterminal, then you do need an level converter in between the AVR and GPS.
Hi,
My GPS is GM-R500 evermore .
As I said , my GPS generates 2 kinds of information , TTL level and RS232 level.
I use the TTL level , but I'm not sure if it is inverted or not.I have to check it.
Hi,
My GPS is GM-R500 evermore .
As I said , my GPS generates 2 kinds of information , TTL level and RS232 level.
I use the TTL level , but I'm not sure if it is inverted or not.I have to check it.
Add a MAX232 to your AVR serial port, and use the RS232 level - that way you KNOW it's all correct. You can also then connect the AVR/MAX232 to your PC and use HyperTerminal to test it.
Looking at the specification for your unit it says (and I admit I missed the point in your earlier posts) that this unit has PS/2 and RS232 and USB.
Well the PS/2 protocol, accroding to this page.... https://www.networktechinc.com/ps2-prots.html
Has a parity bit before the stop bit, you will need to deal with this, possiby you have not set parity on the PC? Mind you I am not 100% sure you can feed PS/2 data into a serial port (even with level shifting etc), is it standard serial Comms?? Anyone??
Anyway, do what Nigel said, you should be fine
Oh, and here is another page to get you really confused about circuits for inverting RS232