strange problem 12f675


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

    Default strange problem 12f675

    Hello Everyone. I just ran across a very strange problem and wanted to know if anyone knows why. This header file for a 12F675 works perfectly. However if you put "HIGH GPIO.2" underneath "GPIO = %00000000" it causes GPIO.4 to go high. I didn't check if others were going high as I have a LED on GPIO.4. Why did this happen? Thank you.

    ANSEL = 0 'all inputs digital
    CMCON = 7 'comparators off
    DEFINE OSCCAL_1K 1 ' Set OSCCAL for 1K device
    @ DEVICE MCLR_OFF, INTRC_OSC_NOCLKOUT, WDT_ON, BOD_ON, PWRT_ON, PROTECT_ON
    TRISIO = %00000010 'GPIO.1 INPUT
    GPIO = %00000000 'ALL OUTPUTS LOW
    '******HIGH GPIO.2 'HERE IS THE PROBLEM. UNCOMMENT THIS LINE & GPIO.4 GOES HIGH!!!
    ONTIMER VAR BYTE 'VARIABLE FOR TIMER
    OFFTIMER VAR BYTE 'VARIABLE FOR OFF POTENTIOMETER
    TIMER VAR BYTE 'VARIABLE TO COMPARE OFF POTENTIOMETER
    Clear 'ALL VARIABLES = 0
    Pause 5000 'WAIT 5 SECONDS

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


    Did you find this post helpful? Yes | No

    Default

    No problem here

    What happen if you remove the DEFINE OSCCAL_1K ?

    What happen if you insert a PAUSE 50 before HIGH GPIO.2?
    Last edited by mister_e; - 5th July 2007 at 13:49.
    Steve

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

Similar Threads

  1. strange serout2 problem
    By KaanInal in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th January 2010, 09:33
  2. PIC stop responding - Strange Problem!
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st August 2009, 14:06
  3. Strange I2C problem (and solution)
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2008, 19:14
  4. Strange problem with Serin/Serout on 16F628
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 22nd August 2008, 00:16
  5. 12f675 Serout Int_Osc problem
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th April 2007, 09:39

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