Still Struggling with IF THEN


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    The IF THEN statements compile OK if I comment out the TRISIO line. The error message is: Warning line 15: $111110 numeric overflow. TRISIO never gave me a problem before, what is wrong?

    rem device = 12F675
    CMCON = 7
    ANSEL = 0 'GPIO.0 TO GPIO.3 SET AS DIGITAL
    OPTION_REG = 0 'WEAK PULLUPS ENABLED
    TRISIO = $111110 'GPIO.0 SET AS OUTPUT, ALL OTHERS INPUT
    GPIO = %111110 'PORT GPIO.0 SET LOW INITIALLY
    WPU = %110110 'SETS WEAK PULLUP ON DIGITAL INPUTS
    rem define variables
    time1 var byte: time2 var byte: time4 var byte: time8 var byte
    time var word
    IF GPIO.1 = 0 THEN
    time1 = 1
    ELSE
    TIME1 = 0
    ENDIF
    END

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Russ Kincaid View Post
    The error message is: Warning line 15: $111110 numeric overflow. TRISIO never gave me a problem before, what is wrong?
    Needs to be % not $
    try
    TRISIO = %111110

  3. #3
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    Thanks, I should have noticed that!
    My program runs now, not quite right yet, but I am getting there.

  4. #4
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Excellent... the 12F675 can be a finiky thing to configure right... especially for us newbies

Similar Threads

  1. calculator-like code entry with matrix keypad and display
    By Dennis in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 16th December 2009, 22:58
  2. Old analog guy needs help with PIC16F57
    By yankee in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 6th March 2009, 13:32
  3. Replies: 5
    Last Post: - 28th June 2006, 21:32

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