BUG IN PBP 2.50 & 2.50A pic16F688 ??


Closed Thread
Results 1 to 14 of 14

Hybrid View

  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

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