unstable ADCIN readings when using DT ELAPSED.PBP


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You shouldn't need to turn the timer off. And doing so will affect the accuracy of the Elapsed Timer.
    And the Interrupts won't interfere with the MSSP module.

    I think you just need to wait for the SecondsChanged flag before sending it to the LCD.
    Then it won't be changing the time while you're trying to display it.

    Code:
    HauptSchleife:
        IF SecondsChanged THEN
            SecondsChanged = 0
            GOSUB EBSLCDZeile1
            ARRAYWRITE LCDText,[DEC2 days, "+", DEC2 Hours, ":", DEC2 Minutes, ":", DEC2 seconds, REP 32\11]
            GOSUB EBSLCDTEXTOUT
        ENDIF
        PAUSE 1
    GOTO HauptSchleife
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    You shouldn't need to turn the timer off. And doing so will affect the accuracy of the Elapsed Timer.
    Yes, expected the inaccuracy. As our process is finished in ~10 hours this inaccuracy is no issue.

    We are seeing with this code irregular values in the first line and no issues in the second line. The interrupts are interfering with the arraywrite instruction.

    It's never that anything is printed beyond the 10th char but that random characters are printed anywhere in the digits, all zeroes and non-numbers are also seen.

    Code:
    'Code is licensed as http://creativecommons.org/licenses/by-sa/3.0/de/
    '(c) 2010 Ing Buero A. Czech
    
    DEFINE DEBUG_MODE 1    'Auf 1 setzen, wenn keine Debuggen notwendig
    DEFINE DEBUGIN_MODE 1
    
    INCLUDE "BS1DEFS.bas"
    INCLUDE "EBS18F2423.pbp"
    INCLUDE "EBSMasterKonf.pbp"
    INCLUDE "EBSMasterVar.pbp"
    INCLUDE "Elapsed-18.pbp"
    INCLUDE "LCDAusgabe.pbp"
    
    '===============================================================================
    'VP: LCD Initialisierung
    '===============================================================================
    GOSUB EBSLCDINIT
    LCDTextAnz = 16
    
    GOSUB ResetTime
    GOSUB StartTimer
    
    DebugLoop:
    GOSUB EBSLCDZeile1
    ARRAYWRITE LCDText, [DEC10 LCDTextAnz, REP 32\11]
    GOSUB EBSLCDTEXTOUT
    T1CON.0 = 0                   ; Turn OFF Timer1
    ARRAYWRITE LCDText,[DEC2 days, "+", DEC2 Hours, ":", DEC2 Minutes, ":", DEC2 seconds, REP 32\11]
    T1CON.0 = 1                   ; Turn OFF Timer1
    GOSUB EBSLCDZeile2
    GOSUB EBSLCDTEXTOUT
    PAUSE 200

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Code:
    ARRAYWRITE LCDText, [DEC10 LCDTextAnz, REP 32\11]
    It appears that you are using PBPL now.

    There was no such thing as PBPL when I wrote the elapsed timer in 2003.
    And that version does not save system vars properly for PBPL.

    I believe you can change the save variables to LONG's and get better results...
    Code:
    R0save   var LONG
    R1save   var LONG
    R4save   var LONG
    Or, unless there is some reason you really need to use PBPL ...
    Switch back to PBPW.

    You could also use this version of the Elapsed Timer, which is known to be compatible with PBPL.
    http://darreltaylor.com/DT_INTS-18/elapsed.html
    <br>
    DT

Similar Threads

  1. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 03:21

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