Discussion for ongoing projects. The more you post progress information, the best Ikalogic members will follow your project and be able to assist you.
Moderator: ikalogic
by chandpriyankara on Mon Mar 22, 2010 3:46 am
hey guys..., why dont we talk on other available easy to use wireless communication tools for robotics and related application?
like: TWS434 + RWS 434, Bluetooth radio Modules, .. etc.
-

chandpriyankara
-
- Posts: 20
- Joined: Tue Jan 26, 2010 12:48 pm
- Location: Sri Lanka
-
by charlie65 on Mon Mar 22, 2010 5:35 am
I am working on experimenting with the CC2500 and have planned a PCB for that.
Attached please find the schematic and Overlay of the Test Jig that I have designed.
I am awaiting for the PCB's, when I have them I would post further development.
There are some minor discrepancies between the schematic and Overlay, but that should do.
regards.
- Attachments
-

- Overlay
-

- Schematic
-
charlie65
-
- Posts: 13
- Joined: Mon Feb 22, 2010 8:32 am
by ikalogic on Mon Mar 22, 2010 11:10 am
Hi charlie.. that's really interesting.. keep us updated!
Das Leben ist gar nicht leicht (don't send me PM in German, i don't speak German, but i like this language  )
-

ikalogic
- Site Admin
-
- Posts: 1384
- Joined: Wed Jan 02, 2008 2:00 pm
- Location: Limoges, France
-
by chandpriyankara on Mon Mar 22, 2010 5:24 pm
i think this module support for both bit wise operation and packet mode operation. also may support FEC(Forward Error Correction), channel selection, etc. 
-

chandpriyankara
-
- Posts: 20
- Joined: Tue Jan 26, 2010 12:48 pm
- Location: Sri Lanka
-
by charlie65 on Mon Mar 22, 2010 8:49 pm
This (module) is the best it can get on RF, just a little understanding is required and you can work it over. I had successfully worked the CC1100 module and I thought the CC2500 was similar , so I ported my code to this module and it did not work (obviously) . So now I have a test jig for just this module and have studied all the resistors and would go ahead and experiment with this module.
I was impressed seeing a demo of the Phillips Living Lights (Mood light / RGB Fader) controlled with a CC2500 somewhere on the net (Youtube). I am now planning to implement this using CC2500.
More on it as I progress.
regards
-
charlie65
-
- Posts: 13
- Joined: Mon Feb 22, 2010 8:32 am
by anwr.ah on Wed Jul 28, 2010 10:19 am
Thanks a lot for the schematics... can you plz post code too? i mean i am finding it hard to configure the cc2500 registers. plz help.. thanks
-
anwr.ah
-
- Posts: 3
- Joined: Wed Jul 28, 2010 10:13 am
by charlie65 on Wed Jul 28, 2010 7:06 pm
Sorry, at present , even I am struggling to get the code to work. The registers are a mystery to configure.
Hope some one has mercy and post the register listing.
regards
-
charlie65
-
- Posts: 13
- Joined: Mon Feb 22, 2010 8:32 am
by anwr.ah on Thu Jul 29, 2010 1:58 pm
I have some sample code for MSP430 microcontroller interface to cc2500 provided as a sample code by chipcon itself. I am trying to modify that. Plz tell me if I am right or wrong... What i think is to be done is - 1. Get register config from smart rf studio. 2. to configure registers, first send register address and then the corresponding register value, via the spi interface. 3. after configuration is done, send data to be transmitted in burst mode.. Please tell if I am going right. As of now, I have a little work with the hardware itself too. 
-
anwr.ah
-
- Posts: 3
- Joined: Wed Jul 28, 2010 10:13 am
by charlie65 on Thu Jul 29, 2010 4:28 pm
IMHO, first and foremost, have a printout of the datasheet handy for easy reference. Each of the register values are tricky. You need to know what each of the registers do and mean. Because, Smart RF Studio will just give you register values, assuming that you know what they mean. I have some BASIC code subroutines , that may help you understand the procedure. Setup: - Code: Select all
Dim CC_TE As PORTC.4 ' OUTPUT, Chipcon Tx EN Dim CC_CS As PORTC.3 ' Output, Chipcon Chip Select Active LOW Dim CC_SCLK As PORTC.1 ' Output, Chipcon SPI SCLK Dim CC_MISO As PORTC.2 ' Input, Chipcon SPI Data Output Dim CC_MOSI As PORTC.0 ' Output, Chipcon SPI data Input Dim STAT_LED As PORTC.5 ' LED OUTPUT (SOURCE), ACTIVE HIGH Dim CC_Status As Byte ' Chipcon status register value Dim CC_Addr As Byte ' Chipcon register address value Dim Reg_WR As Byte ' Chipcon register write value Dim INDEX As Byte
Very first you reset the chip. - Code: Select all
CC_RESET: High STAT_LED : CC_TE = 0 : CC_SCLK = 1 : CC_MOSI= 0 CC_CS = 0 : CC_CS = 1 : DelayUS 42 : CC_CS = 0 While CC_MISO = 1 : Wend CC_Addr = _SRES : Reg_WR = _SNOP : GoSub load While CC_MISO = 1 : Wend DelayMS 500 : Low STAT_LED RSOut "==> MODULE RESET <==",CR Return
Then you program all the registers with the value you got from Smart RF Studio. - Code: Select all
multi_reg_write: High STAT_LED : Low CC_TE ; VISUAL INDICATION ; bit 7 of address byte clear to write to a register. ; bit 6 of address byte set to write to group of regs. 'CC_Addr = (CC_Addr | %01000000) : DelayUS 10 CC_CS = 0 ;Enable register programming SHOut CC_MOSI,CC_SCLK,1,[%01000000] For INDEX = 0 To 46 SHOut CC_MOSI,CC_SCLK,1,[INFO[INDEX]] Next INDEX CC_CS = 1 : Low STAT_LED ;End register programming Return
The Speed of the SPI is also critical, a slower Xtal will not help. After doing this, it is important to calibrate the VFO - Code: Select all
CC_Addr = _SCAL : Reg_WR = _SNOP : GoSub reg_write ' CALIBRATE VCO
Now that you are ready, put the module in Rx mode - Code: Select all
CC_Addr = _SRX : Reg_WR = _SNOP : GoSub reg_write ' ENABLE RECEIVER
Status register is the most Important register that you need to monitor after every read/write operation - Code: Select all
RD_STAT: 'CC_Addr = (CC_Addr | $C0) ; Make addr 6 and 7 bit 1 to read a CC_Status = 0 ; CC1100 status register. CC_CS = 0 ;Enable register programming While CC_MISO = 1 : Wend DelayUS 100 SHOut CC_MOSI,CC_SCLK,1,[%1100-0000] DelayUS 10 SHIn CC_MISO,CC_SCLK,0,[CC_Status] CC_CS = 1 RSOut "Status Byte ==>",SPACE,Bin8 CC_Status ,SPACE,Dec2 CC_Status, CR CC_Addr = _MARCSTATE : GoSub reg_read RSOut "MARCSTATE",SPACE,"0xF5", SPACE,"==> 0x",Hex2 Reg_WR,SPACE,CR Return
When you are ready for Rx, take the CC_CS high. now when you Tx from another module, the data comes and gets filled in Rx_buffer and CC_MISO acts as an int pin to give you that indication that there's mail  in your mail box (Rx_buffer). So when you have a mail, you go and check the Rx_Buffer. - Code: Select all
READ_FIFO:
High LED1 : High LED2 : High LED3 : High LED4 High STAT_LED : Low CC_TE ; VISUAL INDICATION ; CC1100 registers While CC_MISO = 1 : Wend ; WAIT FOR SO TO GO LOW CC_CS = 0 ;Enable register programming SHOut CC_MOSI,CC_SCLK,1,[%11111111] DelayUS 10 For INDEX = 0 To 2 ; BUFF_LEN SHIn CC_MISO,CC_SCLK,0,[INFO[INDEX]] Next INDEX CC_CS = 1 ;End register programming For INDEX = 0 To 2 ; BUFF_LEN RSOut "INDEX",SPACE,":",Dec INDEX ,SPACE,"==> ",Dec INFO[INDEX],CR Next If INFO[0] = 1 Then Low LED1 If INFO[0] = 2 Then Low LED2 If INFO[0] = 3 Then Low LED3 If INFO[0] = 4 Then Low LED4 CC_Addr = _SIDLE : Reg_WR = _SNOP : GoSub reg_write ' IDLE MODE CC_Addr = _SFRX : Reg_WR = _SNOP : GoSub reg_write ' FLUSH RX BUFFER CC_Addr = _SRX : Reg_WR = _SNOP : GoSub reg_write ' GO BACK TO RX RSOut CR,CR : Low STAT_LED Return
for sending a mail or data, I use the following code - - Code: Select all
KEY4: High STAT_LED : Low CC_TE While SW4 = 0 : Wend CC_Addr = _SIDLE : Reg_WR = _SNOP : GoSub reg_write : DelayMS 100 CC_Addr = _SFTX : Reg_WR = _SNOP : GoSub reg_write ' FLUSH TX BUFFER DelayMS 100 ' ADD DATA TO THE FIFO CC_Addr = _FIFO : Reg_WR = 4 : GoSub reg_write : DelayMS 100 CC_Addr = _FIFO : Reg_WR = 8 : GoSub reg_write : DelayMS 100 CC_Addr = _FIFO : Reg_WR = "D" : GoSub reg_write : DelayMS 100 High CC_TE : DelayMS 100 ' ENABLE PA CC_Addr = _STX : Reg_WR = _SNOP : GoSub reg_write ' ENABLE TX DelayMS 700 : Low CC_TE : Low STAT_LED ' DISABLE PA CC_Addr = _SIDLE : Reg_WR = _SNOP : GoSub reg_write ' IDLE MODE GoSub EN_RX Return
This code is just for 1 key, you can replicate it for as many keys you want. some more data which you can use for initialization - Code: Select all
; CC1100 STROBE ADDRESSES Symbol _SRES = $30 ;RESET CHIP Symbol _SFSTXON = $31 ;CALIBRATE FREQUENCY SYNTHESIZER & TURN ON Symbol _SXOFF = $32 ;TURN OFF CRYSTAL OSC. Symbol _SCAL = $33 ;CALIBRATE FREQ SYNTH AND TURN OFF Symbol _SRX = $34 ;ENABLE RECEIVER Symbol _STX = $35 ;ENABLE TRANSMITTER Symbol _SIDLE = $36 ;GO INTO IDLE MODE Symbol _SAFC = $37 ;PERFORM AFC ADJUSTMENT Symbol _SWOR = $38 ;START WAKE ON RADIO POLLING Symbol _SPWD = $39 ;ENTER POWER DOWN MODE WHEN CHIP SELECT HIGH Symbol _SFRX = $3A ;FLUSH RX FIFO BUFFER Symbol _SFTX = $3B ;FLUSH TX FIFO BUFFER Symbol _SWORRST = $3C ;RESET REAL TIME CLOCK Symbol _SNOP = $3D ;NO OPERATION
; iNITIALIZE ON BOARD TRANSCEIVER REGISTERS INFO[0] = $2E ' 0x00 GD02 Pin Setting INFO[1] = $86 ' 0x01 GD01 Pin Setting INFO[2] = $06 ' 0x02 GD00 Pin Setting INFO[3] = $07 ' 0x03 FIFOTHR - RX,TX FIFO Thresholds INFO[4] = $D3 ' 0x04 SYNC1 - Sync Word High Byte INFO[5] = $91 ' 0x05 SYNC0 - Sync Byte Low Byte INFO[6] = $03 ' 0x06 PKTLEN - Packet Length INFO[7] = $04 ' 0x07 PKTCTRL1 - Packet Automation Control INFO[8] = $04 ' 0x08 PKTCTRL0 - Packet Automation Control INFO[9] = $00 ' 0x09 ADDR - Device Address INFO[10] = $00 ' 0x0A CHANNR - Channel Number INFO[11] = $06 ' 0x0B FSCTRL1 - Freq Synth Control INFO[12] = $00 ' 0x0C FSCTRL0 - Freq Synth Control INFO[13] = $0C ' 0x0D FREQ2 - Freq Control Word High Byte INFO[14] = $1D ' 0x0E FREQ1 - Freq Control Word Mid Byte INFO[15] = $89 ' 0x0F FREQ2 - Freq Control Word Low Byte INFO[16] = $F6 ' 0x10 MDMCFG4 - Modem Control 4 > Sets RXBW INFO[17] = $83 ' 0x11 MDMCFG3 - Modem Control 3 INFO[18] = $03 ' 0x12 MDMCFG2 - Modem Control 2 INFO[19] = $A2 ' 0x13 MDMCFG1 - Modem Control 1 INFO[20] = $F8 ' 0x14 MDMCFG0 - Modem Control 0 INFO[21] = $15 ' 0x15 DEVIATN - Deviation Setting INFO[22] = $07 ' 0x16 MCSM2 - Radio State Machine Config INFO[23] = $1F ' 0x17 MCSM1 - Radio State Machine Config INFO[24] = $04 ' 0x18 MCSM0 - Radio State Machine Config INFO[25] = $16 ' 0x19 FOCCFG - Freq Offset Compensation INFO[26] = $6C ' 0x1A BSCFG - Bit Sync Config INFO[27] = $03 ' 0x1B AGCTRL2 - ACG Control 2 INFO[28] = $40 ' 0x1C AGCTRL1 - ACG Control 1 INFO[29] = $91 ' 0x1D AGCTRL0 - ACG Control 0 INFO[30] = $87 ' 0x1E WOREVT1 - Wake On Radio Event 0 Timeout INFO[31] = $6B ' 0x1F WOREVT0 - Wake On Radio Event 0 Timeout INFO[32] = $F8 ' 0x20 WORCTRL - Wake On Radio Control INFO[33] = $56 ' 0x21 FREND1 - Front End RX Config INFO[34] = $10 ' 0x22 FREND0 - Front End TX Config INFO[35] = $E9 ' 0x23 FSCAL3 - Freq Synth Calibration 3 INFO[36] = $0A ' 0x24 FSCAL2 - Freq Synth Calibration 2 INFO[37] = $00 ' 0x25 FSCAL1 - Freq Synth Calibration 1 INFO[38] = $1F ' 0x26 FSCAL0 - Freq Synth Calibration 0 INFO[39] = $41 ' 0x27 RCCTRL1 - RC oscillator configuration INFO[40] = $00 ' 0x28 RCCTRL0 - RC oscillator configuration INFO[41] = $59 ' 0x29 FSTEST - Freq synthesizer calibrate control INFO[42] = $7F ' 0x2A PTEST - Production test INFO[43] = $3F ' 0x2B AGCTEST - AGC test INFO[44] = $81 ' 0x2C TEST2 - Various test settings INFO[45] = $35 ' 0x2D TEST1 - Various test settings INFO[46] = $09 ' 0x2E TEST0 - Various test settings
I had successfully worked the CC1100 using parts of the above code, but it simply did not work for the CC2500. That meant, I had to break my head (Study) the data sheet for the CC2500 and see what should be different. The important thing is the register values and I was looking at shortcuts trying to copy & paste from other working example. It did not work. But , given some time and the hardware (which I have ready) , I can surely crack it. I now have got some long range CC1100 modules and I would now be concentrating on them rather than the CC2500. But CC2500 should have been more easier than the CC1100, but don't know. So you can give it a shot and tell me how it goes. regards
-
charlie65
-
- Posts: 13
- Joined: Mon Feb 22, 2010 8:32 am
by anwr.ah on Fri Jul 30, 2010 7:25 am
Thanks a lot for the code. Its helpful. This is how my connections are. Point out if there is any mistake.

- CC2500_2.jpg (21.82 KB) Viewed 91 times
Writing code in C now. Will post it soon.
-
anwr.ah
-
- Posts: 3
- Joined: Wed Jul 28, 2010 10:13 am
by charlie65 on Fri Jul 30, 2010 8:39 am
No, it does not tally, anyway, I have uploaded the Datasheet of my module.
Although it looks the same, it may be different, but its important, not to mess around with it , unless you know the exact pin out.
All the best for the code and do share your findings. May help someone (and me off-course) .
regards
- Attachments
-
ST-TR2.4D.pdf
- (328.96 KB) Downloaded 10 times
-
charlie65
-
- Posts: 13
- Joined: Mon Feb 22, 2010 8:32 am
Return to Ongoing projects
Users browsing this forum: No registered users and 1 guest
|