hisham.i
Joined: 22 Aug 2010 Posts: 43
|
PicKit 2 Uart tool |
Posted: Sun Apr 24, 2011 11:53 am |
|
|
Hello..maybe i should not ask this question in this forum but i asked in microchip forum and got no answer until now.
I am using PicKit 2 for programing my dspic30f4012, and the programing goes fine.
But when i used it for uart tool, i connected :
pin 2 to 5v
pin 3 to 0v
pin 4 to transmit pin on my dspic
pin 5 to receive pin on my dspic.
then i wrote a small program which is:
Code: |
#include <30f4012.h>
#device *=16 //16 bits pointer
#fuses XT_PLL8,NOWDT,NOPUT
#device ADC=10
#use delay(clock=10MHZ)
#use rs232(baud = 9600 , xmit = PIN_C13 , rcv = PIN_C14)
#bit ALTIO = 0x020c.10
void main()
{
char a;
ALTIO = 1; //Selecting the alternate I/O for UART
while(1)
{
a=getc();
putc(a);
}
} |
I got the received character different from the sent one.
But when i disconnect the 3rd pin in the picKit 2 from 0V, and tested the program with uart tool everything goes fine.
Why this happened? |
|