Re: I/O pin default low.
ok - no insults please... - if someone wants to clean my code up for $ I'm all ears... - seriously...
16f15324PIC-SCHEM.pdf
schematic says it s 16f616 - its not - its a 16f15324 ********************
#CONFIG
__config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_OFF
__config _CONFIG2, _MCLRE_ON & _PWRTE_ON & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_ON
__config _CONFIG3, _WDTCPS_WDTCPS_11 & _WDTE_ON & _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_ON
#ENDCONFIG
OSCCON1=%00000011
OSCCON2=%00000011
INLVLA = %11111
INLVLC = %1111111
TRISC = %11111111
DEFINE OSC 4
OSCFRQ_4MHZ
ANSELA = PORTA.2
ANSELC = %00000
OUTPUT PORTA.1 ' FAULT LED
OUTPUT PORTA.0 ' TIMING LED
OUTPUT PORTA.4 ' FET
INPUT PORTA.5 ' IGNITION
INPUT PORTC.5 ' V UNDER TRIP POINT - 11 OR 11.75
input PORTC.4 ' CHOICE BIT OF HOW THIS TURNS ON
SW1 - SW6 are inputs
green and red - outputs to leds
"Battery sense" is an analog in
"I sense" is a 12V in (broken down to <5v)
FET - output
whats happeing is when IG comes on the program resets when there is a load on FET - with no load it works. (I'm trying more filtering on IG AND FET output and make sure C3 is .1)
btw - insult it all you want...
Again - I'm all ears on someone helping me - lmk I'll giv emy email and set it up.
Last edited by pescador; - 31st May 2023 at 13:55.
My dad never liked you...
Bookmarks