|
|
View previous topic :: View next topic |
Author |
Message |
sean
Joined: 14 Jul 2004 Posts: 3
|
PORT_A_PULLUPS() function |
Posted: Mon Sep 06, 2004 9:40 am |
|
|
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 |
Posted: Mon Sep 06, 2004 10:03 am |
|
|
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
|
|
Posted: Mon Sep 06, 2004 10:07 am |
|
|
You will have to connect a "pullup" resistor at each porta pin that you need to "read". _________________ David |
|
|
|
|
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
|