BUG IN PBP 2.50 & 2.50A pic16F688 ??


Closed Thread
Results 1 to 14 of 14
  1. #1

    Thumbs down BUG IN PBP 2.50 & 2.50A pic16F688 ??

    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

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking Where's the bug ???

    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
    Last edited by Acetronics2; - 13th December 2007 at 14:10.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3


    Did you find this post helpful? Yes | No

    Smile BUG IN PBP 2.50 & 2.50A pic16F688 ??

    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.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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 > 8)
        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 > 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.
    Last edited by Bruce; - 13th December 2007 at 17:36.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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..
    Code:
    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.
    Last edited by mister_e; - 13th December 2007 at 17:42.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    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
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8


    Did you find this post helpful? Yes | No

    Thumbs up Thanks and greetings

    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.

  9. #9
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  10. #10


    Did you find this post helpful? Yes | No

    Cool I have a question ?

    I have a question also affects serout/2 because also the same case.

    Greetings

  11. #11
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    What problem are you having with SEROUT2?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  12. #12


    Did you find this post helpful? Yes | No

    Unhappy Serout problem

    With this microprocessor the same problem with owinout was detained when the process is executed the command serout2.

  13. #13
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default Newer version with this bug fixed ?

    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

    Quote Originally Posted by Bruce View Post
    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.

  14. #14
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bcd View Post
    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.

Similar Threads

  1. PBP 2.50 and Longs
    By mikendee in forum GPS
    Replies: 1
    Last Post: - 21st May 2008, 21:16
  2. PBP bug ???
    By boban in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th March 2008, 16:30
  3. PBP 2.50 UPGRADE problems!!!!
    By earltyso in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 7th March 2008, 15:42
  4. Strange problem with PBP 2.50
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th October 2007, 20:45
  5. MCS+ with PBP 2.50
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st September 2007, 05:52

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts