Bizarre behavior that I cannot explain on the PIC16F18346... any suggestions would be more than welcome.
Simply put, MYLED does NOT flash, but the output from the pin remains LOW.
meanwhile, MYLED1 flashes like it's supposed to.
STUMPED...
Simply put, MYLED does NOT flash, but the output from the pin remains LOW.
meanwhile, MYLED1 flashes like it's supposed to.
STUMPED...
Code:
' PORT/ADCON SETTINGS
ADCON0=%00010001 'A/D control
ADCON1=%11110000 '(RC conversion clock, right justified 10-bit result)
'---------------------------------------------------------------
PORTA=%00000000 'assign initial output values so they don't show up randomized
TRISA=%011101 'assign DDRA (1=in, 0=out)
ANSELA=%010000 'PA.4 analog mode
'WPUA.3=1 'enable WPU on pushbutton input (later use)
'WPUA.2=1 'enable WPU (later use)
'---------------------------------------------------------------
PORTB=%00000000 'assign initial output values so they don't show up randomized
TRISB=%11100000 'assign DDRB (1=in, 0=out)
ANSELB=%00000000 'all in digital mode
'WPUB=%11000000 'WPU for future
'---------------------------------------------------------------
PORTC=%00000000
TRISC=%00000000
ANSELC=%00000000
'*******************************************************************************
'
' DEFINES
define OSC 32
DEFINE ADC_CLOCK 2 'use separate RC conversion clock
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS
define WRITE_INT 1
'the following must be used for this chip to disable default settings (for PWM enabled)
DEFINE CCP1_REG 0 'channel-1 unused
DEFINE CCP1_BIT 0 'channel-1 unused
DEFINE CCP2_REG PORTC 'channel 2 port
DEFINE CCP2_BIT 3 'channel 2 bit (C3) used later
DEFINE CPP3_REG 0 'channel 3 unused
DEFINE CPP3_BIT 0 'channel 3 unused
DEFINE CCP4_REG 0 'channel 4 unused
DEFINE CCP4_BIT 0 'channel 4 unused
'*******************************************************************************
'
' VARIABLES / ALIASES
MYLED var PORTA.5 'pin 2
MYLED1 VAR PORTA.1 'pin 18
'*******************************************************************************
'
' MAIN PROGRAM
main:
pause 1000
MYLED=~MYLED
MYLED1=~MYLED1
goto main
end