[ARM] Problem with RPM showing on TFT

Status
Not open for further replies.
the results
098 136 099 200 098 128 070 000 116 035 244 017

looks like random data - were these the value you could see on the TFT?

not used micro C so don't know which function is suitable
what does the micro C documentation say?


try
Code:
         if(RPMindex == 1000){
            for(i = 0; i < 1000; i++){
               char Txt[20]={0};
               sprintf(Txt,"RPM %d\n", RPM[i]);   // Convert to string
               UART_Write_Text(Txt); // transmit the string
            }
            RPMindex = 0;       // reset array index
         }
see if the RPM text appears correctly each time
 
Reactions: betuse

    betuse

    Points: 2
    Helpful Answer Positive Rating
The numbers is from USART tool inside mikroc for arm, with DEC data format,
after change the part of code from your advice the received number was
192 152 064 184 082 088 136 064 184 082 088...
 

using
Code:
               char Txt[20]={0};
               sprintf(Txt,"RPM %d\n", RPM[i]);   // Convert to string
the output should look like
Code:
RPM 192
RPM 152
RPM  064
RPM  184
RPM  082
 
Reactions: betuse

    betuse

    Points: 2
    Helpful Answer Positive Rating
RPM need to be app 950,
but UART never show number over 255 (one byte)
 

what are you using to display your data? hyperterm, teraterm, ????

is the output still something like
192 152 064 184 082 088 136 064 184 082 088...

it should show the 'RPM' text then the number
RPM 192
RPM 152
RPM 064
RPM 184
RPM 082

are you displaying an octal dump or something similar?
or are you interpreting the data as binary rather than ADSCII text?
 
Reactions: betuse

    betuse

    Points: 2
    Helpful Answer Positive Rating
you appear to be printing with a data format of decimal not ASCII text
converting your values to ASCII gives "bDDdf?""eD?#... (the ? being a character code >= 128)
looks like the baud rate between the transmitter and receiver is different
 
Reactions: betuse

    betuse

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…