Single wire serial-line noise
I have one SX-28 talking to another SX-28 using a single wire serial connection. The second SX-28 is controlling an LCD.
The problem is, I'm receiving random characters in between and after the actual characters I'm sending to the LCD panel. I moved the serial wire over to a BS2 and it worked perfect. So, I have to believe there is something up with the SX-28. Should I have the SX-28 port set to TTL or CMOS?
I'm using the same schematics and hookup as shown in the LCD example from the SXB help file.
I put the ocsilliscope on the serial line, and the garbage characters are actually coming in on the line from the first SX-28. Could this be caused by a timing issue or line noise?
I'm using the SEROUT command on both the BS2 and SX-28. I'm starting to wonder if the difference is in the way the BS2 and SX-28 handle that command. On the BS2, I can send a string, and on the SX-28 I can only send a byte at a time. To communicate with the LCD panel, I need to send two bytes, one with the command and the other with the character I want to display.
Thanks in advance!
Dan
The problem is, I'm receiving random characters in between and after the actual characters I'm sending to the LCD panel. I moved the serial wire over to a BS2 and it worked perfect. So, I have to believe there is something up with the SX-28. Should I have the SX-28 port set to TTL or CMOS?
I'm using the same schematics and hookup as shown in the LCD example from the SXB help file.
I put the ocsilliscope on the serial line, and the garbage characters are actually coming in on the line from the first SX-28. Could this be caused by a timing issue or line noise?
I'm using the SEROUT command on both the BS2 and SX-28. I'm starting to wonder if the difference is in the way the BS2 and SX-28 handle that command. On the BS2, I can send a string, and on the SX-28 I can only send a byte at a time. To communicate with the LCD panel, I need to send two bytes, one with the command and the other with the character I want to display.
Thanks in advance!
Dan
Comments
Are you using the internal clock ? If so it is not accurate enough for serial data.
If you are using an external resonator, then I'm not sure what is going on ?
Post your code.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
The code on the second SX-28 is exactly the same as the code in the SXB Help file, under Serial LCD Example.
I have attached the code for the first SX-28.
Thanks again Bean!
Dan
-Phil
The resistors are connected to the second SX-28, it controlls the LCD.
Thanks!
On your DEVICE line, you have "OSC4MHZ" that means to use the internal 4MHz.
Change it to OSCXT1 for the 4MHz resonator.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
Could I also use?: OSCHS1
Thank you very much!!!
Dan
Post Edited (DosManDan) : 6/14/2008 5:37:21 AM GMT
No problem, it is a common mistake.
I ususally use OSCHS1 for 20Mhz.
Sometimes you have to experiment with the different OSC settings to get the resonator to run properly.
I usually start at the lowest and move up until it works reliably.
Using a setting that is too high will cause the SX to draw more current, and could damage the resonator.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
Dan