For weeks I have been trying to gain connection between two CC2500EM (Evaluation Modules). As per the TI HAL programming example my end goal is to be able to send one packet with one board and receive it on the other board. I do not have the HAL evaluation kit, but I am trying to simply receive one packet per second using the polling method utilising the CC2500EM.
I am unable to consistently receive packets. I get a large amount of packet loss and byte corruption (No CRC at the moment). Currently I have a RX program set to poll RXFIFO, when a packet arrives it will read the length byte, then read “length” number of bytes from RXFIFO and into an array (using variable packet setting, but sending a fixed size of packets). Every time it reads a new packet, it will append the packet to the array so I can see what I am receiving.
My TX program is correctly set up to send 4 bytes (Length, 3xData). Using the MSP430 Timer it will send this packet 10 times a second. With this setup (current code attached), I am able to receive the majority of packets, however some are duplicated. I thought when you read off RXFIFO, they are removed from the stack. Therefore in the next iteration, it cannot read the same data? This takes about 4 seconds to receive 30 packets, which I think is a reasonable rate. Is this normal?
My key issue is when I reduce the number of packets sent per second (pps) to 5, the packet loss percentage increases dramatically (say from 25% to 60%+). To receive 30 packets, it then takes around 30 seconds to correctly receive 30 packets, with a larger amount being corrupted (20-30% compared to 5-150%). A higher resolution results in a higher accuracy. Can anyone please explain the logic behind this? In my application, I want to be able to send 3-4 packets per second, and be able to receive 100% of these. Is the amount of packets I am losing normal? What can I do to reduce packet loss?
In a previous coding example I have attempted to send strings such as “AAAAAA” in ASCII. I commonly had another issue which would occasionally change some of these bytes in the string. This change was consistent however. When I sent “AAAA” (41 41 41 41 hex) , 80% of the time I would get a match, but the other 20% I would get something like “AA ” (41 41 01 01 hex). This change is some kind of consistent bit shift. When I changed it to “XXXX” (58 58 58 58 hex) some of these changed to “X@@X” (58 40 40 58 hex). Lastly “UUUU” (or 55 55 55 55 hex) sometimes changed to “UUEE” (55 55 45 45). Is there anything in my programming or hardware (further detailed below) that may cause this?
Attached are 3 images showing the result of receiving packets (Also found here: http://imgur.com/zMbr18v,prHmgbr,Q5ARxKa). The result should be incrementing every packet sent (packets separated by 0x00 0x00). As you can see, in perhaps 20% of packets, there is a byte that is 0x00 rather then what it should be. What could be the cause of this?
I have been banging my head against a wall for weeks and have finally posted here. I have tried to connect the two EM boards using shielded coaxial cable to ensure it is not a connection issue. I have tried hundreds of different changes, tested different SmartRF Studio settings, and tested sending various packet sizes/speeds with limited success. Another key thing to note is that when I use 32 bit sync bytes I get an even higher packet loss percentage (perhaps due to the bit shifting detailed above).
Further details of my setup:
Software: My functions are sourced from the DN400 application code (and other examples like that - https://github.com/alvarop/msp430-cc2500). I know the way I am sending/receiving packets is not ideal, but I am just trying to troubleshoot the problem but should be correct to the very core elements. Initially, I used all of the send/receive functions as per the examples. Without any success, I have been slowly pulling apart the functions to the very basics (as shown in RX.c). I apologise for my program being very messy, this is due to it being pulled apart countless times.
The program is attached and can also be found here: https://www.dropbox.com/s/4uy4ucyiyfoaprb/CC2500.rar
Hardware: I am currently using a surface mount MSP430F2112 connected to the CC2500 Evaluation board through breadboard. The MSP430 has minimum components to get it running (crystal, reset network, debouncing caps etc) and is connected to IAR (v4.11) through a JTAG connector (MSP430-JTAG-TINY-V2). The SPI is connected from vias connected to the MSP430 pins, into the breadboard, through the CC2500EM connector to the relative pins on the CC2500. Could the data be getting effected due to the current setup? I thought this was unlikely but would like to flag it anyway.
Any assistance in any area would be greatly appreciated.