I wanted to expand on some pre-existing code so I could insert a ones, tens, hundreds button to a speed alert system.
The problem is the code is for a PIC16F84 with only an UP and DOWN button. As its impractical to cycle up and down to set a speed limit of say 40 or 60 or 80 (which would be quite common ) I wanted to add 3 extra buttons. With limited PINS i've decided to use a PIC16F886 and have 28 pins at my disposal.
I tried to compile the code in MPLAB for an 84 with the PIC hardware specified to an 886 and changed the header file from:
Code:
list P=16F84
#include "p16f84.inc"
__config _XT_OSC & _WDT_OFF & _PWRTE_ON
to
Code:
list P=16F886
#include "p16f886.inc"
__config _XT_OSC & _WDT_OFF & _PWRTE_ON
But its not liking the last line.
I get the following error:
Code:
Error[126] C:\PIC LAB\SPEED3.ASM 64 : Argument out of range (not a valid config register address)
Does anyone know what to do?
I also realize I may have to remap pins.
However the 84 uses two bi-directional ports PORTA AND PORTB - and the 886 has an additional port which i can use for extra inputs. So i'm hoping theres no remapping necessary.
I just need 3 pins for the extra buttons and the EUSART
If you need to see the corrected code I can post it here in 4-5 posts or attach it as a word document, however I can't guarantee the spacing will be perfect. Below is the latter.
thanks in advance guys.
Bookmarks