2017-08-24 10:00 PM
Hello,
I used STM32F429 for communicating with STMPE811 through SPI port.
In the beginning, I read chip ID of STMPE811 in order to make sure communication is correct.
Sometimes, IC doesn't return anything. I set the pins in order to make sure correct mode of SPI is
selected but it seems that IC is in reset mode and it didn't return anything.
I have to turn ON and OFF my board several times in order to get the functionality back.
I appreciate if someone could help me
Note: this post was migrated and contained many threaded conversations, some content may be missing.2017-08-27 03:34 PM
Hello Ali.
I use the same chip.
I observe that is sensitive to voltage variations(ripple, other noises,spikes).
Check the IN1 pin to be connected to VCC.
Check SDAT and A0 pins (theese pins define SPI mode) and mode you use in your initialization software.
Check also VIO pin to be connected to VCC.
Check the clock speed not to be more than 1 MHZ.
There are no more HW points to check to have a good comunication with IC
About your initialization software you don't provide any information. so it is difficult to give some advice.
Regards.
VF
2017-08-27 06:30 PM
Dear Vangelis,
All the points you mentioned are considered in my design. IN1 and VIO are connected to 3.3V and speed is about 500 kbit/sec. About noise, I will check more. Also, SDAT and A0 are set by MCU during power ON in order to make sure that my intended SPI mode is selected.
Initialization is performed by the sequence which ST provided in its app note.
One strange thing is that I have to read one byte twice in order to get a correct result. The same is for writing on the registers. If you don't mind, please help me
Ali
2017-08-29 12:24 PM
Hello Ali
Community here , and i also, dont have any knowledge about your initialization code or code you use to read and write to
STMPE811, or
firmware you use , eg SPL, HAL, LL or bare register. It's impossible to guess what is fault .For example you can provide to community your .IOC file and your main file and all relevant code to your problem in case you use CUBE for initialisation.
regards
2017-08-30 01:49 AM
2017-08-30 01:03 PM
Hello Ali
Fist observation
You break the Touch_SPI_WriteReg8 and Touch_SPI_ReadReg8 transactions, in two pieces by pulling CS HI state and low after, in the midle of transaction. Is not correct.
Second observation
Touch_SPI_ReadReg16 Must not been broken in two 8bit transactions. Must be continous . means that you push CS to LOW before transaction and pull it to HI after transaction.
Regards
Vf
2017-08-30 01:30 PM
I'd suggest using something more effective/deterministic for delays instead of the for() loops.
2017-08-30 10:27 PM
FORTOUNAS.EVANGELOS
Thank you for your answer. As I told you before, My problem is that I have to send each
message twice and I know there is a problem. Did you see such thing in your project?
Littell.David
Thank you for your answer. What you said is absolutely correct. Since delays mentioned in
datasheet are mostly in microsecond-range, so I decided to use loops and their approximate delays
are more than what datasheet mentioned
I appreciate your time and I hope to hear from you soon
2017-08-31 02:40 AM
Hi
>>>My problem is that I have to send each message twice and I know there is a problem. Did you see such thing in your project?
Defintely not.
Let 's go gain to Touch_SPI_ReadReg8 function.
The function first gives the address and closes the transaction by write 0. Why to do this without read the data?
At second part reads ''Output2 = Touch_SPI_SendByte(RegAddr | 0x80);'' . This data is useless. You can't read data the same time you give the address .
My suggestion is a read function for 8 bit registers like this (look at the coments)
Finally, I fully agree with
Littell.David
about delays.2017-08-31 03:58 AM
Thank you
FORTOUNAS.EVANGELOS
andLittell.David
I will try and let you know