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 CCS Technical Support

problem with RS232 in 12F675

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



Joined: 09 Aug 2007
Posts: 82
Location: TN, India

View user's profile Send private message Send e-mail

problem with RS232 in 12F675
PostPosted: Thu Mar 06, 2008 8:32 am     Reply with quote

hello,

i try to write the program to set the set of hex command to PC. but i can't got any data from PIC IC...

my complier version is IDE - 3.41
PCB - 3.185
PCM -3.185
PCH - 3.185

Code:
#include <12F675.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,INTRC_IO, CPD, PROTECT, NOMCLR, PUT, BROWNOUT
#byte OSCCAL=0x90
#define GP0 PIN_A0
#define GP1 PIN_A1
#define GP2 PIN_A2
#define GP3 PIN_A3
#define GP4 PIN_A4
#define GP5 PIN_A5
//========================
#byte ADCON0 = 0x1F
#byte ANSEL = 0x9F
#byte CMCON = 0x19
#rom 0x3ff = {0x3470} // input the calibration code

#use rs232(baud=9600,xmit=PIN_A4,rcv=PIN_A5,bits=8)






void main()
{


set_tris_a(0b101111);


delay_ms(500);

putc(0X7E);
putc(0X07);
putc(0XA0);
putc(0X30);
putc(0X31);
putc(0X30);
putc(0X30);
putc(0X30);
putc(0X7E);


while(1) {
}
    }

}



please give the solution for problem...
kolio



Joined: 06 Feb 2008
Posts: 26

View user's profile Send private message

PostPosted: Thu Mar 06, 2008 8:45 am     Reply with quote

Two hints:
1. Although calibrated, the internal oscillator is not reliable enough for UART communication.
2. Try: while(1){ putc(0x55); delay_ms(10);} . You terminal screen should be filled with 'UUUUUU'.
3. I'm not quite sure whether such an old compiler version properly sets A/D channels (specially A4, which is the transmitter) to disabled. Try setup_adc_ports(NO_ANALOGS);
wish you luck
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