TEST PBP 2.50 & 2.50A:
'DEVICES------------------------------------------------------------------
@ DEVICE pic16F688,HS_OSC
@ DEVICE pic16F688,WDT_OFF ' Watchdog Timer
@ DEVICE pic16F688,PWRT_ON ' Power-On Timer
@ DEVICE pic16F688,BOD_ON ' Brown-Out Det
@ DEVICE pic16F688,CPD_OFF ' Data Memory Code Protect 876
@ DEVICE pic16F688,PROTECT_OFF' Program Code Protection
'-------------------------------------------------------------------------
'DEFINES-----------------------------------------------------------------
DEFINE OSC 20
DEFINE HSER_RCSTA 90h
DEFINE HSER_TSTA 24h
DEFINE HSER_BAUD 19200
DEFINE HSER_CLROERR 1
DEFINE NO_CLRWDT 1
CMCON0=7
ADCON0=7
ANSEL=0
WPUA=0
WPU=0
IOCA=0
PCON=0
PIE1=0
TRISA=%00111111
TRISC=%00100010
INICIO:
PORTC.0=1:PAUSE 1000:PORTC.0=0 ' LED ON / OFF OK
OWOUT PORTA.1,1,[$33] ' <----------- PIC STOP , NO GOTO INICIO
GOTO INICIO
TEST PBP 2.47
'DEVICES------------------------------------------------------------------
@ DEVICE pic16F688,HS_OSC
@ DEVICE pic16F688,WDT_OFF ' Watchdog Timer
@ DEVICE pic16F688,PWRT_ON ' Power-On Timer
@ DEVICE pic16F688,BOD_ON ' Brown-Out Det
@ DEVICE pic16F688,CPD_OFF ' Data Memory Code Protect 876
@ DEVICE pic16F688,PROTECT_OFF' Program Code Protection
'-------------------------------------------------------------------------
'DEFINES-----------------------------------------------------------------
DEFINE OSC 20
DEFINE HSER_RCSTA 90h
DEFINE HSER_TSTA 24h
DEFINE HSER_BAUD 19200
DEFINE HSER_CLROERR 1
DEFINE NO_CLRWDT 1
'ALL DIGITAL MODE
CMCON0=7
ADCON0=7
ANSEL=0
WPUA=0
WPU=0
IOCA=0
PCON=0
PIE1=0
TRISA=%00111111
TRISC=%00100010
INICIO:
PORTC.0=1:PAUSE 1000:PORTC.0=0 ' LED ON / OFF OK
OWOUT PORTA.1,1,[$33] ' <----------- PIC NO STOP OK
GOTO INICIO 'OK GOTO INICIO
When compiled with pbp 5.xx or higher on the lines OWINOUT the micro stands and not continue the process, the same thing happens if you use SEROUT/SEROUT2. If you compile with pbp 2.47 then it works well.
Posted on: January 09, 2008, 06:53:56 18:53 - Automerged
Yep. There is a problem in the OWOUT library routine that causes a continuous loop if the
defined OSC > 8.
Open your pbppic14.lib. Scroll down to the OWOUT library routine.
Change this;
Code:
iorwf INDF, F ; Set to input then wait ~10us for recovery
decfsz R1 + 1, F ; Do next bit, if any
if (OSC >
movlw 9 ; Delay 9us
call PAUSEUS
endif
goto owoutloop
-----------------------------------------------------
To this;
Code:
iorwf INDF, F ; Set to input then wait ~10us for recovery
if (OSC >
movlw 9 ; Delay 9us
call PAUSEUS
endif
decfsz R1 + 1, F ; Do next bit, if any
goto owoutloop
------------------------------------------------------------
decfsz R1 + 1, F needs to be after if (OSC >
and just before goto owoutloop or you're stuck
in a nasty continuous loop whenver OSC > 8.
Regards.