Could I ask you some advice about my program?
Posted: 07 Jul 2017, 08:42
I have written a program about the output value of spi enter to TLV5616CD(datasheet) to have a da change. However,I found that the output voltage of port didn’t have any change. I don’t know whether the reading order of TLV5616CD is wrong? Or is my program wrong?
Could anybody here help me? Your help will be appreciated!
- {l Code}: {l Select All Code}
void main(void)
{
char temp;
InitSysCtrl();
Init_SPI();
SpiaRegs.SPICTL.bit.TALK=1;//FS pin control
TX_SPI(0X016a);
SpiaRegs.SPICTL.bit.TALK=0;//FS pin control
while(1);
}
It enters into read and change by control The FS pin’s falling edge which connects TALK in main function. Then pulling up and finishing and sending function.
void TX_SPI(char c)
{
while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG==1);
SpiaRegs.SPITXBUF=c;
while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG==1);
}
。。。。。。There is no any problems
In the initialization:SpiaRegs.SPIBRR=0x07;
Could anybody here help me? Your help will be appreciated!