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

hardware usart problem with pic 16f688

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



Joined: 09 Jul 2008
Posts: 3
Location: Italy

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

hardware usart problem with pic 16f688
PostPosted: Wed Jul 09, 2008 9:41 am     Reply with quote

I can't use the hardware uart, with the FORCE_SW parameter the communication is good.

My pcwh version is: 4.062



#include <16F688.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC_IO //Internal RC Osc, no CLKOUT
#FUSES NOPROTECT //Code not protected from reading
#FUSES BROWNOUT //Reset when brownout detected
#FUSES MCLR //Master Clear pin enabled
#FUSES NOCPD //No EE protection
#FUSES PUT //Power Up Timer
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled

#use delay(internal=4M)


//WORK.....
#use rs232(baud=2400,parity=N,xmit=PIN_C4,rcv=PIN_C5,bits=8,stream=PC,FORCE_SW)


//DON'T WORK
//#use rs232(baud=2400,parity=N,xmit=PIN_C4,rcv=PIN_C5,bits=8,stream=PC) //HARDWARE UART


void main()
{

setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC);
setup_vref(FALSE);

delay_ms(1000);
while(true)
{
fprintf(PC,"Test 232\n\r");
delay_ms(1000);
}
}
_________________
-----------------
Fabrizio Binotti
Guest








PostPosted: Mon Jul 14, 2008 7:15 am     Reply with quote

were you able to get the HW uart working? If not, post a reply and I can send you code I have used on the 16f688 using the HW uart.
guest1
Guest







PostPosted: Mon Jul 14, 2008 8:19 am     Reply with quote

Maybe you need to set the TX pin as an output. It's possible that the software UART code does this for you. Using the hardware you have to do it yourself.
fbinotti



Joined: 09 Jul 2008
Posts: 3
Location: Italy

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

PostPosted: Mon Jul 14, 2008 12:53 pm     Reply with quote

The problem was solved in
CCS PCM C Compiler, Version 4.076, 41428

Thank you.
_________________
-----------------
Fabrizio Binotti
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