How to put data into arrays under assembler interrupt ?


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default How to put data into arrays under assembler interrupt ?

    Hello.
    I have a question which probably (hopefully) has a simple solution but I'm out of ideas.

    PIC = 18f87j10, 10MHz.

    An assembly interrupt is being triggered by the reception of a data byte, and I want to put that byte into an array. The array is the 5th 'variable' in my declaration

    W_TEMP var byte system ; interupt context save registers
    BSR_TEMP VAR BYTE system
    STATUS_TEMP var byte system
    RX_BUF var byte ; Buffer for storing the incoming data from USARTS

    RX_message var byte[127]; buffer to store received USART messages


    I have tried
    movlw HIGH(array_name)
    movwf FSR0H
    movlw LOW(array_name)
    (add array offset)
    movwf FSR0L

    ...and then putting the RX'd byte into INDF0

    movff RX-byte, INDF0

    It seemed to work for a while, but then I changed the size of my array from 20 bytes to 127 bytes. I guess I am crossing a boundary or is it something else ?

    Should I try using Table write instead ?

    Chris

    (I can't do away with the assembler interrupt because I am running ethernet (Lantronix XPORT - tftp) on one USART, Zigbee wireless on the other USART, and an SD card on the SPI. I have checked for conflicts by removing the sd card code and variables)
    Last edited by Chris Barron; - 26th March 2009 at 12:12.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Chris,Dunno if this is what you want . . check the code in post 16, this uses Darrel's instant interrupts. http://www.picbasic.co.uk/forum/showthread.php?t=4972
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Hi Chris,Dunno if this is what you want . . check the code in post 16, this uses Darrel's instant interrupts. http://www.picbasic.co.uk/forum/showthread.php?t=4972
    Thanks, you beat me to it because I was about to post to say that I have created an interrupt 'alias' by setting flags in the interrupt and then processing them once control has been restored to the main program. This has meant that I can just stick with using the usual picbasic method of dealing with arrays throughout( and I can leave the rest for another day ;-) )

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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