QG8 SCI Rx problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,046件の閲覧回数
abicash
Contributor III

Hi

 

I have a Rx Tx pair on QG8.

The Tx sends the status of 5 switches on RF (through SCI) to the receiver board.

 

Now the issue i am facing is that whenever i connect receiver through the USB multilink cable and run the program,correct keys are detected.

Key 1 = 00001

Key 2 = 00010

Key 3 = 00100

Key 4 = 01000

Key 5 = 10000

 

But whenever i run the boards in standalone mode i get errors.

I monitor the receiver side on hyperterminal and see that the transmitter is sending correct data.But the receiver algorithm

decodes Key 5 =100000 (6 bits) and key 4 = 10000 (5 bits) key 3 = 01100

only 1st two keys are decoded correctly.

 

the code for receiver is

 

while(1)  {        for(i=0;i<100;i++);          while (!SCIS1_RDRF);   // wait for a new character to be received      for(i=0;i<100;i++);         rxchar = SCID;         // read the received char                 if ((rxchar & 0x01)==0x01) {      LED1 = ON;    }else if ((rxchar & 0x01)==0) LED1 = OFF;//////code for other decodes////  

What could be the problem? .My baud is 9600

Thanks and regards
ラベル(1)
0 件の賞賛
返信
1 解決策
837件の閲覧回数
peg
Senior Contributor IV

Hello abicash,

 

Are you using the internal oscillator?

Have you trimmed it?

And loaded the value into the non volatile trim locations?

Have you copied the NV values over to the volatile registers at power up?

 

I'm guessing your problems due to baudrate mismatch.

Did not even look at your code.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
837件の閲覧回数
abicash
Contributor III

Hello

 

I was not storing the trim values.

 

Problem solved

 

Thanks

0 件の賞賛
返信
838件の閲覧回数
peg
Senior Contributor IV

Hello abicash,

 

Are you using the internal oscillator?

Have you trimmed it?

And loaded the value into the non volatile trim locations?

Have you copied the NV values over to the volatile registers at power up?

 

I'm guessing your problems due to baudrate mismatch.

Did not even look at your code.

0 件の賞賛
返信