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 CCS Technical Support

reading keyboard with 16f877

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



Joined: 05 Nov 2004
Posts: 2
Location: Australia

View user's profile Send private message Visit poster's website

reading keyboard with 16f877
PostPosted: Fri Nov 05, 2004 9:39 pm     Reply with quote

I am having trouble getting the CCS keyboard code (ex_lcdkb.c) to work with a 16F877 on a Dontronics DT106 board and the Shane Tolmie bootloader. It is a standard 12-key pad connected to B1 through B7. I have a 2x16 character LCD on port B, with enable on B0.
The line port_b_pullups(true) seems to cause the code to crash, taking the booloader with it. I tried disabling interrupt RB first, in case there was noise on one of the port B lines causing an interrupt, but that doesnt help.
Any suggestions as to what I am doing wrong appreciated!
_________________
Ed Roberts
Atmospheric Research Pty Ltd
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Nov 05, 2004 11:24 pm     Reply with quote

Have to modified the code to co-exist with the bootloader?

Have a look at the .lst file and see where the compiler is placing the code.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Nov 06, 2004 9:28 am     Reply with quote

Quote:

I am having trouble getting the CCS keyboard code (ex_lcdkb.c) to work with a 16F877 on a Dontronics DT106 board and the Shane Tolmie bootloader


I guess there isnīt any connection between the kbd & LCD (port_B) with bootloader (port_C)
Post your pin assignements regarding the port_B, the code you are working with, full
header, compiler version and a description of the problem to show us how do you do it and
most people here will provide you with some help.
There are some issues regarding the kbd & LCD. Re- check your hardware, the contrast analog
voltage control in the LCD, etc.

best wishes,

Humberto
ed roberts1
Guest







16f877 keyboard problem - followup
PostPosted: Wed Nov 17, 2004 9:45 pm     Reply with quote

Thanks for the comments. I tried to reply but something didnt work (using Mozilla?), and have been tied up in the lab before getting back on the problem.
The key issue seems to be the port_b_pullups(line); the code stops at this point. To check this on clean code, I took the CSC example ex_sqw.c, loaded it directly (ie without a bootloader), and ran it OK. I then added the line port_b_pullups(true) with printf statements either side, and it didnt proceed beyond the first printf. The system seemed to return to the first printf every 5-10 seconds, as if being reset?
My compiler is PCM version 2.731.
Is this some port b related interrupt issue? I dont have interrupts enabled (although I guess the serial port routine does).
Thanks,
Ed Roberts
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Nov 17, 2004 10:40 pm     Reply with quote

Quote:
The key issue seems to be the port_b_pullups(line); the code stops at this point.

Re-program the Microchipc bootloader into your PIC using PicStart-Plus
or Warp13a (etc.), but this time, change the Config Bits settings in
MPLAB so the "Low Voltage Programming" is disabled.
Once you do this, the "crash on port_b_pullups()" program will be fixed.
ed roberts



Joined: 05 Nov 2004
Posts: 2
Location: Australia

View user's profile Send private message Visit poster's website

Keypad on 16F877
PostPosted: Sat Nov 20, 2004 4:12 pm     Reply with quote

Thanks for this tip about disabling low voltage programming. Now it works well!
Regards,
Ed Roberts
_________________
Ed Roberts
Atmospheric Research Pty Ltd
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