dspic30f uart problems

big5824, Tue Apr 05 2011, 11:53PM

Im currently trying to get uart working between my dspic and my PC, however this is what i recieve from the pic transmitting a constant "Hello world!":

¤Y‹ëº½É±‘… Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! HI$$c Qgrld! Hello Wc2l$! Hellc €!H! Hello World! H@@!&8>N!€Bð6=¿o!òr€À@{Àû{>&9¿o! >68¿O!>&8?o >&8?O%>&8?o!>&9?N!>&8?N ð&8o!>&8?O >&8?%>&8>O >€òr€>€òs€òr€>&8>N &8>N €òr€€
`0Àòr€€òr€


I would say this was random noise, however it always follows the pattern of 8 or so bad bytes, a few lines of flawless communication, then constantly worsening to the point where nothing is recieved. Can anybody think of a way of explaining this? Iv tried changing baud rates but all seem just as bad, and im using a 7.3728 clock so the baud rates should match perfectly.

Also just for more background, im using a dspic30f6011a and max232D, and the test above was performed at a 9600 baud rate.



/edit Two more things i thought i should add, first being im using the pics built in RC oscillator instead of a real crystal, do you think this could be the problem? And second, the above test code doesnt always happen, sometimes it will transmit fine for 100 lines or so, others it wont manage a single letter.


/edit2
Ha just after i post this i finally find the error after days of searching, it seems everything came from a via that had fallen out, disconnecting the max232 ground in the process :) Im amazed it worked at all!