Problems with 16F684


Closed Thread
Results 1 to 27 of 27
  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579

    Default Problems with 16F684

    I try to build one thermo-volt-meter for using in my car. I wrote the code, based on my (working) previous experiences with DS18B20 and the great example of Mr.Gioppy (SerVolt). But...the result are ...strange : despite Ubat = 16 Volts, on display the value is 0.02, alternating with 0.22 ?!?
    Maybe a sharp mind will find my mistake(s). Thanks in advance !!!
    Code:
    ;
    ; http://www.picbasic.co.uk/forum/showthread.php?t=7182&highlight=gioppy
    ; Volt-termometru cu 16F676
    ;
    @ DEVICE pic16F684, intrc_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON
    define osc 4
    
    
    TRISA= %00010000                            
    TRISC= %00110000                 
    CMCON0  = %00000111      'Disable analog comparators.     
    
    DEFINE ADC_BITS 10       ' 10 bit A/D Conversion
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50   ' 50 uS A/D sample time
    
    VRCON  = %00000000       ' Disable Comparator Voltage Reference
    ANSEL  = %00000100       ' Set pin (AN2) to analog input, the rest to digital
    ADCON0 = %10001001       ' Set up A/D converter - Right Just., VDD REF., CH 2, ON
    ADCON1 = %00110000       ' Set up A/D Converter clock source to internal RC
                           
    DEFINE LCD_DREG PORTC                      ' LCD on port B
    DEFINE LCD_DBIT 0                          ' Data bits B4..B7
    DEFINE LCD_RSREG PORTA                     ' RS on PORTA
    DEFINE LCD_RSBIT 1                         ' RS on A1 
    DEFINE LCD_EREG PORTA                      ' E on PORTA
    DEFINE LCD_EBIT 0                          ' E on A0
    DEFINE LCD_BITS 4                          ' LCD 4 bit mode
    DEFINE LCD_LINES 2                         ' 2 line LCD display
    Define LCD_COMMANDUS 2000                  ' Command Delay (uS)
    Define LCD_DATAUS 50                       ' Data Delay (uS)
    
    
    Temperature1     Var    Word        ' Temperature storage
    Temperature2     Var    Word        ' Temperature storage
    TempC1           Var    Word
    TempC2           Var    Word
    Float1           Var    Word
    Float2           Var    Word
    Sign1         Var    Byte        ' +/- sign
    Sign2         Var    Byte        ' +/- sign
    DQ1         Var    PORTC.5        ' One-wire data pin           
    DQ2         Var    PORTC.4        ' One-wire data pin        
    
    Twist1           Var    Bit
    Dummy1           Var    Byte
    V1               Var    Word
    Twist2           Var    Bit
    Dummy2           Var    Byte
    V2               Var    Word
    
    
    Vfs             con     20480           '20,480v 
    K16             con     61441           'coefficiente filtro 15/16
    Vbatt           var     word            'Vbatt filtrato
    TmpW            var     word
    Acc_Vbatt       var     word            'accumulatore Vbatt filtrato * 16
    
    DS18B20_1_12bit CON %01111111             ' 750ms,   0.0625°C  (default)
    DS18B20_2_12bit CON %01111111             ' 750ms,   0.0625°C  (default)
    
    
    Twist1 = 0
    Twist2 = 0
    
    Pause 500
    LCDOUT $FE, 1, $FE, $0C                 ' Clear display, cursor off
    Pause 500
    
    
    ' Init Sensor 1
     OWOUT DQ1, 1, [$CC, $4E, 0, 0, DS18B20_1_12bit]
     OWOut DQ1, 1, [$CC, $48]                   ' Start temperature conversion
     OWOut DQ1, 1, [$CC, $B8] 
     OWOut DQ1, 1, [$CC, $BE] 
     Pause 50
     OWIn DQ1, 2, [temperature1.byte0, temperature1.byte1]
     Pause 50 
    ' Init Sensor 2
     OWOUT DQ2, 1, [$CC, $4E, 0, 0, DS18B20_2_12bit]
     OWOut DQ2, 1, [$CC, $48]                   ' Start temperature conversion
     OWOut DQ2, 1, [$CC, $B8] 
     OWOut DQ2, 1, [$CC, $BE] 
     Pause 50
     OWIn DQ2, 2, [temperature2.byte0, temperature2.byte1]
     Pause 50 
    
    '==================================================================================================================
    
    Main :
    
    Part1:
    ' Start temp.conv.Sensor1
     OWOut DQ1, 1, [$CC, $44] 
     
     WaitLoop1:
     While not DQ1 
     Wend
    
     OWOut DQ1, 1, [$CC, $BE]
     OWIn DQ1, 2, [temperature1.byte0, temperature1.byte1]  
        
    If Temperature1.15 then       
      Temperature1= ~Temperature1 +1
      Twist1 = 1
    Endif
     
    Dummy1 = 625 * Temperature1
    TempC1 = DIV32 10 
    TempC1 = (Temperature1 & $7FF) >> 4
    Float1 = ((Temperature1.Lowbyte & $0F ) * 25 )>>2
    Temperature1 = TempC1*100 + Float1
    
    If Twist1 then
      V1= 10000 - Temperature1                 
      Twist1 = 0
     else
      V1= 10000 + Temperature1
    EndIf
    
    If V1 >= 10000 then                           
      Temperature1=V1-10000                   
     else                                   
      Temperature1=10000-V1                    
    EndIf
    '===================================================================================================================
    Part2 :    
    ' Start temp.conv.Sensor1
     OWOut DQ2, 1, [$CC, $44] 
    
     WaitLoop2:
     While not DQ2 
     Wend
    
     OWOut DQ2, 1, [$CC, $BE]
      OWIn DQ2, 2, [temperature2.byte0, temperature2.byte1]  
    
    If Temperature2.15 then       
      Temperature2= ~Temperature2 +1
      Twist2 = 1
    Endif
     
    Dummy2 = 625 * Temperature2
    TempC2 = DIV32 10 
    TempC2 = (Temperature2 & $7FF) >> 4
    Float2 = ((Temperature2.Lowbyte & $0F ) * 25 )>>2
    Temperature2 = TempC2*100 + Float2
    
    If Twist2 then
      V2= 10000 - Temperature2               
      Twist2 = 0
     else
      V2= 10000 + Temperature2
    EndIf
    
    If V2 >= 10000 then                           
      Temperature2=V2-10000                   
     else                                   
      Temperature2=10000-V2                   
    EndIf
    '==========================================================================================================================
    GoSub SelectSign
    Gosub Get_Vbatt                           ' make a new measure
            TmpW = Vbatt * Vfs                    ' AD * 20480
            TmpW = Div32 1024                     '(AD * 20480) / 1024
    if (temperature1/100) =>10 then
    LcdOut $FE, $80, "I:", Sign1, DEC (Temperature1 / 100), ".", DEC Temperature1 dig 1, 223 
    else
    LcdOut $FE, $80, "I:", Sign1, $14, DEC (Temperature1 / 100), ".", DEC Temperature1 dig 1, 223 
    endif
    if (temperature2/100) =>10 then
    LcdOut $FE, $c0, "O:", Sign2, DEC (Temperature2 / 100), ".", DEC Temperature2 dig 1, 223, " ", "V:",dec TmpW dig 4,dec TmpW dig 3,",",dec TmpW dig 2
    
    LcdOut $FE, $C0, "O:", Sign2, $14, DEC (Temperature2 / 100), ".", DEC Temperature2 dig 1, 223, " ", "V:", dec TmpW dig 4,dec TmpW dig 3,",",dec TmpW dig 2
    endif
    
    Goto Main                                                                    
    '==========================================================================================================================
    SelectSign:
    If v1 = 10000 then                      
      Sign1=" "                          
     else 
      If v1 < 10000 then                     
       Sign1="-"                             
      else
       Sign1="+"                          
      EndIf
    EndIf
    
    If v2 = 10000 then                      
      Sign2=" "                          
     else 
      If v2 < 10000 then                     
       Sign2="-"                              
      else
       Sign2="+"                        
      EndIf
     EndIf
    
    Return
    '==========================================================================================================================
    Get_Vbatt:
            ADCON0.1 = 1                        'start A/D
            while ADCON0.1 = 1          
            wend
            TmpW.byte1 = ADRESH                 'get A/D value
            TmpW.byte0 = ADRESL
            Acc_Vbatt = Acc_Vbatt ** K16 + TmpW      'filtro 15/16
            Vbatt = Acc_Vbatt / 16                  ' / 16 valore normalizzato       
            Acc_Vbatt = TmpW * 16                 'filter preload  Vbatt * 16
    return
    Name:  v_temp.jpg
Views: 3210
Size:  781.9 KB
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    I found two errors :
    - TRISA= 000100
    - mising "else" in display "O:" temperature.
    Now display works fine, but...maximum value of Ubat is 6,44.
    ?!?
    ...
    LE : I did it ! RV2 changed to 5 K. The value on display it's correct now !Name:  result.jpg
Views: 4048
Size:  174.4 KB
    Last edited by fratello; - 11th November 2011 at 08:09.

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    I need to re-configure the I/O pin assignement, so I re-wrote the code for new hardware. In ISIS I have this problem :
    Name:  error.jpg
Views: 3154
Size:  277.1 KB
    It's just one simulation problem or software problem ? Need advice ! Thanks !
    Code:
    @ DEVICE pic16F684, intrc_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_OFF
    define osc 4
    
    TRISA= %00010000                           
    TRISC= %10110000
                    
    CMCON0  = %00000111      'Disable analog comparators.     
    
    DEFINE ADC_BITS 10       ' 10 bit A/D Conversion
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50   ' 50 uS A/D sample time
    
    VRCON  = %00000000       ' Disable Comparator Voltage Reference
    ANSEL  = %10000000       ' Set pin (AN7) to analog input, the rest to digital
    ADCON0 = %10011101       ' Set up A/D converter - Right Just., VDD REF., CH 7, ON
    ADCON1 = %00110000       ' Set up A/D Converter clock source to internal RC
                         
    ;----[ Change these to match your LCD ]--------------------------------------- 
    LCD_DB4    VAR PORTA.2 
    LCD_DB5    VAR PORTC.0 
    LCD_DB6    VAR PORTC.1 
    LCD_DB7    VAR PORTC.2 
    LCD_RS     VAR PORTA.0 
    LCD_E      VAR PORTA.1 
    LCD_Lines  CON 2     ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines) 
    LCD_DATAUS CON 50     ' Data delay time in us 
    LCD_COMMANDUS CON 2500     ' Command delay time in us 
    INCLUDE "LCD_AnyPin.pbp"
    Note : I modify pbppic14.lib like Mr.Darrel say in "LCD_Any_pin" and I have the properly .pbp in PBP directory.

  4. #4
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Hi!
    I made my own tacho-volt-therometer with about the same schematic:
    http://www.vandi.ro/electronics/turo...metru_auto.htm
    This page is in Romanian language but maybe you and others found it useful.
    Last edited by luxornet; - 18th November 2011 at 13:05.

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Thank You for link ; but with (almost) similar hardware as Yours, my schematic work fine. BUT ... I intend to use another configuration for LCD pins (for optimised PCB), based on "LCD_Any_pin" ! This is my problem !
    I check many variants for these :
    Code:
    LCD_Lines  CON 2                    ' changed on 1, of course !!! 
    LCD_DATAUS CON 50               ' Data delay time in us -- changed to 200 
    LCD_COMMANDUS CON 2500     ' Command delay time in us -- changed to 5000
    without results...

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


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Maybe the .dsn file help to understand...
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    fratello,

    Can you post your code.
    I don't get the error with your .DSN file using this code...
    Code:
    define OSC 4
    TRISA= %00010000                           
    TRISC= %10110000
    '               
    CMCON0  = %00000111      'Disable analog comparators.     
    DEFINE ADC_BITS 10       ' 10 bit A/D Conversion
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50   ' 50 uS A/D sample time
    VRCON  = %00000000       ' Disable Comparator Voltage Reference
    ANSEL  = %10000000       ' Set pin (AN7) to analog input, the rest to digital
    ADCON0 = %10011101       ' Set up A/D converter - Right Just., VDD REF., CH 7, ON
    ADCON1 = %00110000       ' Set up A/D Converter clock source to internal RC
    '                    
    ;----[ Change these to match your LCD ]--------------------------------------- 
    LCD_DB4    VAR PORTA.2 
    LCD_DB5    VAR PORTC.0 
    LCD_DB6    VAR PORTC.1 
    LCD_DB7    VAR PORTC.2 
    LCD_RS     VAR PORTA.0 
    LCD_E      VAR PORTA.1 
    LCD_Lines  CON 2     ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines) 
    LCD_DATAUS CON 50     ' Data delay time in us 
    LCD_COMMANDUS CON 2500     ' Command delay time in us 
    INCLUDE "LCD_AnyPin.pbp"
    '
    X VAR WORD
    '
    Main:
        X = X + 1
        LCDOUT $FE,$80,DEC X,"    "
    GOTO Main
    Name:  Fratello.jpg
Views: 2785
Size:  251.0 KB
    DT

  8. #8
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Mr.Darrel ! THANK YOU for watching my post ! It's such a nice surprise !
    The rest of code it's in post #1 ; just the parts concerning 16F684 and "LCD_AnyPin" it's changed...

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


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    I don't get any errors with the code from post#1.

    Well, at least not with the LCD.
    I think you still have some problems in the code working with the DS18B20 though.
    DT

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


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    It's strange ! Using hardware and code from post #1 (and #2) the things are OK, in Proteus and "in vivo" ; changing just the configuration of LCD pins the schematic dont work anymore...I will try to build the schematic and see what happens

  11. #11
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Simple schematic, simple code, WITHOUT DS18B20 ...Still no result !!! I am ...
    Code:
    @ DEVICE pic16F684, intrc_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON
    define osc 4
    
    TRISA= %00000000                           
    TRISC= %00001000
                    
    CMCON0  = %00000111      'Disable analog comparators.     
    
    DEFINE ADC_BITS 10       ' 10 bit A/D Conversion
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50   ' 50 uS A/D sample time
    
    VRCON  = %00000000       ' Disable Comparator Voltage Reference
    ANSEL  = %10000000       ' Set pin (AN7) to analog input, the rest to digital
    ADCON0 = %10011101       ' Set up A/D converter - Right Just., VDD REF., CH 7, ON
    ADCON1 = %00110000       ' Set up A/D Converter clock source to internal RC
    
    ;----[ Change these to match your LCD ]--------------------------------------- 
    LCD_DB4    VAR PORTA.2 
    LCD_DB5    VAR PORTC.0 
    LCD_DB6    VAR PORTC.1 
    LCD_DB7    VAR PORTC.2 
    LCD_RS     VAR PORTA.0 
    LCD_E      VAR PORTA.1 
    LCD_Lines  CON 1     ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines) 
    LCD_DATAUS CON 50     ' Data delay time in us 
    LCD_COMMANDUS CON 2000     ' Command delay time in us 
    
    INCLUDE "LCD_AnyPin.pbp" 
    
    Vfs             con     20480           '20,480v 
    K16             con     61441           'coefficiente filtro 15/16
    Vbatt           var     word            'Vbatt filtrato
    TmpW            var     word
    Acc_Vbatt       var     word            'accumulatore Vbatt filtrato * 16
    
    
    Pause 500
    LCDOUT $FE, 1, $FE, $0C                 ' Clear display, cursor off
    Pause 500
    
    Main :
            ADCON0.1 = 1                          'start A/D
            while ADCON0.1 = 1          
            wend
            TmpW.byte1 = ADRESH                        'get A/D value
            TmpW.byte0 = ADRESL
            Acc_Vbatt = Acc_Vbatt ** K16 + TmpW      'filtro 15/16
            Vbatt = Acc_Vbatt / 16                  ' / 16 valore normalizzato       
            Acc_Vbatt = TmpW * 16                 'filter preload  Vbatt * 16
            TmpW = Vbatt * Vfs                    ' AD * 20480
            TmpW = Div32 1024                     '(AD * 20480) / 1024
    LcdOut $FE, $c0, dec TmpW dig 4,dec TmpW dig 3,",",dec TmpW dig 2
    Goto Main    
    return
    Name:  error2.jpg
Views: 2353
Size:  462.2 KB

  12. #12
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Same weird behavior using JUST code for thermometer ...
    Code:
    Main :
     OWOut DQ1, 1, [$CC, $44] 
     OWOut DQ1, 1, [$CC, $BE]
     OWIn DQ1, 2, [temperature1.byte0, temperature1.byte1]  
        
    If Temperature1.15 then       
      Temperature1= ~Temperature1 +1
      Twist1 = 1
    Endif
     
    Dummy1 = 625 * Temperature1
    TempC1 = DIV32 10 
    TempC1 = (Temperature1 & $7FF) >> 4
    Float1 = ((Temperature1.Lowbyte & $0F ) * 25 )>>2
    Temperature1 = TempC1*100 + Float1
    
    If Twist1 then
      V1= 10000 - Temperature1                 
      Twist1 = 0
     else
      V1= 10000 + Temperature1
    EndIf
    
    If V1 >= 10000 then                           
      Temperature1=V1-10000                   
     else                                   
      Temperature1=10000-V1                    
    EndIf
    '===================================================================================================================
    GoSub SelectSign
    if (temperature1/100) =>10 then
    LcdOut $FE, $80, "I:", Sign1, DEC (Temperature1 / 100), ".", DEC Temperature1 dig 1, 223 
    else
    LcdOut $FE, $80, "I:", Sign1, $14, DEC (Temperature1 / 100), ".", DEC Temperature1 dig 1, 223 
    endif
    
    Goto Main                                                                    
    '==========================================================================================================================
    SelectSign:
    If v1 = 10000 then                      
      Sign1=" "                          
     else 
      If v1 < 10000 then                     
       Sign1="-"                             
      else
       Sign1="+"                          
      EndIf
    EndIf
    Return

  13. #13
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Sorry for pollute this great forum ... I think it's a PROTEUS error ; with the code posted by Mr.Darrel I have the same messages .Name:  code_Mr_Darell.jpg
Views: 2463
Size:  583.4 KB

  14. #14
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Bad news, for me ... The hardware DON'T WORK ! Just some stranges characters appears on display, not stable-fast changing ...cannot post pictures... I try even code of Mr.Darrel (posted above). I think it's a "incompatibility" between THIS PIC and "LCD_AnyPin" ?!?
    What else I cand do (outside of using "clasic" configuration of LCD-PIC pins) ?

  15. #15
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Please, can someone to compile this file for me ? Maybe it's something wrong with my PBP or WinXp or...I dont know....
    Thanks in advance !
    Attached Files Attached Files

  16. #16
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Quote Originally Posted by fratello View Post
    Please, can someone to compile this file for me ? Maybe it's something wrong with my PBP or WinXp or...I dont know....
    Thanks in advance !
    I would be willing to compile your code with my PBP v. 2.6 compiler, and I tried to do so. But it won't compile without the include file "LCD_AnyPin.pbp" . If you can post the code to this include file I will give it a go for you.
    Regards, jellis00

  17. #17
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Thank You for help ! Mr.Darrel code can be found there : http://www.picbasic.co.uk/forum/cont...CD-on-any-pins

  18. #18
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Sorry, fratello....I thought I could help you but I found out your code is setup for use only with the PM assembler which I can't use with my 64 bit machine. I can only use the MPASM assembler. Maybe someone else can help you test compile this.

  19. #19
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Never mind...Thanks anyway for help !
    Regards !

  20. #20
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Hi fratello!
    I tried to compile but I got :
    Error UNTEST~.ASM 440: [235] opcode expected insted of 'error'

  21. #21
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Strange ...
    I have no errors on compiling...just not work !
    Attached Images Attached Images  

  22. #22
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    With code from post #1, I build this thermo-voltmeter for using in car.
    Note : for "I(nside)" I dont have anymore DS18B20 sensor...
    Attached Images Attached Images     

  23. #23
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Congratulation, Fratello!
    Good work.

  24. #24
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Hi, Fratello

    I just think ISIS doesn't appreciate you do not wait for DS1820 temp conversion complete to continue running your code ...
    not a real problem ( Mikroelektronika lets it as-is in its onewire drivers ... booooo )

    in easy words, ....Change

    Code:
    Main :
     OWOut DQ1, 1, [$CC, $44] 
     OWOut DQ1, 1, [$CC, $BE]
     OWIn DQ1, 2, [temperature1.byte0, temperature1.byte1]
    for
    Code:
    '*****************************************************************************
    ' Start temperature conversion
    '*****************************************************************************
    main:
     OWOut DQ1, 1, [$CC, $44 ]
    '*****************************************************************************
    ' Check for still busy converting 
    '*****************************************************************************
    waitloop: 
    
     OWIn DQ1, 4, [Busy]        ' Check for still busy converting
     
     Pause 95         ' Slow Down to actual Conv. time
     
     If NOT Busy Then waitloop
      
    '*****************************************************************************
    ' Read the temperature
    '*****************************************************************************
     OWOut DQ1, 1, [$CC, $BE ]
     OWIn DQ1, 2, [temperature1.byte0, temperature1.byte1]
      
    
    .
    .
    .
    you will display the very last correct measurement and not get " 85°C" or junk at power up ...

    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 " !!!
    *****************************************

  25. #25
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Thank You so much for help !
    I give up to use "LCD_AnyPin" ... since don't work (see post above, #14) ! I use "classic" hardware, with good results ! And I made one good PCB too...
    Best regards !
    Attached Images Attached Images  
    Last edited by fratello; - 1st December 2011 at 16:52.

  26. #26
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    You made that PCB in Proteus?

  27. #27
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with 16F684

    Oh, no ! In SprintLayout !

Members who have read this thread : 1

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