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

PIC16F914 input on unused VLCD pin C2

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







PIC16F914 input on unused VLCD pin C2
PostPosted: Thu Oct 06, 2005 7:54 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Oct 06, 2005 12:51 pm     Reply with quote

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







PostPosted: Fri Oct 07, 2005 7:50 am     Reply with quote

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







PostPosted: Sat Oct 08, 2005 2:25 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 10, 2005 5:49 am     Reply with quote

Have a look at this post from the Microchip forum..
http://forum.microchip.com/tm.asp?m=114122&mpage=1&key=lcd&anchor#114144
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