10F222 no response?


+ Reply to Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: 10F222 no response?

    Oooops, my fault ... wrong chip selected

    this one looks to work fine...

    Code:
    '   set parameters
    '
    ADCON0=0 'all digital I/O
    TRISIO=0 'all outputs (GPIO.3 is input only so it's ignored)
    DEFINE OSC 8
    DEFINE OSCCAL_1K 1
    
    
    '*************************************
    '     variables and constants
    '
    tempvar var byte
    '***********************************
    '    Other housekeeping
    'peekcode $1FF, tempvar 'OSCCAL calibration value
    'POKE $05, tempvar      'OSCCAL register location
    
    
    '**************************************************************
    '     begin program
    
    
    GPIO.0=0
    
    
    loophere:
    GPIO.0=1
    pause 500
    GPIO.0=0
    pause 500
    
    
    goto loophere
    
    
    end
    But you should use PEEKCODE along with POKECODE ... but POKECODE needs a CONSTANT to be stored !
    Last edited by Acetronics2; - 19th February 2025 at 17:58.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: 10F222 no response?

    Quote Originally Posted by Acetronics2 View Post
    Oooops, my fault ... wrong chip selected

    this one looks to work fine...

    Code:
    '   set parameters
    '
    ADCON0=0 'all digital I/O
    TRISIO=0 'all outputs (GPIO.3 is input only so it's ignored)
    DEFINE OSC 8
    DEFINE OSCCAL_1K 1
    
    
    '*************************************
    '     variables and constants
    '
    tempvar var byte
    '***********************************
    '    Other housekeeping
    'peekcode $1FF, tempvar 'OSCCAL calibration value
    'POKE $05, tempvar      'OSCCAL register location
    
    
    '**************************************************************
    '     begin program
    
    
    GPIO.0=0
    
    
    loophere:
    GPIO.0=1
    pause 500
    GPIO.0=0
    pause 500
    
    
    goto loophere
    
    
    end
    But you should use PEEKCODE along with POKECODE ...
    I'm not writing to CODE area though, it's writing to the OSCCAL register, location $05. Am I wrong in thinking this should do it? It didn't recognize OSCCAL and threw an error when I tried writing it to the register directly using that naming convention.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: 10F222 no response?

    As far as I know OSCCAL the thing is only for calibrating/adjusting/tweaking the actual oscillator frequency so that it's within specification. It should not be needed to get the chip running and I don't think it relates to your problem.

    With that said
    Code:
    peekcode $1FF, tempvar
    OSCCAL = tempvar
    Or perhaps even
    Code:
    PEEKCODE $1FF, OSCCAL
    Should do it. But again, I'd remove it from the code until you get a blinky running.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: 10F222 no response?

    Quote Originally Posted by HenrikOlsson View Post
    As far as I know OSCCAL the thing is only for calibrating/adjusting/tweaking the actual oscillator frequency so that it's within specification. It should not be needed to get the chip running and I don't think it relates to your problem.

    With that said
    Code:
    peekcode $1FF, tempvar
    OSCCAL = tempvar
    Or perhaps even
    Code:
    PEEKCODE $1FF, OSCCAL
    Should do it. But again, I'd remove it from the code until you get a blinky running.
    Thanks - it's setting OSCCON that's the issue apparently. If I don't bother, it works fine. Anything else, nope. It does NOT like OSCCAL being mentioned. The PEEKCODE $1FF, OSCCAL compiles, but has the same "he's dead, Jim" result.

    However, having said that, Acetronics2 used "DEFINE OSCCAL_1K 1", which I can only assume grabs the value for OSCCON from the last code address on a 1K pic and uses it in a snippet of code to drop the value into its rightful register. In this case, it would wrap-around while reading from $3FF (the referenced 1k mark) since there's only 512bytes, but it should still result in the same thing happening.

    Thanks guys, for the input - blinky is blinking and I'm away to the races. I would NOT have thought that a poke to the OSCCAL would lock things up, regardless of the value written to it, and the fact that it's not recognized as a register is a head-scratcher.

Similar Threads

  1. 10F222 wake/sleep
    By AvionicsMaster1 in forum PBP3
    Replies: 3
    Last Post: - 23rd August 2013, 08:03
  2. 10F222 ADRES as one more VAR?
    By JetPack Spartan in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 10th May 2010, 14:54
  3. Error programming 10F222
    By JoelMurphy in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th July 2009, 15:23
  4. 10F222 ADC Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 30th October 2008, 03:46
  5. 10f222
    By Meriachee in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 31st October 2006, 17:09

Members who have read this thread : 12

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts