Outputs high to power


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    32

    Default Outputs high to power

    Hi!

    I have a boards with a pic16f628a how can we ensure that the outputs go high for some fraction of a second when the power circuit?

    example configuration:

    @ device pic16f628A,xt_osc,wdt_on,pwrt_on,protect_off,mclr_ on,bod_Off

    define osc 4

    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_BAUD 9600 '
    DEFINE HSER_CLROERR 1

    SYMBOL s2 =PORTA.0
    SYMBOL s1 =PORTA.1
    SYMBOL canc_2 =PORTA.2
    SYMBOL stop_1 =PORTA.3
    SYMBOL power =PORTA.4


    SYMBOL ferma =PORTB.0
    ' =PORTB.1 'RX
    ' =PORTB.2 'TX
    SYMBOL led =PORTB.3
    SYMBOL canc_1 =PORTB.4
    SYMBOL canale2 =PORTB.5
    SYMBOL canale1 =PORTB.6
    SYMBOL stop_2 =PORTB.7

    cmcon=7
    OPTION_REG.7=1

    low canc_1
    low stop_1
    low canc_2
    low stop_2
    low led

    input s1
    input s2
    input canale1
    input canale2
    input ferma

    output canc_2
    output stop_1
    output power
    output led
    output canc_1
    output stop_2

    I can resolve this problem?

  2. #2
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    Put an LED on your output and to ground, if it lights up, then its High!!

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


    Did you find this post helpful? Yes | No

    Post

    Hi, Volcane

    There are two things to consider :

    1) at power up ... Pic acts just like if you had forgotten to place it !!! ( all ports are INPUTS )
    ... so, you must design your power section according to that.

    2) you can program the outputs to be High, as soon as processor execute the TRIS command ( after some µsecs, then ....) :

    Write :

    PORTa = %11110101 ' for example
    TRISA = % 00001010 ' "

    Here you FIRST set the output latches in the correct state
    THEN choose your I/Os.

    This is THE classical "bug" for electronic ignitions ... coil is powered at poweron ... then the port is set to de-energize the coil ... results a nice "bang" or crankshaft back kick !!!

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. 12F629 Strange interupt behavior
    By BGreen in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th May 2007, 15:35
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  5. Serin and TMR0
    By capitano in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2006, 14:58

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