CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

rfm22 transceiver module - disable usb interrupts ??
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
klausdejong



Joined: 15 Nov 2004
Posts: 18

View user's profile Send private message

RFM23B
PostPosted: Tue Nov 20, 2012 9:30 am     Reply with quote

I'm trying to get the HopeRF RFM23B to work. What is the SPI-mode to be used?

Regards,

Klaus de Jong
crocu



Joined: 02 Nov 2009
Posts: 5

View user's profile Send private message

PostPosted: Tue Dec 25, 2012 4:55 am     Reply with quote

Hello

Would someone share a working project in order to send and receive with RFM22 modules ?

I did not find what SPI mode to use with these modules either, i did not find this information on the datasheet.

Many thanks for your help
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Dec 25, 2012 6:38 am     Reply with quote

For determining the SPI mode I always use the following table:
Code:
// SPI Mode | MOTOROLA | MICROCHIP | CCS                          | Clock line idle | Data clocked in at
//----------------------------------------------------------------|-----------------|-------------------
//          | CPOL CPHA|  CKP CKE  |                              |                 |
//    0     |  0    0  |   0   1   | SPI_L_TO_H | SPI_XMIT_L_TO_H | low             | low to high edge
//    1     |  0    1  |   0   0   | SPI_L_TO_H                   | low             | high to low edge
//    2     |  1    0  |   1   1   | SPI_H_TO_L                   | high            | high to low edge
//    3     |  1    1  |   1   0   | SPI_H_TO_L | SPI_XMIT_L_TO_H | high            | low to high edge
//
#define SPI_MODE_0  (SPI_L_TO_H | SPI_XMIT_L_TO_H)
#define SPI_MODE_1  (SPI_L_TO_H)
#define SPI_MODE_2  (SPI_H_TO_L)
#define SPI_MODE_3  (SPI_H_TO_L | SPI_XMIT_L_TO_H)

// Example:
setup_spi(SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_4 );


For the RFM22B and RFM23B look at Table 10 of the datasheet.
In idle the clock line is low. See table above, this means either SPI mode 0 or 1.
The data is clocked in at the rising edge, meaning SPI mode 0 or 3.
Both combined results in SPI mode 0 to be the correct one.
crocu



Joined: 02 Nov 2009
Posts: 5

View user's profile Send private message

PostPosted: Tue Sep 10, 2013 4:19 am     Reply with quote

When trying to send a payload with RFM22b, i often (most of the time) get the module locked-up in transmit mode : nIRQ won't go low although the string has been sent.

Then module stays in TX mode and gets very hot quickly.

According to datasheet if nIRQ does not go low after TX process it means transmission is not working properly.
Normally module needs about 90ms to transmit a string, then nIRQ should go back to low.


I use the Fixpkt mode, as same as 'danr' does.

Can someone show me how to proceed to send a test string with RFM22b module please ?

Many thanks for your help,
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Wed Sep 11, 2013 12:33 am     Reply with quote

So what do the status registers say is happening?.
Nirq, only says 'an even has occurred'. You need to read registers 3, and 4, to see 'what event'.
I'd suspect you have an error status being returned, not the packet sent status.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group