I've got a big one here. I can't get the TI DAC output to change. Here is my test code:
INTCON = %00000000 ' Enable TMR0 interrupts
INTCON2 = %10000000 ' ENABLES PORTB PULL UPS
'T0CON = %11010101 ' ENABLES TM0 AND SET PRESCALER
RCON = %00000000 ' IPEN RCON.7 INTERUPT PRIORITY LEVEL DISABLED
ADCON0 = %00000000 ' ATOD CH 4 CONVERTER ENABLED
ADCON1 = %01111111 ' All digital = 01111111
ADCON2 = %10000110 ' RIGHT JUST RESULT 0 TAD FOSC/64
OSCCON = %01101101 '
VOUTB VAR WORD
LOOP:
toggle porta.7
voutb = %0011010111111011
HIGH PORTB.5
PAUSEUS 2
low portb.5
shiftout portb.3,portb.2,5,[voutb\16]
HIGH PORTB.5
PAUSEUS 2
low portb.5
pause 1
shiftout portb.3,portb.2,5,[voutb\16]
HIGH PORTB.5
PAUSEUS 2
low portb.5
HIGH PORTA.0
PAUSE 5
LOW PORTA.0
pause 5
goto loop
END
PIC is running fine. 4 MHz internal clock right on time. Getting good bit stream and clock pulse.
Problem. I cannot get pin 18 PortA.7 to toggle or respond to HIGH or LOW pin commands. I tied on a pull up resistor, now it will not go low. Either way the DAC isn't listening. Just stays at mid scale so long as the CLR not pin is low.
Bookmarks