Scrolling thermo


Closed Thread
Results 1 to 40 of 56

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    This is schematic who work fine in Proteus. In "real life" , despite modification of scroll timming (pause 500 to 5000 !), the led's are always ON !!! Any idea ?
    Thanks !
    Attached Images Attached Images  

  2. #2
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    Hi;

    I cannot compile that source code. What is the "LOOP" for?? This is a reserved word, you cannot compile the code with this word on a label. And i'm always getting illegal opcode.

    What are you using to compile? Mpasm? or PBP?
    Last edited by gadelhas; - 6th September 2011 at 22:06.
    Thanks and Regards;
    Gadelhas

  3. #3
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    Got it;
    Since I'm using MPASM needed to change the config line;

    Code:
    @ __config _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _BODEN_OFF & _MCLRE_ON
    Also like i said before needed to delete the "LOOP" label also, since its a reserved word.
    Thanks and Regards;
    Gadelhas

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


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    LOOP is a reserved word for new version of PBP (2.60 and latter if my memory serves me well) you can replace it with a REPEAT/UNTILL, WHILE/WEND loop.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    Quote Originally Posted by fratello View Post
    This is schematic who work fine in Proteus. In "real life" , despite modification of scroll timming (pause 500 to 5000 !), the led's are always ON !!! Any idea ?
    Thanks !
    Are they FULL ON or dimmed? I feel they will be dimmed, it's a kind of ghost probably you'll need to add some delay after you turn them off, after the PORTB=0 line

    Turn some LED ON, wait a little bit, turn them OFF, wait a little, do it again.
    Steve

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

  6. #6
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    I will try this code today, later...
    Code:
    ....
    LOOPing:
    FOR scroll = 0 TO 35
        FOR scan = 0 TO 15
            PORTb = 1
            porta=1
            FOR counter = 0 TO 7
                PORTA = leddata [counter]
                PAUSE 10
                PORTb = PORTb * 2
            NEXT
        NEXT
        FOR counter = 0 TO 34
            leddata [counter] = leddata [counter+1]
        NEXT
    NEXT
    GOTO START
    END
    I find another ...mistake (?) : line 2 do not appear on matrix ! What a hell it's going ?!
    Attached Images Attached Images  

  7. #7
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    Tens of variants and no result ! Nobody has a clue ?

  8. #8
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    You might have to play with your FOSC setting to enable I/O mode on RA6&RA7.

    Sphere.

  9. #9
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    With schematic from post #8 :
    Code:
    ; working variant ; anode to portB, catode to portA
    @ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_off
    define osc 4
    INTCON    = 0
    TRISA   = %00000000       
    TRISB   = %10000000
    CMCON   = 7                         ' Disable comparators
    
    DQ     var  PortB.7
    
    '***************************************************************************************
     eeprom 0, [%10100001,%01111010,%01110110,%01101110,%10100001]      '0
     eeprom 5, [%11111111,%01111101,%00000000,%01111111,%11111111]      '1
     eeprom 10,[%01111101,%00111110,%01101110,%01110110,%01111001]      '2
     eeprom 15,[%10111101,%01111110,%01110110,%01110110,%10101001]      '3
     eeprom 20,[%11100111,%11101011,%11101101,%00000000,%11101111]      '4
     eeprom 25,[%10111000,%01111010,%01111010,%01111010,%10100110]      '5
     eeprom 30,[%10100001,%01110110,%01110110,%01110110,%10101101]      '6
     eeprom 35,[%11111110,%00001110,%11110110,%11111010,%11111100]      '7
     eeprom 40,[%10001001,%01110110,%01110110,%01110110,%10001001]      '8
     eeprom 45,[%11111001,%01110110,%01110110,%01110110,%10001001]      '9
    
        counter           var      byte
        scan              var      byte
        scroll           var      byte
        leddata           var      byte[36]    'Column Data for display 36 columns
    temperature    var    Word      'reading from sensor
      Sign         var    BIT
        tempA             var      byte        'Stores First digit (High)
        tempB             var      byte        'stores Second digit (Mid)
        tempC             var      byte        'stores Third digit (low)
        n            var    byte
    
    DS18B20_12bit     CON %01111111
    
    START:
     CLEAR        'Clear all varibles
    
    ' Init Sensor 1
     OWOUT DQ, 1, [$CC, $4E, 0, 0, DS18B20_12bit]
     OWOut DQ, 1, [$CC, $48]                   ' Start temperature conversion
     OWOut DQ, 1, [$CC, $B8] 
     OWOut DQ, 1, [$CC, $BE] 
     Pause 50
     OWIn DQ, 2, [temperature.byte0, temperature.byte1]
     Pause 50 
     
    
    for n=0 to 7
    leddata [n] = %11111111
    next n
    
        leddata [13] = %11111111
        leddata [19] = %11111111
        leddata [20] = %00111111    ' DECIMAL POINT
        leddata [21] = %00111111
        leddata [22] = %11111111
        leddata [28] = %11111111
    
    
        leddata [29] = %11111100    ' degrees c
        leddata [30] = %11111100
        leddata [31] = %11100011
        leddata [32] = %10111101    
        leddata [33] = %10111101
        leddata [34] = %10111101
        leddata [35] = %11111111
          
     OWOut DQ, 1, [$CC, $44] 
     OWOut DQ, 1, [$CC, $BE]
     OWIn DQ, 2, [temperature.byte0, temperature.byte1]         
         Sign = temperature.15
         temperature= ABS(temperature)
         temperature=((temperature >> 4)*100) + ((temperature & $F) * 100 >> 4)
         if sign then temperature= -temperature
            
        tempA = temperature DIG 3
        tempB = temperature DIG 2
        tempC = temperature DIG 1
    
        IF tempA = 0 THEN
        for counter = 0 to 4
        leddata [counter+8] = %11111111
        next                                            ' if 1st digit is 0 then skip so display dosnt display 09.5c
            GOTO skipdigit                                ' it will display 9.5c instead
         ENDIF
        FOR counter = 0 TO 4
            READ tempA*5+counter,leddata [counter+8]     'stores 1st digit in leddata locations 8,9,10,11,12    
        NEXT counter
    
    skipdigit:
        FOR counter = 0 TO 4
            READ tempB*5+counter,leddata [counter+14]    'stores 2nd digit in leddata locations 14,15,16,17,18
        NEXT
        FOR counter = 0 TO 4
            READ tempC*5+counter,leddata [counter+23]    'stores 3rd digit in leddata locations 23,24,25,26,27
        NEXT    
    
    LOOPing:
    FOR scroll = 0 TO 35
        FOR scan = 0 TO 35
            PORTb = 1
            FOR counter = 0 TO 7
                PORTa = leddata [counter]
                PAUSE 1
                PORTb = PORTb * 2
            NEXT
        NEXT
        FOR counter = 0 TO 34
            leddata [counter] = leddata [counter+1]
        NEXT
    NEXT
    GOTO START
    END
    Maybe I put here tomorrow link to video (Y...tube).
    Last edited by fratello; - 8th September 2011 at 21:21.

  10. #10
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Scrolling thermo

    How I promise...
    Note : The pullup resistor on RA4 it's 4k7.

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