SPI for NBP8

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

SPI for NBP8

跳至解决方案
3,163 次查看
CaoRq
Contributor II

Hi,NXP

   I need to use pressure sensor NBP8,  but when I try to operate it by spi, I meet some problems

   when I need external host  waking up the NBP8 ,should I pull up  CS_B/WAKE_UP pin then pull down it again after READY/INT pin pull up? if I do it , the response for NBP8 is always 0x1002.

   if I don't pull up and pull down CS_B/WAKE_UP pin ,when I try to operate register by spi , the response is always 0x2002.

   can you tell me how to solve it ?

   Thank you in advance

0 项奖励
回复
1 解答
3,136 次查看
CaoRq
Contributor II

Thank you for you support .

    I find a solution ,before I transfer a command(2 bytes) , I need to pull up and pull down the CS_B pin, then I can get the correct response.  I follow the sequence shown in the image below

 

RunqiangCao_0-1694508252476.png

    I wonder whether I can transfer many commands without pulling up and pulling down the CS_B pin? 

在原帖中查看解决方案

4 回复数
2,722 次查看
Mason2
Contributor I

Mason2_0-1705485274021.png

Mason2_0-1705486306444.png

 

0 项奖励
回复
3,145 次查看
JozefKozon
NXP TechSupport
NXP TechSupport

Hi Cao,

please share a scope of the SPI signal when you try communicate with the NBP8. The CS_B pin must be low, when you want to wake up the NBP8 or you want to communicate with. 

JozefKozon_0-1694507096672.png

With Best Regards,

Jozef

3,137 次查看
CaoRq
Contributor II

Thank you for you support .

    I find a solution ,before I transfer a command(2 bytes) , I need to pull up and pull down the CS_B pin, then I can get the correct response.  I follow the sequence shown in the image below

 

RunqiangCao_0-1694508252476.png

    I wonder whether I can transfer many commands without pulling up and pulling down the CS_B pin? 

1,381 次查看
BillWen
Contributor II
Hi CaoRq:
I have a same problem with you,
if I pull up CS_B/WAKE_UP pin then pull down it again after READY/INT pin pull up, the response for NBP8 is always 0x1002. If not, I always get 0x2002.
The following is my code
void NBP8_WakeupAndCheck(void)
{
uint8_t regval = STD_LOW;
uint8_t result;
uint16_t TxChBuf[1];
uint16_t RxChBuf[1];

Dio_WriteChannel(DioConf_DioChannel_LPSPI5_PCS3, STD_LOW);

regval = Dio_ReadChannel(DioConf_DioChannel_PS_READY);
while(regval == 0)
{
Printf("DioConf_DioChannel_PS_READY = %d\r\n", regval);
}
Printf("DioConf_DioChannel_PS_READY0 = %d\r\n", regval);

Dio_WriteChannel(DioConf_DioChannel_LPSPI5_PCS3, STD_HIGH);

//Osif_Wait(100);

Dio_WriteChannel(DioConf_DioChannel_LPSPI5_PCS3, STD_LOW);
//Osif_Wait(10);

//TxChBuf[0] = NBP8_FW_DER;
TxChBuf[0] = NBP8_SPIOPS;

Spi_SetupEB(SpiConf_SpiChannel_SpiChannel_PressureSensor, TxChBuf, RxChBuf, sizeof(TxChBuf));
result = Spi_SyncTransmit(SpiConf_SpiSequence_SpiSequence_PressureSensor);
//Osif_Wait(10);
Dio_WriteChannel(DioConf_DioChannel_LPSPI5_PCS3, STD_HIGH);

if (result == E_OK) {
Printf("RxChBuf[0] = 0x%x\r\n", RxChBuf[0]);
//Printf("RxChBuf[1] = 0x%x\r\n", RxChBuf[1]);
}
}
Do you know how to fix this?

Thanks
BR, BillWen
0 项奖励
回复