Shop OBEX P1 Docs P2 Docs Learn Events
Problems with 29124 Altimeter and DS302 clock — Parallax Forums

Problems with 29124 Altimeter and DS302 clock

gschabelgschabel Posts: 2
edited 2014-04-10 11:47 in Propeller 1
Why won't this work? The Altimeter works or the DS1302 clock works but the clock won't work when the altimeter is working.<br>
<br>
code:
[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]''MyNew29124[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]''Documents/Propeller/Altimiter/Mine/MyNew29124.spin[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]CON[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]_clkmode      = xtal1 + pll16x  [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]_xinfreq      = 5_000_000       [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]'-----     Parallax 4 by 20 LCD display -------------------------------[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]LCD_Pin       = 3[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]LCD_Baud      = 19_200[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]LCD_Lines    = 4[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]'-----     DS1320 Real Time clock -------------------------------------[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]RTC_rst        = 0      'Orange  1302.5[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]RTC_data       = 1       'Yellow 1302.6  [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]RTC_clock      = 2       'Green 1302.7[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]Var[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]long  lmth, lday, lyear, lhour, lminute,     lsecond, ldow[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]Byte  mth, day, year, hour, minute, second,     dow[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]Con[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]'----     Barometer  #29124     ----------------------------------------[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]SC          =     6                    'Orange[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]SD          =     7                    'Yellow[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]Obj[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]RTC           : "DS1302"[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]F32            : "Float32"[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]SN            : "Simple_Numbers"[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]LCD           : "Debug_Lcd"[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]bar   : "29124_altimeter" [/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]''==================================================================[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]Pub     Main | p[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]RTC.init(RTC_clock,RTC_data,RTC_rst)            'Start DS1302 clock chip    [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]waitcnt(     cnt + clkfreq * 1)[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]lcd.init(LCD_PIN,     LCD_BAUD, LCD_LINES)          ' start     lcd[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]lcd.cursor(0)                                 ' cursor     off[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]lcd.backLight(1)                              ' backlight     on (if available)[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]lcd.CLS                                       '     Clear display                                              'Start Float32[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]LCD.Gotoxy(0,0)[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]LCD.str(string("MyNew29124"))[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]waitcnt(     clkfreq * 1 + cnt )[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]bar.start_explicit(     SC, SD, False )[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][FONT=Times New Roman][SIZE=3][COLOR=#000000]bar.set_resolution(     bar#highest )  'Set to highest     resolution. [/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][LIST=1][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]repeat  [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            RTC.readDate( @day, @mth,     @year, @dow )[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            RTC.readTime( @hour, @minute,     @second ) ' read time from DS1302 [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            LCD.gotoxy(0,1)[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( SN.decx(mth, 2 ) )[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str(     string("/"))   [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( SN.decx(day, 2 )     )      [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( string("/"))     [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( SN.decx(year, 2 ))[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd. gotoxy(12, 1)[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( SN.decx(hour, 2 ) )[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( string(":"))     [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( SN.decx(minute, 2 ) )[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( string(":")     )[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            lcd.str( SN.decx(second, 2 ))[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            Lcd.Gotoxy(0,3)    [/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            p := bar.current_press                          ' Get the     average pressure[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[*][SIZE=3][COLOR=#000000][FONT=Times New Roman]            Lcd.Str(SN.Decx(p,4))[/FONT][/COLOR][/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[/LIST][FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][SIZE=3][COLOR=#000000][FONT=Times New Roman] [/FONT][/COLOR][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000000]

Comments

Sign In or Register to comment.