| ??? 11/08/01 09:27 Read: times |
#16416 - RE: 80c31 & BIM2 tranciever - more detailes |
Hezi,
As it has been said by others, first test your system using a direct link (wired, without the transceivers). If it works, then the following will be of interest for you (I hope): My system uses AM UHF transceivers. Yours are probably FM transceivers, much better rejecting noise. Even so, the best way to send data is in the form of short data streams (frames), say 8 to 16 bytes long, because this minimizes error rates. In the case your application needs to send more data, divide them into short frames. Also, don't use a high bit rate if you don't need it. >>Hezi wrote: What do U mean to send a header ? Frames usually begin with a pre-header or sync bytes (for example two FFs followed by two zeroes). These are folowed by the header, a sequence of bytes unique to your system (for example 'YH19'). The header identifies the frame so that the receiver can be sure that the message belongs to your system, and it is neither noise nor data coming from the neighbour's children radio controlled car. Your data follows the header. In the simplest case, the data field length is a fixed value. At the end of your data bytes, you can add a checksum byte (the modulo 256 addition of all the previous bytes in the frame, excluding the sync bytes) or a more complex check system, as a CRC16 (I have always used a simple checksum with good results). >> Hezi wrote: Can i have your advise how to write it (in ASM) that the 80c31 will understand it as a valid data. In my system, the MCU receives data using the serial port ISR. The ISR is written in the form of a very simple state-machine. Every time a byte is received it is compared to the expected value (for example when a header is expected) stored (if receiving data) or checked (if receiving checksum). A variable is used as a counter to store the number of bytes received so far, within the current frame. Do not consider the sync bytes as a part of the frame, that is, do not increment the counter until the first header byte is received. If the ISR detects an error (for example when a received byte does not match the expected header byte), it resets the byte-counter to zero. In fact, if your receiver collects much noise, the ISR will be entering very often, detecting that a valid header is not arriving and restarting the byte counter. When a valid byte arrives, the counter is incremented. When the counter reaches a determined value, the ISR knows that the current received byte is the checksum. The ISR tests the checksum and, if it is o.k., sets a flag (called for example frameok). The main program can test the frameok flag on a regular basis and execute the suitable code. If you need more assistance, I'll try to send you some code, though you will learn a lot writting your own code. Regards, Alfredo del Rio. |
| Topic | Author | Date |
| 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
| 80c31 & BIM2 tranciever - more detailes | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - more detailes | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
| RE: 80c31 & BIM2 tranciever - PLS HELP ! | 01/01/70 00:00 | |
RE: 80c31 & BIM2 tranciever - more detailes | 01/01/70 00:00 |



