lokeshbhatt
Joined: 16 Mar 2010 Posts: 11
|
RCIF undefined identifier |
Posted: Wed Mar 17, 2010 1:21 am |
|
|
Hi
PIC16F690, CCS
As I was getting problem in reception of gsm data I thought of using RCIF for checking any reception.
But it is showing error, undefined identifier.
I know that it is bit of PIR1 reg.
So how can I define and use RCIF ? _________________ Thanks & Regards
Lokesh Bhatt |
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19496
|
|
Posted: Wed Mar 17, 2010 2:55 am |
|
|
Multiple different answers:
First, this is what 'kbhit' does. When you setup #use RS232 for a hardware UART, if you call 'kbhit', it then returns the status of RCIF. So the 'CCS' way, would just be to test kbhit. The fact that such tests are available without tying the code directly to the hardware, is 'why' CCS doesn't normally include the accesses explicitly.
Second, would just be to define the bit, and access it. So:
Code: |
#byte PIR1=0xC
#bit RCIF=PIR1.5
|
Then you can use RCIF as a single bit 'register' value, and test it.
Third, if you have the 'IDE', then this has the ability to generate a file of all the register defines for a chip. If you select 'device editor', pick your device, then at the top of the window, pick 'registers', and then 'make include file'. This will generate a file containing all the bit and byte register defines for the processor. RCIF, will be defined as 'MCU_RCIF', to ensure that you want to talk to the actual bit in the processor.
Fourth, similar include files are available on the forum (search....).
Best Wishes |
|