WRITE and DT-INTS


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187

    Default WRITE and DT-INTS

    Hi

    I write data to the EEPROM with WRITE and are also using DT-INTS TMR1, but before i execute a write I disable TMR1 with
    Code:
    @ INT_DISABLE  TMR1_INT
    Is that the correct way to do it?

    I´m a little confused when I read the manual about WRITE, The manual says
    If interrupts are used in a program, they must be turned off (masked, not
    DISABLEd) before executing a WRITE
    What do they mean with not DISABLED?

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: WRITE and DT-INTS

    If you are talking about using the WRITECODE command all you have to do is place DEFINE_WRITE 1 at the start of your code and it will do the task for you. I always it as I use the WRITECODE function quite often and always use DT_INTS. Never had a problem yet....
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: WRITE and DT-INTS

    I talk about the WRITE

    Code:
    WRITE
    
    WRITE Address,Value
    
    Write Value to the on-chip EEPROM at the specified Address. This instruction may only be used with a PICmicro that has an on-chip EEPROM data area such as the PIC16F84, PIC16C84 and the PIC16F87x series.
    
    WRITE is used to set the values of the on-chip EEPROM at runtime. To set the values of the on-chip EEPROM at programming-time, use the DATA or EEPROM statement.
    
    Each WRITE is self-timed and takes about 10 milliseconds to execute on a PICmicro.
    
    If interrupts are used in a program, they must be turned off (masked, not DISABLEd) before executing a WRITE, and turned back on (if desired) after the write instruction is complete. An interrupt occurring during a WRITE may cause it to fail.
    
    WRITE will not work on devices with on-chip I2C interfaced serial EEPROM like the 12CE67x and 16CE62x parts. Use the I2CWRITE instruction instead.
    
     	WRITE 5,B0	' Send value in B0 to EEPROM location 5
    To write a word, each of the 2 bytes that make up the word must be written separately:
    
    w Var Word
    WRITE 0,w.BYTE0
    WRITE 1,w.BYTE1

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: WRITE and DT-INTS

    Yes you are correct, WRITE as well as WRITECODE work the same. All you have to do is place DEFINE_WRITE 1 at the start of your code and it will do the task for you.
    Dave Purola,
    N8NTA
    EN82fn

  5. #5
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: WRITE and DT-INTS

    Thank you!
    I thought that DEFINE_WRITE 1 only was for the PBP "ON INTERRUPT" and not for "ASM" interrupts like DT-INTS

  6. #6
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: WRITE and DT-INTS

    DEFINE_WRITE 1 only works on PBP3 and up I think.
    How do I do it on PBP 2.60C?

    The way I do it now is by disable the TMR1 with the line "@ INT_DISABLE TMR1_INT"

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: WRITE and DT-INTS

    It works in PBP 2.60, it's in the printed manual as well under the WRITE statement.

Similar Threads

  1. mplabx and dt ints 18
    By richard in forum General
    Replies: 0
    Last Post: - 21st July 2015, 21:15
  2. DT-INTS and SSP1_INT
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th April 2015, 01:34
  3. DT-ints-18, How to ...
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 7th January 2014, 20:41
  4. DT INTs which int to use??
    By Heckler in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th March 2012, 00:23
  5. DT-ints-18 - new version
    By dip1 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 10th October 2007, 20:09

Members who have read this thread : 1

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