Leaves the mainloop???


Closed Thread
Results 1 to 40 of 46

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    0 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Leaves the mainloop???

    you are making this very difficult,

    every schematic so far is different some are worse than others
    the latest is doubtful r17 is too big 3k3 would be more realistic

    this is very bad
    Name:  pesc1.jpg
Views: 3329
Size:  14.0 KB

    given that vin high is vdd*0.8 and vin low is vdd*0.2
    a 12 volt input lands slap bang in the middle nowhere land , the slightest bit of noise could swing it either way
    r8 should be about 27k

    you keep posting code snippets or incomplete fragments that are impossible to evaluate
    this is a nonsense , and will continually reset because it has no loop it just wander off into lala land



    Code:
    #CONFIG
    __config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_ON
    __config _CONFIG2, _MCLRE_ON & _PWRTE_OFF & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_ON
    __config _CONFIG3, _WDTCPS_WDTCPS_11 & _WDTE_OFF & _WDTCWS_WDTCWS_6 & _WDTCCS_SC
    __config _CONFIG4, _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_OFF
    __config _CONFIG5, _CP_OFF
    #ENDCONFIG
    
    
    
    
    
    
    
    
    OSCCON1=%00000011
    OSCCON2=%00000011
    
    
    
    
    trisa = %11101100
    trisc = %11111111
    
    
    
    
    ANSELC = 0
    ANSELA = 4
    
    
    
    
    
    
    
    
    DEFINE OSC 4
    
    
    
    
    FET var LATA.4 ' FET output
    IG VAR PORTA.5 ' Ignition input
    GREEN VAR LATA.0 ' TIMING LED
    RED VAR LATA.1 ' FAULT LED
    
    
    
    
    MAIN:
    IF ig = 1 THEN
    FET = 1
    GREEN = 1
    ELSE
    FET = 0
    GREEN = 0
    ENDIF
    i'm going to let it stew for a few days till you get your act together
    Warning I'm not a teacher

  2. #2
    Join Date
    Apr 2016
    Location
    Plainfield, Illinois
    Posts
    73


    Did you find this post helpful? Yes | No

    Default Re: Leaves the mainloop???

    uncle.... do they have that expression down under? It means enough...
    My dad never liked you...

Similar Threads

  1. Time taken to do mainloop
    By Gerald in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th March 2023, 14:16
  2. Outside the Mainloop
    By pescador in forum General
    Replies: 10
    Last Post: - 26th April 2016, 17:34

Members who have read this thread : 2

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