HMI35CTP Uart problem.

General discussion on mikroC PRO for FT90x.
Post Reply
Author
Message
San
Posts: 6
Joined: 16 Feb 2017 22:38

HMI35CTP Uart problem.

#1 Post by San » 16 Mar 2017 11:36

hi all,
Im stuck with simple UART receive processes with HMI35CTP.
Please have a look on my code.

void sendInqury()
{

unsigned char *msg1 ,*msg2;
unsigned char receive1[4];
int i = 0;

myUARTWriteCommand1(0x81, 0x09, 0x04, 0x35, 0xFF, 0,0,0,0,0); //UART1_write command

while(1)
{
while ((UART1_Data_Ready() ) && i<4)
{
receive = UART1_Read();
i++;
}
if(i == 4)
{
break;
}
}

Im sending 5 bytes to a Device & device response with 4 bytes. (see the attached pics)
scrshot.jpg
scrshot.jpg (107.46 KiB) Viewed 17913 times
Im trying to read receive bytes individually to an array. tried several methods but no luck.

I tried to use interrupts as well.(Not sure how to use UART RX interrupts) Some of the registers in FT900 nothing changing when I write into it.

example
UART1_FCRbits.FIFO_EN=0; or UART1_FCR=0x00 doesn't change anything on UART FCR FIFO register. ( Just tried to disable FIFO)

Any help welcome

Thanks

Post Reply

Return to “mikroC PRO for FT90x General”