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

16F1827 software uart problem ... [SOLVED]

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



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

16F1827 software uart problem ... [SOLVED]
PostPosted: Mon Jul 11, 2011 12:54 pm     Reply with quote

Greetings all - I'm running into a problem getting the software uart function to work correctly with a PIC16f1827 - compiler 4.114.
Simple little routine that sets up the PWM (which works), flashes a LED (which works) and sends a message out on pin b7 (which does not work). Don't see any activity on B7, but I do see a burst of data on B2. I need it on B7 for the UART Tool in the pickit2 to see it. Here is the program I have that should work (same format as I used in a 18F14k22 processor). Something obvious I am missing or is this a bug in the compiler ?

Code:

#include <main.h>

#use rs232(baud=9600, xmit=PIN_B7, rcv=PIN_B6, ERRORS, PARITY=N, \
            BITS=8, STREAM=MIKEYMON)


void main()
{

   setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
   // config ccp1 for pwm using timer 2
      output_low(PIN_B3);    // Set CCP1 output low
      setup_ccp1(CCP_PWM);   // Configure CCP1 as a PWM
      setup_timer_2(T2_DIV_BY_16, 255, 1);   // Setup for 1.95khz     
      set_pwm1_duty(128);                    //  50% duty cycle
   
   //Example blinking LED program
    while(true){
      output_low(LED0);
      delay_ms(DELAY);
      output_high(LED0);
      delay_ms(DELAY);
     
      fprintf(MIKEYMON,"test message from mikey\r\n");
    }

}

_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3


Last edited by gpsmikey on Mon Jul 11, 2011 1:07 pm; edited 1 time in total
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Mon Jul 11, 2011 1:07 pm     Reply with quote

It was a compiler bug - updated to version 4.118 that I had downloaded within my 60 days, and same code now works as expected :-)

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
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