Hi,
I bought the CC2530 ZDK.
At this time, i develop a program to send data to the computer with port serial RS232.
Now, I want send this data to PC with USB.
According to my research, with CC2530, we can not use USB to send data to PC. It is not configured.
Could you affirm my reseach?
Thanks for your help.
Regards,
Yoann
You cannot use the USB connector on the SmartRF05EB board for sending data from the CC2530EM, as it is for running the debugger. While debugging via the IAR to this H/W, you can send debug messages, but these are very slow and interfere with real-time ISR handling.
But in the CC2530ZDK kit that you have you will see one, small USB dongle, the CC2531USB-Dongle board. Note that this board has a CC2531 vice a CC2530, and the CC2531 does have a USB peripheral as part of the SOC and you can implement any USB class that you want. Most usable for your example is to implement the USB CDC class so that the dongle shows up on the Windows PC as a COM port that you can open and perform read/write like with any serial port. There are already HAL drivers that implement this virtual COM port on the SOC for you.
Hi Harry,
Thanks for your answer.
I have an other question for you.
Can I choose the txpower and the gain of the antenna on the CC2530 with the Z-Stack code. If I can, where?
Yes, Z-Stack 2.5.1 adds this command to control Tx power via the MT (monitor / test) serial API: MT_SYS_SET_TX_POWER
When compiling a sample application directly on the Z-Stack you have many ways of setting Tx power, so try the most basic way first:
/******************************************************************************************************** * @fn ZMacSetTransmitPower * * @brief Set the transmitter power according to the level setting param. * * @param Valid power level setting as defined in ZMAC.h. * * @return ZMacSuccess if PHY_TRANSMIT_POWER found or ZMacUnsupportedAttribute. ********************************************************************************************************/uint8 ZMacSetTransmitPower( ZMacTransmitPower_t level )
What is the default value of Tx power?
I read that the default value is 4.5 dB but I do not find it in the program.
0 dBm is default
So where is this value?
Hi, Harry,
I think the transmission power can be easily changed by adding this code in the initiation for Z-stack 2.5.0:
TXPOWER = value; //0xF5 for example
Right?
Wrong - as is the case many times, the easy way is not the correct way to do something. Directly modifying the TXPOWER register does not register this desired tx power with the Z-Stack library and unexpected changing back to the default 0 dBm can occur. There is no global configuration setting to change to change the default tx power - the application code must add a call to ZMacSetTransmitPower() with the desired tx power.
Thank you for pointing this out!!
Is there anything similar that I should be aware of, or are there some guiding documents for that?
PS: it is good to learn about that z-stack 2.5.1 has been released!