Hi everybody!
I'm an undergrad student attempting to use cc1101 as a receiver using msp430. At present, GDO0 pin (connected to P1.7 of MSP in the experimenter's board) has been configured such that it gets asserted when SYNC word has been received and gets de-asserted once packet reception is complete and the program is written in such a way that assertion and de-assertion of the pin P1.7 generate interrupts where the interrupt service routine displays "Sync word received" and "Packet reception complete" on the terminal i/o. The problem is that P1IFG7 flag gets set on it's own when SRES command is issued, leading to an interrupt being generated on P1.7 as soon as P1IE is set (Interrupts are enabled on port 1), thereby falsely displaying that sync word and packet have been received, when infact NOTHING HAS BEEN TRANSMITTED YET. Giving a software solution by clearing P1IFG flag before enabling interrupts doesn't seem to work as the flag doesn't get cleared. How do I fix this? What could be the problem?
My code follows the following sequence:
- Power on reset code +SRES
- Set CC1101 to idle mode.
- Flush TX and RX FIFOs
- Configure all registers
- P1IES&=0x7f (High to low transition generates interrupt on P1.7)
- Enable GIE
- SCAL command strobe
- P1IE|=0x80 (Enable P1.7 interrupts)// This is when the isr is falsely getting started right now
- Issue SRX command strobe.
Thanks in advance!