Other Parts Discussed in Thread: CC2543, CC2545
Hi,
I need to get this chip set running really quickly,
Is there any one that has the CC2543 running in basic mode that would share their RF setup & run code?
Thanks for your help.
Larry
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Larry,
there is an example for the CC254x Propietary Mode Packet Error Rate Test which can be found at the following link:
Thanks Leo,
I have that app and have been trying to modify it to basic mode. It's presently in auto ack mode.
I'm looking for a quick way to get running in basic mode.
Thanks again.
Larry
Hello Larry,
We do not currently have any finished code for basic-mode on web. SmartRFStudio uses the devices in Basic-Mode. I would suggest that you start looking at the PER test and trim it down and use register settings from SmartRFStudio. There are a few register you probably need to have different from SmartRFStudio, but if you post questions as you go along we will be happy to answer them.
BR. Eirik
Hi Erik,
I used the SmartRFStudio setting for my CC2543 transmitter HW & it works well to a SmartRFStudio receiver.
I then put the receive settings into my CC2545 receiver HW & used the Timer2 interrupt routines from the per_test.
The receiver keeps coming out of the TASKDONE with a timeout error. I've listed the code below:
halRfDisableRadio( FORCE ); // Reset LLE (radio).
halRfInit(); // Enable radio in default beacon mode.
halRfConfig( GFSK_250kbps_160khz, RX, 16, PKT_CONF_NRF );
halRfSetFrequency( 2420 );
halRfEnableRadio();
halRfInit(); // Enable radio in Basic mode.
halTimer2SetRadioTimeout( 500, SINGLE ); // Set 500 ms for radio timeout.
halRfEnableInterrupt( RFIRQF1_TASKDONE ); // Enable RF interrupt.
halIntOn(); // Enable global interrupt.
// halTimer2Start(0); // Start timer 2 (asynchronous).
FOREVER
{
halRfStartRx(); // Start receiver.
halTimer2Start(0); // Start timer 2 (asynchronous).
// Wait for TASKDONE and halt CPU (PM0) until task is completed.
while ( !( rfirqf1 & RFIRQF1_TASKDONE ))
{
#if(POWER_SAVING)
halSleepEnterPowerMode( CPU_HALT );
#endif
}
if ( PRF.ENDCAUSE == TASK_ENDOK ) // Task ended without error.
{
if (( rfirqf1 & RFIRQF1_RXOK ) == 1 ) // Check if packet was received.
{
halRfCommand( CMD_RXFIFO_RESET );
length= RFD;
for ( i= 0; i < length; i++ )
{
dataByte= RFD;
Please let me know where the bug is.
Thanks, Larry
Hi Larry,
Larry Madore said:The receiver keeps coming out of the TASKDONE with a timeout error.
Timeout is not really an error. It is an indication that nothing was received within the time you have set up. In your code, I can see that you have set up a timeout of 500 ms, meaning that the receiver runs for 500 ms from you start Timer 2. Are you sure that a packet is transmitted by the peer before these 500 ms expire? If it isn't, timeout is the expected response.
In many cases you would want the receiver to run all the time. In that case, you should not call the halTimer2SetRadioTimeout function. At least, you could try first without a timeout, and if you get that to work, you can add the timeout and make sure the transmitter and receiver are synchronized.
Hello Larry,
I think hec is correct. Also make sure not to call halTimer2Start(0); and make sure there are no Timer2 functionality that can interfere with your flow as it seems you are restarting RX operation manually within an infinite loop anyway.
Hi Eirik,
I removed all Timer2 settings and now the code holds at the instruction;
while ( !( rfirqf1 & RFIRQF1_TASKDONE ))
I left the interrupt code in;
halRfEnableInterrupt( RFIRQF1_TASKDONE ); // Enable RF interrupt.
halIntOn(); // Enable global interrupt.
This looks like a receiver problem, although I have double checked all the settings;
Frequency, modulation etc. and they are the values from SmartRF Studio
any ideas?
Larry
Hi Eirik,
Success!!
I had the order of the radio initializing and radio enable wrong.
It works well and I will put new code in carefully as not to break it.
Thanks very much for your help & patience.
Cheers,
Larry