Sonsivri

Electronics => AVR, 8051 Family and ARM Area => Topic started by: max on March 06, 2021, 11:29:03 11:29



Title: nrf24L01p code for 8051?
Post by: max on March 06, 2021, 11:29:03 11:29
Hi,

Can someone share a working code for nrf24l01 with 8051.

Thanks


Title: Re: nrf24L01p code for 8051?
Post by: madhan7710 on March 06, 2021, 11:56:48 11:56
See if this is ok for you... Uses STC 8051 MCU but you can easily port to any other 8051...


Title: Re: nrf24L01p code for 8051?
Post by: Poty on March 07, 2021, 12:00:54 00:00
I am working with this module, it uses a SPI connection protocol, and you need to specify a clear timing when sending and receiving information btw uc and nrf. I am using it whit a PIC18F4620. I understand that there are different uc, but I´m developing libraries in C, so, maybe, you can use and try connection between your uc and nrf, maybe adapting some elements. Let me know if you feel this adequate, and I´ll post those ones.
Regards.


Title: Re: nrf24L01p code for 8051?
Post by: max on March 07, 2021, 06:28:09 06:28
Hi Poty

I am using the c compiler for 8051, if your pic c lib is working then please share it.

Regards


Title: Re: nrf24L01p code for 8051?
Post by: Poty on March 07, 2021, 10:30:49 22:30
Hi there!. Well, I was reading my libraries, and seems a little messy, but I got this thing connecting to the uc. I must warn you... all comments and tags are in spanish (spanglish sometimes), but it was working. Hardware was pretty simple: one port to connect to nrf, one to connect to a 2x16 LCD display, and 2 pushbuttons.
The entire schema is based on the program logic that MPLAB imposes to programmers, but I made some changes, so that, I post all header files and source files, plus main.c one. You need to have patience, and follow the flow (I had to do the same).
Basically, I created some calls to read and write though SPI and be able to configure NRF. Sill not implemented input/output transmission data, but this is easy, once you connect to NRF to read/write registers. Just follow NRF datasheet, and, of course, I´m available to help you to the best of my ability.
Regards.


Title: Re: nrf24L01p code for 8051?
Post by: Poty on March 22, 2021, 02:48:22 02:48
Good evening max. How are you doing with your project? were my libraries useful, or at least, a begining of a guide? let me know, please. Those are working fine to me.
Regards.


Title: Re: nrf24L01p code for 8051?
Post by: max on April 01, 2021, 09:02:32 09:02
Hi Poty,

I use the code given by madhan7710 and is working fine,
thanks to madhan7710.
I will upload the code sooner.

Regards


Title: Re: nrf24L01p code for 8051?
Post by: max on April 04, 2021, 12:59:57 12:59
Hi,

See the attached zip file NRF24_8051.zip

Following are the changes to the original NRF code by madhan7710

* uses software SPI instead of hardware SPI
* IRQ pin not used
* the software can be adapted to any flavor of 8051

Regards