- Program digispark attiny85 with arduino 1.8.5 how to#
- Program digispark attiny85 with arduino 1.8.5 manual#
SCK needs to be held low for a longer period, so I think it's easier with a diode. it's even possible to toggle CSN with just a resistor and capacitor attached to SCK. Its also clear from the table (15) that for power down mode the state of CE doesn't matter - only the PWR_UP register has to be set to 0. It specifies a 10us high pulse to empty one level of the TX fifo (normal mode) or hold CE high to empty all levels of the TX fifo.
Program digispark attiny85 with arduino 1.8.5 manual#
After I figured out CE can be tied high and CSN has to be toggled, I re-read the manual and realized 6.1.6 does confirm what I found. If you read the datasheet from beginning to end (perhaps more than once) you can figure it out. I agree the NRF datasheet can be a bit confusing as to the combinations of CE, CSN and register settings.
![program digispark attiny85 with arduino 1.8.5 program digispark attiny85 with arduino 1.8.5](https://i.pinimg.com/736x/75/bc/8d/75bc8df1c2bc784253751f51687f2788.jpg)
Not only that, but for a register write, you can include a bunch of junk bytes between the command and the data you want to write, so for a single byte register it will only write the last byte of the SPI sequence. After I wrote aspspi I was able to figure out that it is only after CSN goes high that the NRF processes the SPI command. It's been a few months since I was playing with them, but what I remember is you HAVE to toggle CSN - when tied low, it would only respond to the first command.
Program digispark attiny85 with arduino 1.8.5 how to#
Tieing CE high isn't my idea - I saw it on another NRF example circuit when I was researching how to use them. The state diagrams in the datasheet, and support replies I have gotten from Nordic Semi, suggest that the low-hi CE transition is essential to initiating TX mode.
![program digispark attiny85 with arduino 1.8.5 program digispark attiny85 with arduino 1.8.5](https://nerdytechy.com/wp-content/uploads/2021/01/platformio-vscode-vs-arduino-ide-thumb-360x240.png)
How is the transfer initiated (is it by totally powering down the nRF24L01+ with a PWR_UP = 0 command, followed by a PWR_UP = 1, or is it sufficient to just set PRIM_RX = 0, with CE already high, after loading the TX FIFO)? I'm curious as to how keeping CE tied high still allows one to transmit. Have you confirmed that the PTX and PRX modes both work properly using your circuit? According to the datasheets, one must make a low-hi-low pulse of >= 10us to initiate a transmission. Your solution would free another pin though as compared to my idea which still has a discrete CSN pin. I was going to multiplex SCK and CE with a low-pass filter on CE so one could keep SCK high when idle, and the cap would keep CE high during transfers. I was also trying to come up with a solution to multiplex pins on my ATTiny85 to use the nRF24L01+.