I don't post much but last night I was work on finalizing a hserin interrupt routine for a project I'm working on. I'm using pic18f4431 portb.5 as an output for a buzzer on my main board. I normally just hook my scope to a jumper pin for portb.5 to monitor as a heart beat. Anyway I've used this main board in many projects so I know there are no hardware issues. But for some reason after testing the hserin routine portb.5 stopped working. I've tried everything I know, I wrote a simple program just to toggle portb.5 and portb.6. Portb.5 nothing sitting at zero volts portb.6 10ms square wave. I've tried a new chip as well and I can't seem to get this running. I haven't seen this before but the fact that even a new chip won't work leads me to believe some obscure setting is wrong and can't find it. The crazy thing is that I loaded my original code back to the board and portb.5 no longer works. So it has to be a setting of some sort.
If anyone can help me get this going I'll post a full project and video of a large feed to length automated machine I'm finishing up. Thanks
Little test program:
Code:;----[18F4431 Hardware Configuration]------------------------------------------- #IF __PROCESSOR__ = "18F4431" #DEFINE MCU_FOUND 1 #CONFIG CONFIG OSC=XT, FCMEN=OFF, IESO=OFF, PWRTEN=OFF, BOREN=OFF, BORV=20, WDTEN=OFF CONFIG WDPS=512, WINEN=OFF, PWMPIN=OFF, LPOL=HIGH, HPOL=HIGH, T1OSCMX=OFF CONFIG FLTAMX=RC1, SSPMX=RC7, PWM4MX=RD5, EXCLKMX=RC3, MCLRE=ON, STVREN=ON CONFIG LVP=OFF, DEBUG=OFF, CP0=OFF, CP1=OFF, CP2=OFF, CP3=OFF, CPB=OFF CONFIG CPD=OFF, WRT0=OFF, WRT1=OFF, WRT2=OFF, WRT3=OFF, WRTC=OFF, WRTB=OFF CONFIG WRTD=OFF, EBTR0=OFF, EBTR1=OFF, EBTR2=OFF, EBTR3=OFF, EBTRB=OFF #ENDCONFIG #ENDIF ;----[Verify Configs have been specified for Selected Processor]---------------- ; Note: Only include this routine once, after all #CONFIG blocks #IFNDEF MCU_FOUND #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]" #ENDIF '---[OSCILATORS]---------------------------------------------------------------- DEFINE OSC 8 OSCTUNE = %00000000 OSCCON = %01111000 '---[CAPTURE COMPAIR MODUALS]--------------------------------------------------- CCP1CON = %00000000 CCP2CON = %00000000 '------------------------------------------------------------------------------- '---[ANALOG CHANELS TO DIGITAL]------------------------------------------------- ANSEL0 = %00000000 ANSEL1 = %00000000 ADCON0 = %00000000 '---[CONFIGURE PORT]------------------------------------------------------------ TRISB = %00000000 LATB = %00000000 PORTB = %00000000 '------------------------------------------------------------------------------- '---[ Alias ]------------------------------------------------------------------- BUZZER VAR PORTB.5 BUZZER2 VAR PORTB.6 '---[ MAIN PROGRAM]------------------------------------------------------------- MAIN: TOGGLE BUZZER TOGGLE BUZZER2 PAUSE 10 GOTO MAIN END




Bookmarks