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

PORTB causing problem on PORTC UART

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







PORTB causing problem on PORTC UART
PostPosted: Thu Apr 05, 2007 5:20 pm     Reply with quote

I have a 18F2580 @ 20MHz and the RS232 baud is 115200. My sample program is this :
Code:

#include <18F2580.h>
#fuses NOWDT,NOPROTECT,NOLVP,HS
#use delay(clock=20000000)
#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7)

void main()
{
    char c;
   
    while (true)
    {
      c = getc();
      putc(c);
      putc(c+1);
   }
}


When pin B5 is low, everything works fine, but when B5 is high, it forces the TX pin to be low. What could cause this?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 05, 2007 5:52 pm     Reply with quote

It's likely that the LVP fuse is really set, even though you have NOLVP
in your #fuses statement. This can happen if you're using a bootloader.
See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=30237
Dan
Guest







PostPosted: Fri Apr 06, 2007 12:32 pm     Reply with quote

You were right, my programmer had that fuse set. It works fine now.

Thanks
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