View previous topic :: View next topic |
Author |
Message |
ed roberts
Joined: 05 Nov 2004 Posts: 2 Location: Australia
|
reading keyboard with 16f877 |
Posted: Fri Nov 05, 2004 9:39 pm |
|
|
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
|
|
Posted: Fri Nov 05, 2004 11:24 pm |
|
|
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
|
|
Posted: Sat Nov 06, 2004 9:28 am |
|
|
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 |
Posted: Wed Nov 17, 2004 9:45 pm |
|
|
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
|
|
Posted: Wed Nov 17, 2004 10:40 pm |
|
|
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
|
Keypad on 16F877 |
Posted: Sat Nov 20, 2004 4:12 pm |
|
|
Thanks for this tip about disabling low voltage programming. Now it works well!
Regards,
Ed Roberts _________________ Ed Roberts
Atmospheric Research Pty Ltd |
|
|
|