Ok Alain,
If you can tell me what address that register is in, it will be added.
I'm betting you won't find that little bit of information.
Ok Alain,
If you can tell me what address that register is in, it will be added.
I'm betting you won't find that little bit of information.
DT
I guess Alain doesn't want to play.
Instead, he posted a bug report in the melabs forum without doing any research.
So Barry,
The 16F1503 doesn't have a WPUC register.
Yes, I know you'll find references to WPUC in the datasheet ... but it doesn't exist.
There is a WPUA, but no WPUC.
If you need pull-ups on PORTC, they'll have to be external.
DT
Hi Darrel,
I did a bit of searching on this subject and found some conflicting information.
Microchip has released an errata document stating WPUC is not available for the PIC16F1503 but I also found another forum where a member had successfully implemented WPUC at H.'020E'
http://www.microchip.com.edgekey.net...051-print.aspx
I am not sure who to believe.
I really don't have room on my board for external pull-up resistors. I chose the PIC16F1503 because it was reported to have weak pull-ups on both PORTA and PORTC.
Is a workaround possible using H.'020E' address?
Cheers
Barry
VK2XBP
The person that said he got PORTC pull-ups to work on a 16F1503, has a total of 1 post on that forum.
Completely unreliable source.
The register, and the pull-ups do not exist in hardware.
No amount of messing with the code will change that fact.
Attempting to write to that address will result in errors from the assembler.
You can use the FSR's to indirectly write to address 020E ... but no pull-ups will activate on PORTC, because they're not there.
And when you read it back it returns all 0's.
I have actually done that with a 16F1503.
I'm Crushed!Originally Posted by Aussie Barry
![]()
DT
Hi Darrel,
Thanks for the prompt reply and detailed explanation.
Please do not feel crushed. My comments were from complete despair and were not directed at you. I should have known better than to question your reply but I read that someone had managed to achieve what I wanted to do and I saw a glimmer of hope on the horizon.
Time for a re-think on how to achieve my desired result. Thankfully, I do like a good challenge
Cheers
Barry
VK2XBP
Perhaps I should look at using PIC16F1823 instead of the PIC16F1503?
Darrel, are you aware of any issues with WPUC on the PIC16F1823?
Cheers
Barry
VK2XBP
On the 16F1823 ... the weak pull-ups on PORTC work fine.
DT
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi All,
I have now swapped over to PIC16F1823 for this project and I am now having difficulty using pins on PORTA as inputs with Weak Pull-ups enabled.
I have stripped down my code as follows:
The program flashes LED1 and LED2 as expected but I get strange readings when I probe PORTA.1, .2, .4 or .5 with my oscilloscope.Code:#CONFIG __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF & _BOREN_OFF __config _CONFIG2, _PLLEN_OFF & _LVP_OFF & _WRT_HALF #ENDCONFIG OSCCON = %01101000 ; Fosc = 4MHz ; Clock determined by Fosc<1:0> Config Word DEFINE OSC 4 ; Define oscillator as 4MHz ANSELA = 0 ; Set PORTA as digital I/O ANSELC = 0 ; Set PORTC as digital I/O ADCON0.0 = 0 ; Disable ADC DACCON0.7 = 0 ; Disable DAC CM1CON0.7 = 0 ; Disable comparator 1 CM2CON0.7 = 0 ; Disable comparator 2 CPSCON0.7 = 0 ; Disable CPS module T1CON.7 = 0 ; Timer1 OFF TRISC = 0 ; All PORTC as outputs TRISA = 1 ; All PORTA as inputa OPTION_REG.7 = 0 ; Enable Weak Pull-ups WPUA = %00111111 ; Pull-ups enabled on PORTA LED1 var PORTC.5 LED2 var PORTC.1 Start: ; Flash LED1 and LED2 at 1Hz high LED1 High LED2 Pause 500 low LED1 low LED2 pause 500 Goto Start
With PORTA set as digital inputs and weak pull-ups enables on PORTA I would expect those pins to read +5v but they are in fact reading 0v
I need to connect switches to PORTA.2, .4 and .5 to make selections for my program to function but can't switch these pins to ground if they are already permanently there!
Can anyone shed any light on what might be happening or what I might be doing wrong?
Cheers
Barry
VK2XBP
Except for PORTA.0, you've set all PORTA pins to OUTPUT mode.
By default at power-up, all pins are in INPUT mode.Code:TRISA = 1 ; All PORTA as inputa
So unless you need to set a pin to output, you don't need to change the TRIS register.
DT
Oh Dear.....
I just want to crawl into a hole and hide form the world...
Thanks Darrel
Bookmarks