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

16F1823 UART Problems

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 27, 2012 5:45 pm     Reply with quote

I tested the following program with vs. 4.130 in hardware and it works OK.
(It doesn't work if I specifiy UART1 instead of the pin numbers).

With vs. 4.128, the compiler always generates a software UART
if I specify the pins, or if I specify UART1.
Code:

#include <16F1823.H>
#fuses INTRC_IO, NOWDT, NOMCLR
#use delay(clock=32M)
#use rs232(baud=9600, xmit=PIN_A0, rcv=PIN_A1, errors)

#int_rda
void rda_isr(void)
{
char c;

c = getc();

putc(c);
}

//========================================
void main()
{
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);

while(1);
}
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Tue Mar 27, 2012 5:58 pm     Reply with quote

I stuck in my output_high(pin_a2); in the INT and its not working. Do I need version 4.130? to use the interrupt? I used your code. SO either my board is whacked or ? was your comms pic to pic that you tested? Thanx for the help..
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 27, 2012 9:37 pm     Reply with quote

The rs232 was between the 16F1823 and my PC. I used TeraTerm as
the terminal program. The 16F1823 was installed in a Microchip "Low Pin
Count" board. I used a Sparkfun Level Shifter to convert the TTL voltage
levels from the PIC to rs232 levels:
http://www.sparkfun.com/products/449

If you can get vs. 4.130, then it should solve your problem.
gpsmikey



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

View user's profile Send private message

PostPosted: Tue Mar 27, 2012 9:45 pm     Reply with quote

Note that according to an email I got today, 4.131 of the compiler is now out.

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
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Tue Mar 27, 2012 10:17 pm     Reply with quote

Bought the update. Mine ran out in Jan. $275 for a bug. Smile If it works then I will be happy. I will post tomorrow the results.

I do wish when you order the updates that you can get them right away instead of waiting for CCS to manually enter stuff. But I digress.
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Wed Mar 28, 2012 10:59 am     Reply with quote

Works good with 4.131.... It was the compiler... But it works so I am very happy.. Thanx for everyones help..
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