Timeline for UART - getting gibberish data from MAX232 with PIC16F877A mcu
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 12, 2015 at 16:03 | answer | added | Olin Lathrop | timeline score: 2 | |
S Nov 12, 2015 at 15:33 | history | suggested | Swanand | CC BY-SA 3.0 |
Added information provided by OP through comments in the question
|
Nov 12, 2015 at 15:23 | comment | added | Bitan Biswas | I have attached 20MHz Crystal with the MCU. I checked the baudrate in every component. Its is 9600. Is it correct? | |
Nov 12, 2015 at 15:13 | comment | added | Swanand |
@BitanBiswas I do suspect baudrate mismatch. Is Crystal frequency correct? How USARTInit() is reading XTAL freq from your main.c ?
|
|
Nov 12, 2015 at 15:10 | review | Suggested edits | |||
S Nov 12, 2015 at 15:33 | |||||
Nov 12, 2015 at 14:21 | comment | added | Bitan Biswas | Like when I am sending "G", I am receiving "��g����wf�}w��]w���" where I should receive "Green LED turned on", both are 19 character in length. | |
Nov 12, 2015 at 13:51 | comment | added | Swanand | @BitanBiswas Can you update question with what you expect against what you receive? | |
Nov 12, 2015 at 13:11 | comment | added | Bitan Biswas | I don't have the scope to check the actual voltage and waveform but I will try. But all you answers are noted. I will recheck. | |
Nov 12, 2015 at 13:04 | comment | added | Bitan Biswas | baud rate is same in both side. The string I am getting back is sometimes related and same length but not the exact same. I have checked the stop bit and parity bit. According to the code will it only accept the first character even if I send a string. When I am sending "G" Green LED is turning on but the "Green LED turned on" string is not coming properly | |
Nov 12, 2015 at 13:03 | comment | added | user16324 | If you have a scope, check the RS232 waveforms. Suspect dodgy voltage levels, or incorrect start/stop bit settings. | |
Nov 12, 2015 at 12:57 | comment | added | Swanand | Along with suggestions by @Icy, Do you get string "Connected" - to start with! Is baud rate same on both sides? | |
Nov 12, 2015 at 12:46 | comment | added | Icy | does the string you get back related to the string you expect? i.e. is it the right length? are any characters correct? have you checked settings for no of bits and parity - at both ends? What happens if you send shorter strings or just single characters? | |
Nov 12, 2015 at 12:45 | review | First posts | |||
Nov 12, 2015 at 13:12 | |||||
Nov 12, 2015 at 12:36 | history | asked | Bitan Biswas | CC BY-SA 3.0 |