View previous topic :: View next topic |
Author |
Message |
Birdie Guest
|
PIC16F914 input on unused VLCD pin C2 |
Posted: Thu Oct 06, 2005 7:54 am |
|
|
Hello All,
I am using PCWH 3.235 and a PIC16F914 with a static drive LCD.
I have connected a N/O pushbutton and pull-up resistor to the RC2/VLCD3 pin; when the pushbutton closes RC2 sees ground.
The problem: when I push the button the LCD segments go completely blank.
When I release the button the segments are normal.
The compiler creates this:
Code: | ................... setup_lcd(LCD_STATIC);
0BA3: MOVLW 80
0BA4: BCF 03.5
0BA5: BSF 03.6
0BA6: MOVWF 07
0BA7: CLRF 08
....................
and this for the pushbutton
.................... if(input(PIN_C2) == 0)
*
02DE: BSF 03.5
02DF: BSF 07.2
02E0: MOVLW 00
02E1: BCF 03.5
02E2: BTFSC 07.2
02E3: MOVLW 01
02E4: XORLW 00
02E5: BTFSS 03.2
02E6: GOTO 31C
....................
|
Any suggestions much apprecated.
Thank you,
Birdie |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 06, 2005 12:51 pm |
|
|
The setup_lcd(STATIC) code appears to be correct. It is disabling
the LCD bias voltage, so pin C2 should be a normal i/o pin.
What code is being executed after the if statement ?
if(input(PIN_C2) == 0)
You don't have to post the ASM code. Just post the C code. |
|
|
Birdie Guest
|
|
Posted: Fri Oct 07, 2005 7:50 am |
|
|
Thanks for the response.
It makes no difference what the code is, or even if there is code; if the pin gets grounded, the LCD goes blank. I am going to try to switch the wiring so the pushbutton is on a different (not VLCD) I/O pin.
I'll post the results.
Thanks again. |
|
|
Birdie Guest
|
|
Posted: Sat Oct 08, 2005 2:25 pm |
|
|
Well I managed to swap pins and get the LCD to work when the button is pressed.
It seems that the VLCD3/RC2 pin will cause the LCD to blank if brought to logic 0 (either by hardware {push button} or by code!
I wonder if there is some setup I'm missing.
Neither VLCD2 nor VLCD1 cause the LCD to blank, only VLCD3. |
|
|
adrian
Joined: 08 Sep 2003 Posts: 92 Location: Glasgow, UK
|
|
|
|