|
|
View previous topic :: View next topic |
Author |
Message |
fbinotti
Joined: 09 Jul 2008 Posts: 3 Location: Italy
|
hardware usart problem with pic 16f688 |
Posted: Wed Jul 09, 2008 9:41 am |
|
|
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
|
|
Posted: Mon Jul 14, 2008 7:15 am |
|
|
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
|
|
Posted: Mon Jul 14, 2008 8:19 am |
|
|
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
|
|
Posted: Mon Jul 14, 2008 12:53 pm |
|
|
The problem was solved in
CCS PCM C Compiler, Version 4.076, 41428
Thank you. _________________ -----------------
Fabrizio Binotti |
|
|
|
|
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
|