SX to SX Serial
ajajack
Posts: 26
I am new to coding in SX. I would like to connect two SX chips via serial connection (4800). Now, I want to make it so that one acts as a transmitter and can control an led on the reciever end. In the end I would replace the serial wire with the RF Link that SparkFun sells. The RF link acts as a serial connection between the two however adds noise on the reciever end, sending bytes that the transmitter didn't send. So I need to make sure that the serout is synced with teh serin. I think there is a way to do that by checking for a certain header or something. I don't know much about this and I was wondering if anybody was able to help me with some coding. Thanks.
Post Edited (ajajack) : 7/22/2008 12:15:46 PM GMT
Post Edited (ajajack) : 7/22/2008 12:15:46 PM GMT
Comments
In this example RX_BYTE is a shell for SERIN so that it only gets compiled once.
I've attached a test program for you to work with; if you have a PDB you can test both sides.
Clever trick! That's the first time I've seen __PARAM1 used for OUTPUT on a function. Makes sense! Sometimes it just takes thinking outside the box. As always, thank you for your gems of advice!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
It wasn't like that for me learning assembler. But it was that way when I was learning "Object Oriented Programming". I just didn't get it for about a month, then one day "Blink" it all made sense.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
· Actually that is very good question (at least with the SX).
· A name defined with EQU cannot be re-defined later.
· A name defined with "=" CAN be re-defined later.
· xxx EQU 5
· xxx EQU 10 ' Gives an error here
·but...
· xxx = 5
· xxx = 10 ' No error, this is okay
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
www.parallax.com/Portals/0/Downloads/docs/prod/datast/SX20AC-SX28AC-Data-v1.6.pdf
The link to this document can be found on the SX28 product page -- right under the word "Downloads,"
The LED blinked at the beginning of my code like I asked but would not blink again on the arrival of the serial header.· I don't understand what my problem is.
I hope others will chime in here if there is something else to consider.
Gary
Post Edited (JonnyMac) : 7/24/2008 4:45:30 PM GMT
So if I select slave 1 via the keypad, I want to also send a number to the display like 1234 or something.
I have seen and used the example·SX code of a keypad using an SX28 as a keypad·driver. Is it reasonable to expect that the sx28·master to the slaves could still·be used as a keypad driver·and master?
If so, I have seen the example code for the SX Slave, is there any for an SX Master?