16f54 stops running with RC OSC


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2011
    Posts
    4

    Unhappy 16f54 stops running with RC OSC

    I think there is something different about the 16f54. I am using it to drive a LCD.
    It is the same circuit as the one in the PBP manual that uses the 16F84.
    Except the enable goes to PORTB.3 not A4 like 16f84.
    The MCU just seems to stop.

    @_config_RC_OSC

    The Resistor is a 472 ohm the cap is a 22 pf
    Not sure what speed to set OSC if thats the problem.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: 16f54 stops running with RC OSC

    If that is a copy paste then it is likely the problem.
    should be @spaceTwoUnderscoresConfig like so . . .
    Code:
    @ __config_RC_OSC
    And it is only going to work if you have commented out the default config in the p16F54.inc file in the PBP root directory, or you can change the default to this and leave it out of your source code And this config is for MPASM assembler not PB.
    Then set your OSC speed with the define, This get's the pic peripherals all on the same page as to timing, how long is a pause or pauseus . . .
    Code:
    define OSC 4
    BTW the things you define are supposed to be (MUST) be in uppercase letters so OSC is good, osc is not.
    Last edited by Archangel; - 24th March 2011 at 01:57. Reason: add from OR
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Feb 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: 16f54 stops running with RC OSC

    Thanks Joe
    I put a Scope on PORTA whitch is the Data port to the LCD.
    There is no activity on the port.
    I put a LED on PORTB and it doesn't toggle either.
    I have been sucessful whith other chips no problem
    16f877A. 18f4550 no problems but this 16f54 has me confused
    What am i missing?

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: 16f54 stops running with RC OSC

    Please post your setup code in Toto, all your configs all your defines and all of your
    registers, port, tris. option . . . if it is not secret, post the whole code.
    Let's see what is going on here.
    EDIT:
    I have never used an external R/C osc so I cannot pull some trial values out of my hat
    Having said that, I would try some other values, go bigger on both the resistor and the Cap.
    Without cracking a bunch of books, methinks the values you picked would make for very high
    frequency more than that poor old chip can do. BTW pin 17 the OSC/CLKOUT pin will output the osc freq./4 if you want to measure it.
    Last edited by Archangel; - 29th March 2011 at 09:06.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Feb 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: 16f54 stops running with RC OSC

    Thanks Joe S
    I was using MPLAB to program the chip and was setting the config bits in MPLAB
    but when you compile the .asm file in MPLAB it was changing the config bits back to what was set in the PBP p16f54.INC file and I wasn't catching it. Works as expected now.

    Thanks All


    The greater the destress the greater the success ........... sometimes

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: 16f54 stops running with RC OSC

    <h1> GREAT ! </h1> Happy to have been of service. Question, how did you determine the R/C values and what FREQ. did you get from them? I didn't see anything in the data sheet in the way of tables or formulas.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7
    Join Date
    Feb 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: 16f54 stops running with RC OSC

    These boards were made by someone else I was just reprograming them to be serial displays. HoweverI think that they are probably running at 4 MHz. haven't checked it yet
    but seems to run display normaly. I have tryed to run boards with a 16F57 and same RC
    values at 8 MHz seemed OK but it didn't like anything higher. Haven't tryed to go higher than 4 MHz. with the 16F54 but I suspect it woul be the same.
    I have a project that i want to count the number of pulses in a span of about 2 seckonds.
    The pulses go form 0 to 5 volts the attact is strait up the sustain at the top is about .25ms
    then drops almost strait down to about 1.25 volts then has a decay of about 2ms to 0.
    They happen at irregular intervils and may be non existant. I need to know how many times
    they occur in that time span. Usualy 4 or less pulses occure but could be double or tripple
    that. woUld like to use 8 pin chip. 12f683 or simular. any IDEAS

  8. #8
    tetsujp's Avatar
    tetsujp Guest


    Did you find this post helpful? Yes | No

    Default Re: 16f54 stops running with RC OSC

    Resistor low as 472 Ohms looks suspicious to me.
    Have you checked MCLR pullup resistor (for instance 4.7k)?

    16f54 is specified upto 20 MHz.
    I don't think 20 MHz is possible using RC.
    the RC oscillator on the PICs is only designed for low frequency (some MHz at best).

    There is alternative way: use RF inductor (HS mode), values low as 22uH possible but somewhere there is margin when there is no more oscillation.

    Due to high tolerance/temperature affection of small ceramic capacitors, I don't use RC at all.

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