Strange Behaviour - Simple code+DT_INT+16F676


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hello Darrel, I tried adding "DEFINE OSCCAL_1K 1" once above the @_Config....statement and once below it, both cases my PIC went dead. Is it that any other statement goes along with this?
    ___________________
    WHY things get boring when they work just fine?

  2. #2


    Did you find this post helpful? Yes | No

    Unhappy Dissapointing news

    I tried whole day today to make this code work via my PC but unfortunately it didn't worked. The serin command is not working at all. I tried using MAX232 and sent data via PC after setting correct baud rate and other settings, but no results at all.

    The interrupt and whatever is in ISR, is working fine. Though the weak internal pullup for PortA.0 & 1 didn't worked (I wonder why), but I managed with external pullups for them.


    Sending o9* via my PC does not put pin5 high. I tried it nearly million times today.
    Can oscillator be the culprit?

    As explained in the above post, my PIC went dead when I tried using DEFINE OSCCAL_1K 1. So I removed that statement and kept trying but

    I really need some help to make it work with Serin command.
    ___________________
    WHY things get boring when they work just fine?

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by financecatalyst View Post
    Hello Darrel, I tried adding "DEFINE OSCCAL_1K 1" once above the @_Config....statement and once below it, both cases my PIC went dead. Is it that any other statement goes along with this?
    That means the OSCCAL value is gone.
    Without the calibration's RETLW, using OSCCAL_1K creates an infinite loop.

    And without the calibration, SERIN has a snowball's chance ...

    You could try random OSCCAL values, you might get lucky.
    Or, stick a crystal or resonator on it, and it should be able to SERIN.
    <br>
    DT

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hi, I tried it with another PIC with the define statement on top of the code. It worked fine. I can't use external resonator, as I am using those pins.

    How do I know which PICs need this DEFINE statement and which don't?
    I am trying to serout with 12F635 & serin at 16F676. It is still giving problems, does 635 also needs some kind of calibration? Thanks
    ___________________
    WHY things get boring when they work just fine?

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by financecatalyst View Post
    How do I know which PICs need this DEFINE statement and which don't?
    The same way you know about all the other things the chip does ... the Datasheet. (Oscillator section)
    Only the really OLD chips need OSCCAL calibration.

    I am trying to serout with 12F635 & serin at 16F676. It is still giving problems, does 635 also needs some kind of calibration? Thanks
    No, the 635 doesn't need an OSCCAL.
    It has a precision multi-speed internal oscillator, and you can select the speed with OSCCON. But it defaults to 4Mhz.
    It's factory calibrated, and the calibration can not be erased.

    The 635 has a comparator that needs to be turned off though.
    CMCON0 = 7
    <br>
    DT

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. 16f819 - acting strange... only does first line of code
    By 4Lewis in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th May 2006, 22:53
  4. hopefully simple code
    By hoyles in forum General
    Replies: 3
    Last Post: - 8th September 2005, 23:24
  5. Timer PIC16F57
    By leonel in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 1st July 2005, 08:14

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