UART interfacing pc and pic problem

Hi all,

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

Reply to
zheng
Loading thread data ...

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.

Reply to
srl100

Reply to
David Brown

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.

Reply to
zheng

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.