reciving garbage data from uart

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

hi,

   

     i am trying to sending and receving data fom uart. for that i am wrote the attached prog.

   

my problem is i can send a pre-defined charater to uart .but not get charater to uart .

   

i used Rx interrupt.

0 Likes
9 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

On creator start page, "Example Projects", there are 2 projects you

   

can look at using UART.

   

 

   

When uploading a project to forum, use IE or Firefox, Chrome has problems.

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        please find attachment   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Probably you tried to use P0_5 as input to UART, but it is not connected to Rx. Use RI1[1] as input to Rx.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

hi,

   

    oop's thanks for figureout the error. 

   

after correcting the error i am able to Rx the chararter but it's only one time second time there is not responce from controller.

   

is it required to re initalised the UART interrupt. or any other problem. please help me to get UART Rx charater when ever i send to controller.(echo)

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You made an LJMP to your Rx-interrupt handler, but you did not declare uart_rx_isr to be an interrupt handler, the corresponding #pragma is commented-out. Move it to the top and uncomment it.

   

Additionally you do not recognize in your main() whether a character arrived, you constantly fire-out rxchar whatever its value might be. There is a programming technique for problems like yours named "Circular Buffer". This allows the isr to put accepted characters into a buffer from where they can be read later. Ask mrs. Google.

   

 

   

Bob 

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Don't forget to modify boot.tpl (interrupt vector) in your root project directory -

   

 

   

From -

   

 

   

    org   3Ch                      ;PSoC Block DCC13 Interrupt Vector
    `@INTERRUPT_15`
    reti
 

   

 

   

to this

   

 

   

    org   3Ch                      ;PSoC Block DCC13 Interrupt Vector
    ljmp _uart_rx_isr
    reti
 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@Dana,

   

no need to modify boot.tpl, have a look into boot.asm: modifications have been made automatically. Jump to the isr was supplied in UART.asm.

   

 

   

Bob 

0 Likes
Anonymous
Not applicable

 I think Dana's method is the way to go. You only need to change the tpl once.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

          http://www.cypress.com/?id=4&rID=36720

   

 

   

Covers either method.

   

 

   

Regards, Dana.

0 Likes