cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in communication of STM32F429 with STMPE811

ali
Associate II
Posted on August 25, 2017 at 07:00

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.
10 REPLIES 10
Posted on August 28, 2017 at 00:34

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

Posted on August 28, 2017 at 01:30

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

Posted on August 29, 2017 at 19:24

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

Posted on August 30, 2017 at 08:49

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6st&d=%2Fa%2F0X0000000bxG%2FHluxGBFsKdqhWig.rxbRPO0N1U2N1nAArpzlxfvsUc8&asPdf=false
Posted on August 30, 2017 at 20:03

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.

0690X000006085NQAQ.png0690X000006084yQAA.png

Regards

Vf

Posted on August 30, 2017 at 20:30

I'd suggest using something more effective/deterministic for delays instead of the for() loops.

Posted on August 31, 2017 at 05:27

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

Posted on August 31, 2017 at 09:40

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)

0690X000006085IQAQ.png

Finally, I fully agree with

Littell.David

about delays.

Posted on August 31, 2017 at 10:58

Thank you

FORTOUNAS.EVANGELOS

and

Littell.David

I will try and let you know