-->
Page 1 of 1

SPI Slave NodeMCU fake header insertion

PostPosted: Sun Feb 06, 2022 8:29 pm
by pmsalvino
Hi! I wish you guys can help me out. I have a project in it NodeMCU is put in Slave position for SPI. In my project, I cannot insert libraries or scripts to the Master side, as NodeMCU should only get data from master.

I have already tried SPIslave.h libraries (Master & Slave) and using a protocol analiser, I’ve checked that Master in this case send a 0x02 followed by 0x00 byte before sending real data.

My problem: My real master send a sequence of 101(bit) followed by (000000) address and then data. It controls a HT1621B LCD driver.

So, SPI slave won’t receive 0x02 followed by 0x00 before true data.

Question: Is it possible to create “fake” bytes as soon as Enable line gets low to pretend first 2 bytes are 0x02 & 0x00?

I’ve been looking for this for a while and got stuck at this.

I appreciate any suggestions.

Re: SPI Slave NodeMCU fake header insertion

PostPosted: Wed Feb 09, 2022 9:01 am
by rpiloverbd
Never really heard of creating such fake bytes. I don't think it's possible. Let's see what others suggest here.

Re: SPI Slave NodeMCU fake header insertion

PostPosted: Wed Feb 09, 2022 9:31 am
by pmsalvino
Since my last post, I’ve found some interesting approach to my issue in the blog below:

https://hydraraptor.blogspot.com/2018/0 ... mment-form

This guy manage to edit SPI register so Command could be 0 instead of 2 as default for the slave to write data.

If someone could give any other suggestion…

I believe the answer is somehow editing SPI register in Slave side. Unfortunately, I don’t know how to edit it.

Re: SPI Slave NodeMCU fake header insertion

PostPosted: Sun Feb 13, 2022 1:59 pm
by sipan1313
hello

check this simil;ar post:@ viewtopic.php?p=93578