PDA

View Full Version : BUG IN PBP 2.50 & 2.50A pic16F688 ??



FRANCISCOGIM
- 13th December 2007, 13:02
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 'Registro receptor en receptor habilitado
DEFINE HSER_TSTA 24h 'Rregistro de transmisión en transmisión habilitada
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:PORTC0=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 'Registro receptor en receptor habilitado
DEFINE HSER_TSTA 24h 'Rregistro de transmisión en transmisión habilitada
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:PORTC0=0 ' LED ON / OFF OK
OWOUT PORTA.1,1,[$33] ' <----------- PIC NO STOP OK
GOTO INICIO 'OK GOTO INICIO

Acetronics2
- 13th December 2007, 13:38
Hi, Francisco ...

The Bug is yours !!!


1st listing

BAD : PORTC.0=1:PAUSE 1000:PORTC0=0 ' LED ON / OFF OK

2nd listing

BAD : PORTC.0=1:PAUSE 1000:PORTC0=0 ' LED ON / OFF OK


MCS highlights it at first launch !!! MPLAB too ...


You offer a beer to everyone here ... LOL !

Alain

FRANCISCOGIM
- 13th December 2007, 16:26
Well, we like this:

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 'Registro receptor en receptor habilitado
DEFINE HSER_TSTA 24h 'Rregistro de transmisión en transmisión habilitada
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 'Registro receptor en receptor habilitado
DEFINE HSER_TSTA 24h 'Rregistro de transmisión en transmisión habilitada
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.

Bruce
- 13th December 2007, 17:33
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;


iorwf INDF, F ; Set to input then wait ~10us for recovery
decfsz R1 + 1, F ; Do next bit, if any
if (OSC > 8)
movlw 9 ; Delay 9us
call PAUSEUS
endif
goto owoutloop

To this;


iorwf INDF, F ; Set to input then wait ~10us for recovery
if (OSC > 8)
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 > 8) and just before goto owoutloop or you're stuck
in a nasty continuous loop whenver OSC > 8.

mister_e
- 13th December 2007, 17:37
I don't have this specific PIC here, but yes it seems that once you add the OWOUT line, things goes bad... at least on MPSIM.

EVEN THAT ONE..


INICIO:
PORTC.0=1
PAUSE 1000
PORTC.0=0 ' LED ON / OFF OK

GOTO INICIO

OWOUT PORTA.1,1,[$33] ' <----------- PIC STOP , NO GOTO INICIO

Do nothing. It seems to work on a 16F877 so far... worth a report to Melabs.

EDIT: OK OK... Bruce beat me :( ;)
EDIT2: Solution work as expected.

Acetronics2
- 13th December 2007, 19:31
Rhhaaaaa !!!

Bruce beats everybody ... but how did he know ??? MPsim ???

I just tested an old DS 1820 4 Mhz program ... that still goes pretty well ...



Ho... by the way ...

Bruce, congratulations for your commercial service .... works pretty fine to Europe.

Alain

Bruce
- 13th December 2007, 21:36
Hi Alain,


... but how did he know ??? MPsim ???
I just got lucky and looked at the OWOUT library first. MPSIM would for sure have been my
next choice however.


congratulations for your commercial service .... works pretty fine to Europe.
Thank you. I wish it worked that well to everywhere outside the U.S....;o}

FRANCISCOGIM
- 14th December 2007, 17:09
Hello everybody, thanks for your good Bruce aportacion, I was crazy with this problem. And tell the technicians of Mlasb: A little more care!

Thanks and greetings.

Bruce
- 14th December 2007, 17:31
Hi Francisco,


And tell the technicians of Mlasb
I have already informed MeLabs of the error in the OWOUT routine. I'm sure they will release
a patch shortly to fix the minor error.

This is one major reason it's so nice to have an open library. You're not dead in the water
until a re-compiled patch comes out. Just fix it, and move on. Really a nice feature with PBP.

FRANCISCOGIM
- 14th December 2007, 18:03
I have a question also affects serout/2 because also the same case.

Greetings

Bruce
- 14th December 2007, 18:40
What problem are you having with SEROUT2?

FRANCISCOGIM
- 17th December 2007, 08:17
With this microprocessor the same problem with owinout was detained when the process is executed the command serout2.

bcd
- 12th June 2008, 02:18
Did this ever get fixed ? I can see 2.50a on the Melabs site, but nothing newer. I assume this bug is still valid.

bill


Hi Francisco,


I have already informed MeLabs of the error in the OWOUT routine. I'm sure they will release
a patch shortly to fix the minor error.

This is one major reason it's so nice to have an open library. You're not dead in the water
until a re-compiled patch comes out. Just fix it, and move on. Really a nice feature with PBP.

skimask
- 12th June 2008, 02:42
Did this ever get fixed ? I can see 2.50a on the Melabs site, but nothing newer. I assume this bug is still valid.

bill

I'm not going to mess with my installation...it works too smoothly. :)
I guess the only way to figure out if 'A' fixed the problem is to install 2.50, check the macro, install the patch, and check the macro again.