POKECODE problems (16F877)


Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    May 2004
    Location
    New England
    Posts
    164

    Default POKECODE problems (16F877)

    Hi all,
    Hope someone can help out with this odd problem.
    Have a bit of code for the 16F877. The code itself is about 3,100 words, and there are about 1,000 bytes of data stored at the end using POKECODE:

    @ org 7100 ; Set data start location
    POKECODE data here...
    POKECODE more data here...
    and so on for all the data.

    This all works out fine, with the program compiling fine, and data being read properly by the program.

    Now to the problem...
    I added about 1,000 words to the program - bringing it up to about 4,100 words total, with the same exact, unchanged data stored at the end using the POKECODEs.

    BUT... now each POKECODE instruction is adding in 3 extra words each time it is used! This completely mixes up the data, because there are now 3 extra unwanted locations taken up for each POKECODE used - and several POKECODE instructions are needed to fill the 1,000 bytes of data.

    As I understand it POKECODE just places a RETLW followed by the data byte into the specified code location - so where are these 3 extra words coming from? - and how do I get rid of them?

    Any ideas greatly appreciated
    Thanks,
    Arch

    < EDIT >
    Here' the programmers buffer from a test:

    1F40: 158A 120A 277B 3452 3452 3452 3452 3452

    It looks like the opcodes for BSF, BCF, and a CALL are getting added in before the 5 ASCII values for "R" that I wrote as a test using POKECODE.
    Last edited by Archilochus; - 23rd March 2005 at 17:54.

Similar Threads

  1. 16f877 and ps/2 keyboard error???
    By boraciner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th July 2009, 08:14
  2. serial communication between CMUcam and PIC 16F877
    By gengkeys in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th March 2007, 06:43
  3. 4 Quadrant dc drive with 16F877
    By mns45 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 23rd February 2006, 13:05
  4. USART problems
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 47
    Last Post: - 6th March 2005, 21:45
  5. Interrupts using a 16F877
    By Niall in forum General
    Replies: 1
    Last Post: - 6th August 2003, 01:33

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