PIC 12F509 begins to heat at power up


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Pedro Pinto's Avatar
    Pedro Pinto Guest


    Did you find this post helpful? Yes | No

    Default

    Hello ErnieM

    I not preset GPIO before TRIS, i make only a alias from the pins before TRISIO

    Attached the schematic

    Regards
    Pedro
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pedro Pinto View Post
    I not preset GPIO before TRIS, i make only a alias from the pins before TRISIO
    Pedro
    Hi Pedro,
    That was the point, that you should, so when TRIS makes the port an output it does so in a state chosen by YOU, not the devil.
    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
    Pedro Pinto's Avatar
    Pedro Pinto Guest


    Did you find this post helpful? Yes | No

    Default

    Hello Joe S.

    English is not my natural language, sorry i not understand very well what
    you mean in your answer. Is anything wrong in this code?

    Code:
    DEFINE OSCCAL_2K 1
    '
    sepic_ok var GPIO.3        
    call_shutdown var GPIO.4
    sepic_on_off var GPIO.5
    pulsador var GPIO.2
    am_on_off var GPIO.1
    'sense var GPIO.0
    '
    TRISIO = %11001111
    '
    low sepic_on_off        
    low call_shutdown       
    '						
    ciclo var word
    conta var byte 
    conta2 var byte
    flag_pulsador var byte
    Do you think that i must change it? if yes, what?

    Thanks
    Best regards
    Pedro

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pedro Pinto View Post
    Hello Joe S.

    English is not my natural language, sorry i not understand very well what
    you mean in your answer. Is anything wrong in this code?
    Pedro
    Hi Pedro,
    I have not time to check data sheets, it's WorkTime , but check what I did below, the comment in blue is because I have not checked the data sheet.
    Code:
    DEFINE OSCCAL_2K 1<font color=blue> 'is this correct? </font color>
    '
    sepic_ok var GPIO.3        
    call_shutdown var GPIO.4
    sepic_on_off var GPIO.5
    pulsador var GPIO.2
    am_on_off var GPIO.1
    'sense var GPIO.0
    '
    GPIO = %00000000 '<font color=red>change to suit Your needs</font color>
    TRISIO = %11001111
    '
    low sepic_on_off        
    low call_shutdown       
    '						
    ciclo var word
    conta var byte 
    conta2 var byte
    flag_pulsador var byte
    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


    Did you find this post helpful? Yes | No

    Default

    Greetings Pedro,

    I think that the idea is to set the pin state before the tris:

    GPIO=%01010101 ( either high or low )

    PS. tens de definir o estado inicial dos portos ( altos ou baixos ) antes de definires o trisio

    PS2. - Like Joe said

    Regards

  6. #6
    Pedro Pinto's Avatar
    Pedro Pinto Guest


    Did you find this post helpful? Yes | No

    Default

    Hello

    Thanks, i will try it. That is the first and unique project where i use a 8 pin PIC
    The 12F509 have Flash Program Memory of 1.5 kBytes
    The 12F508 have Flash Program Memory of 0.5 kBytes
    Therfore i think that is correct - DEFINE OSCCAL_2K 1 - I hope i'm not wrong

    The datasheet says - On Reset ALL pins are input.
    I will test with GPIO = %00000000 and after that to set the
    TRISIO = %11001111

    I notice if i have success with this changes

    Thanks All

    Best Regards
    Pedro

    Para o Rui, quando estiveres o MSN, falamos

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pedro Pinto View Post
    Hello

    Thanks, i will try it. That is the first and unique project where i use a 8 pin PIC
    The 12F509 have Flash Program Memory of 1.5 kBytes
    The 12F508 have Flash Program Memory of 0.5 kBytes
    Therfore i think that is correct - DEFINE OSCCAL_2K 1 - I hope i'm not wrong

    The datasheet says - On Reset ALL pins are input.
    I will test with GPIO = %00000000 and after that to set the
    TRISIO = %11001111

    I notice if i have success with this changes

    Thanks All

    Best Regards
    Pedro

    Para o Rui, quando estiveres o MSN, falamos
    I think you should have
    DEFINE OSC 4
    in your code. I have never seen OSSCAL done as a define before, I
    do not see why not, but I have only seen it done as so:
    OSCCAL = %0000000
    or
    OSCCAL = $00

    ANYBODY want to give a short treatise on this ?
    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.

Similar Threads

  1. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 10:34
  2. Ideal backup power for PIC micro
    By emavil in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2007, 00:07
  3. PIC power backup with "super capacitor"
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 24th January 2007, 23:51
  4. problems on power up of PIC
    By dmairspotter in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th June 2006, 14:11
  5. Controlling power to a PIC with another PIC
    By jswayze in forum Off Topic
    Replies: 3
    Last Post: - 28th May 2005, 19:44

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