TOGGLE code space and ICD


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i think TOGGLE is only dedicated for i/o not register or variables.

    If you use
    Code:
    toggle TRISA.0
    it will return an error 'Invalid RAM location specified'

    So the
    Code:
    TRISA.0=TRISA.0 ^ 1
    is the way to go.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi Steve,

    I do not know a register but a bit variable works.


    Here is an example.

    Code:
    TRISA = 0
    TRISB = 0
    
    Test  var bit
    Relay var PORTB.0
    Test  = 0
    relay = 0
    
    start:
    
            toggle relay    'This is an I/O.
            toggle test     'This is a variable.
            pause 1000
    
    goto start
    
    
    end

    Did you mean something else?
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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