CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PicKit 2 Uart tool

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hisham.i



Joined: 22 Aug 2010
Posts: 43

View user's profile Send private message

PicKit 2 Uart tool
PostPosted: Sun Apr 24, 2011 11:53 am     Reply with quote

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?
hisham.i



Joined: 22 Aug 2010
Posts: 43

View user's profile Send private message

PostPosted: Mon Apr 25, 2011 5:31 am     Reply with quote

I solved this issue, i have a problem in the configuration of the clock
am using 10 MHZ crystal and pll*8, so 80 mHZ

but i wrote #use delay(clock = 10MHZ)
when i replaced it by : #use delay(clock = 80MHZ) it works correctly
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group