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

PORT_A_PULLUPS() function

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



Joined: 14 Jul 2004
Posts: 3

View user's profile Send private message

PORT_A_PULLUPS() function
PostPosted: Mon Sep 06, 2004 9:40 am     Reply with quote

I am using PCWM compiler version 3.205, PIC 16F876A chip at 20 MHz.
The Compiler documentation from CCS on page 125, indicates that PORT_A_PULLUPS() function is available for 14 bit PCM devices. But, compiler generates an error - "Undefined identifier port_a_pullups". This function for port_b works wihout any error. In other words, I can use PORT_B_PULLUPS(TRUE) without any compiler errors.

Docimentaion about the microcontroller from Microchip states that PORTB can be software programmed for internal weak pull-ups on all inputs. There is no such statement for PORTA. Therefore, I am suspecting that weak pull-ups are not available on PORTA of 16F876A chip. Can somebody please confirm?

2. If this is correct, then how can I simulate weak pull-ups on portA? I need to read the PortA pins low, if they are pulled low externally but they should be read high if no signal is applied.

Thanks in advance
Sean
Ttelmah
Guest







Re: PORT_A_PULLUPS() function
PostPosted: Mon Sep 06, 2004 10:03 am     Reply with quote

sean wrote:
I am using PCWM compiler version 3.205, PIC 16F876A chip at 20 MHz.
The Compiler documentation from CCS on page 125, indicates that PORT_A_PULLUPS() function is available for 14 bit PCM devices. But, compiler generates an error - "Undefined identifier port_a_pullups". This function for port_b works wihout any error. In other words, I can use PORT_B_PULLUPS(TRUE) without any compiler errors.

Docimentaion about the microcontroller from Microchip states that PORTB can be software programmed for internal weak pull-ups on all inputs. There is no such statement for PORTA. Therefore, I am suspecting that weak pull-ups are not available on PORTA of 16F876A chip. Can somebody please confirm?

2. If this is correct, then how can I simulate weak pull-ups on portA? I need to read the PortA pins low, if they are pulled low externally but they should be read high if no signal is applied.

Thanks in advance
Sean

It's called resistors...
The point about the CCS comment, is that some of the 14bit devices, support pull-ups on PortA, and the CCS code now supports this. However it can't make a hardware feature exist where it is not present. Generally chips that have a PortB, do not support this feature. If you need your lins to float high, the answer is to add a small resistor pack to give this feature.

Best Wishes
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Mon Sep 06, 2004 10:07 am     Reply with quote

You will have to connect a "pullup" resistor at each porta pin that you need to "read".
_________________
David
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