Folks, is there anyone here, who fully understands how to talk to these modeles. Not interested in some kid who has stuck a load of modules on an arduino written by someone else together, but someone who has actually written everything from scratch, or at least fully understands how to get these things to chat.
I am not finding the manual absolutely clear as to the finer details, which I suspect I am missing something (or my modules are really dodgy Chinese rips!)
Basically, I have written an SPI routine (never done this before) in assembly for a PIC16f688 and I am fairly happy with it. You enter data in to 4 registers initially, two that contain where to raise CSN, (which are rotated end of each group of clock cycles) then the number of writes in another register, number of reads in a further register, then it's a case of just entering up to 15 addresses / data's and the code does the rest to produce SPI (at the moment, phase and pol are 0-0). MOSI is rotated out of registers 0x6X and in to the end. Thus it is kind of FIFO.
SO I think I have got that bit right. I have got everything moving slowly, as I am based on breadboard for now.
Good News, I do I get a MISO response from the RF unit. Bad news, I can't really seem to make much sense of it or control the modules! I am obviously overlooking something.
I will try to get a trace at work tomorrow, but for now below is an MPLAB sim of the data sent out without obvious MISO, which, like I said above, I do get.
I have skipped the majority of config in this example as I thought I would show how I am setting a receive address in Data Pipe 0. I am sending [CSN LOW] 0x0A followed by 0xAA 0xAA 0xAA [CSN HIGH]. clock is approximately 500uS each cycle, 1mS rest between each byte of data, CSN highs are 760uS. At the end of transmitting this I then set to expect 3 bytes in RX_PW_P0 with [CSN LOW] 0x11 0x03 [CSN HIGH]. You can see the CE pin going high at the far end too.
The MISO data I am getting back I am struggling to understand, and I have tried transmitting (I put it off as long as I could!) to no avail.
Please can someone put me out my misery and shine some light on where I might be going wrong!!!?
Thanks.
*Managed to get old scope behaving (nearly) so you can see the output! MISO is showing 0x0E although in this case I have not set any config registers other than you can see. Will address that tomorrow as I am tired!
I am not finding the manual absolutely clear as to the finer details, which I suspect I am missing something (or my modules are really dodgy Chinese rips!)
Basically, I have written an SPI routine (never done this before) in assembly for a PIC16f688 and I am fairly happy with it. You enter data in to 4 registers initially, two that contain where to raise CSN, (which are rotated end of each group of clock cycles) then the number of writes in another register, number of reads in a further register, then it's a case of just entering up to 15 addresses / data's and the code does the rest to produce SPI (at the moment, phase and pol are 0-0). MOSI is rotated out of registers 0x6X and in to the end. Thus it is kind of FIFO.
SO I think I have got that bit right. I have got everything moving slowly, as I am based on breadboard for now.
Good News, I do I get a MISO response from the RF unit. Bad news, I can't really seem to make much sense of it or control the modules! I am obviously overlooking something.
I will try to get a trace at work tomorrow, but for now below is an MPLAB sim of the data sent out without obvious MISO, which, like I said above, I do get.
I have skipped the majority of config in this example as I thought I would show how I am setting a receive address in Data Pipe 0. I am sending [CSN LOW] 0x0A followed by 0xAA 0xAA 0xAA [CSN HIGH]. clock is approximately 500uS each cycle, 1mS rest between each byte of data, CSN highs are 760uS. At the end of transmitting this I then set to expect 3 bytes in RX_PW_P0 with [CSN LOW] 0x11 0x03 [CSN HIGH]. You can see the CE pin going high at the far end too.
The MISO data I am getting back I am struggling to understand, and I have tried transmitting (I put it off as long as I could!) to no avail.
Please can someone put me out my misery and shine some light on where I might be going wrong!!!?
Thanks.
*Managed to get old scope behaving (nearly) so you can see the output! MISO is showing 0x0E although in this case I have not set any config registers other than you can see. Will address that tomorrow as I am tired!
Attachments
Last edited: