Need some help converting code for a PIC16F84 to an PIC16F886 [yes ASM]


Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Sep 2007
    Posts
    12

    Default Need some help converting code for a PIC16F84 to an PIC16F886 [yes ASM]

    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.
    Attached Files Attached Files

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. Converting compiled code to unsupported PIC
    By jpadfield in forum General
    Replies: 1
    Last Post: - 20th May 2005, 19:40
  5. Converting Stamp code
    By paul.mcallister in forum General
    Replies: 1
    Last Post: - 8th February 2005, 11:48

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts