UART interfacing pc and pic problem

Dec 10, 2008 3 Replies

Hi all,



I am using dspic30f6010a interfacing pc with rs232. when I use hyperterminal, I can only receive something like


While I am not familiar with the dspic UART, it looks to me like you might not be putting the *contents* of the Txdata buffer into the TXREG. I imagine you will need something like...

char Txdata[] = {'M','i','c','r','o','c','h','i','p','\0'}; int i=0; while(Txdata[i]) { while( U1STAbits.UTXBF); // wait while Tx buffer full U1TXREG = Txdata[i]; i++; }

You also appear to be handling received data in both the main loop and an ISR.

You also appear to have no guard for when received data overruns your RX buffer.

read

might

an

Hi, thanks for your suggestion. I tried just send a signal char like

And I run step by step and find that U1TXREG never read in anything.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required