<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=12&amp;t=15274&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-05-02T06:59:06+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=12&amp;t=15274&amp;mode</id>
<entry>
<author><name><![CDATA[slawek3000]]></name></author>
<updated>2016-05-02T06:59:06+01:00</updated>
<published>2016-05-02T06:59:06+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15274&amp;p=159707#p159707</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15274&amp;p=159707#p159707"/>
<title type="html"><![CDATA[Zegar DS1307 a biblioteki SD cart Bascom]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15274&amp;p=159707#p159707"><![CDATA[
Witam,<br /><br />dziś kolejny problem nie wiem dlaczego wyskakuje mi error 220 w taki kodzie <br /><br />[syntax=basic4gl]$regfile = &quot;m644pdef.dat&quot;                                   ' specify the used micro<br />$crystal = 16000000<br />$baud = 19200                                               ' use baud rate<br />$hwstack = 32                                               ' default use 32 for the hardware stack<br />$swstack = 10                                               ' default use 10 for the SW stack<br />$framesize = 40                                             ' default use 40 for the frame space<br /><br />$lib &quot;glcdKS108.lbx&quot;<br />'$lib &quot;mcsbyte.lbx&quot;                                          ' for smaller code<br />$lib &quot;ds1307clock.lib&quot;<br />$include &quot;Card_init.bas&quot;<br /><br />Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portd , Ce = 6 , Ce2 = 7 , Cd = 4 , Rd = 3 , Reset = 2 , Enable = 5<br />                                      ' modified lib<br /><br /><br />'Const Clockmode = 1<br /><br />Enable Interrupts<br />'configure the scl and sda pins<br />Config Sda = Portc.1<br />Config Scl = Portc.0<br />Config I2cdelay = 10<br />I2cinit<br />'address of ds1307<br />Const Ds1307w = &amp;HD0                                        ' Addresses of Ds1307 clock<br />Const Ds1307r = &amp;HD1<br />Config Date = Dmy , Separator = -                           '<br />Config Clock = User                                         ' this will dim the bytes automatic<br />'dim other needed variables<br />Dim Weekday As Byte<br />Dim Dzientyg As String * 2<br />Dim Dzien As String * 10<br />Dim Miesiac As String * 10<br />Dim Rok As String * 10<br />Dim Godzina As String * 3<br />Dim Minuta As String * 3<br />Dim Sekunda As String * 3<br />Dim Dzienroku As Word<br />Declare Sub Setweekday<br />Declare Sub Sd_card<br /><br /><br />Cls<br />' assigning the time will call the SetTime routine<br />Time$ = &quot;07:41:09&quot;                                          ' to watch the day changing value<br />Date$ = &quot;02-05-16&quot;<br />Weekday = 0<br />Call Setweekday<br />If Card_init_error = 0 Then<br />   'Sprawdzamy i wyświetlamy typ podpiętej karty pamięci<br />   Select Case Mmcsd_cardtype<br />     Case 1<br />       Setfont My6_8 : Lcdat 2 , 1 , &quot;MMC-Card detected&quot;<br />     Case 2<br />       Setfont My6_8 : Lcdat 2 , 1 , &quot;SD-Card Spec. 1.x detected&quot;<br />     Case 4<br />       Setfont My6_8 : Lcdat 2 , 1 , &quot;SD-Card Spec. 2.0 detected&quot;<br />     Case 12<br />       Setfont My6_8 : Lcdat 2 , 1 , &quot;SD-Card Spec. 2.0 detected&quot;<br />     Case Else<br />       Setfont My6_8 : Lcdat 2 , 1 , &quot;No Card detected&quot;<br />   End Select<br /><br /> Else                                                       'jeśli karta nie zostala prawidłowo zainicjalizowana to wyświetlamy komunikat o błędzie<br />    Setfont My6_8 : Lcdat 3 , 1 , &quot;Error: &quot; ; Card_init_error<br /> End If                                           ' 13 november 2002<br />Do<br />Dzien = Mid(date$ , 4 , 2)<br />Miesiac = Left(date$ , 2)<br />Rok = Right(date$ , 2)<br />Godzina = Left(time$ , 2)<br />Minuta = Mid(time$ , 4 , 2)<br />Sekunda = Right(time$ , 2)<br />Dzienroku = Dayofyear()<br />    Setfont My6_8 : Lcdat 1 , 1 , Dzien ; &quot;.&quot; ; Miesiac ; &quot;.&quot; ; Rok ;<br /><br />    'Setfont My6_8 : Lcdat 2 , 1 , &quot;Date Time : &quot; ; Date$ ; &quot; &quot;<br />    Setfont My6_8 : Lcdat 1 , 62 , ; Time$ ;<br />    'Setfont My6_8 : Lcdat 2 , 1 , Dzientyg<br /><br />Loop<br /><br />End<br /><br />Getdatetime:<br />  I2cstart<br />  I2cwbyte Ds1307w<br />  I2cwbyte 0<br />  I2cstop<br />  I2cstart<br />  I2cwbyte Ds1307r<br />  I2crbyte _sec , Ack<br />  I2crbyte _min , Ack<br />  I2crbyte _hour , Ack<br />  I2crbyte Weekday , Ack<br />  I2crbyte _day , Ack<br />  I2crbyte _month , Ack<br />  I2crbyte _year , Nack<br />  I2cstop<br />  _sec = Makedec(_sec) : _min = Makedec(_min) : _hour = Makedec(_hour)<br />  _day = Makedec(_day) : _month = Makedec(_month) : _year = Makedec(_year)<br />   'If Weekday = 1 Then                                      'dopasowanie zakresu do potrzeb programu i zakresu RTC<br />  'Weekday = 6<br />   ' Else<br />     'Weekday = Weekday - 2<br />  'End If<br />  Dzientyg = Lookupstr(weekday , Weekstrdays)<br />Return<br /><br />Setdate:<br /> 'If Weekday = 6 Then                                        'dopasowanie zakresu do potrzeb programu i zakresu RTC<br />   'Weekday = 1<br />   'Else<br />    'Weekday = Weekday + 2<br />  'End If<br />  _day = Makebcd(_day) : _month = Makebcd(_month) : _year = Makebcd(_year)<br />  I2cstart<br />  I2cwbyte Ds1307w<br />  I2cwbyte 4<br />  I2cwbyte _month<br />  I2cwbyte _day<br />  I2cwbyte _year<br />  I2cstop<br />  Waitms 10<br />  Dzientyg = Lookupstr(weekday , Weekstrdays)<br />Return<br /><br />Setweekday:<br />  I2cstart<br />  I2cwbyte Ds1307w<br />  I2cwbyte 3<br />  I2cwbyte Weekday<br />  I2cstop<br />  Waitms 10<br />Return<br /><br />Settime:<br />  _sec = Makebcd(_sec) : _min = Makebcd(_min) : _hour = Makebcd(_hour)<br />  I2cstart<br />  I2cwbyte Ds1307w<br />  I2cwbyte 0<br />  I2cwbyte _sec<br />  I2cwbyte _min<br />  I2cwbyte _hour<br />  I2cstop<br />  Waitms 10<br />Return<br />Sub Sd_card<br />     Ff = Freefile()<br />   Open &quot;logaqva.csv&quot; For Append As #ff                     'For Output As #ff<br />   'zapisujemy zmienne<br />   Dim A As Word , B As Integer , C As Word<br />   A = 20<br />   B = 11<br />   C = 3674<br /><br />   Write #ff , A , B , C , Chr(13)                          'te dane zostaną zapisane w pierwszym wierszu<br /><br />   Close #ff<br />'------------------------Odczyt zmiennych z csv---------------------------------<br />   Print &quot;Czytam z pliku csv&quot;<br />   Ff = Freefile()<br />   Open &quot;logaqva.csv&quot; For Input As #ff<br />   Input #ff , A , B , C                                    'odczytujemy kolejne pola pliku csv<br /><br />   Close #ff<br /><br />   Setfont My6_8 : Lcdat 5 , 1 , A ; B ; C ;<br /><br />End Sub<br />Weekstrdays:<br />Data &quot;Poniedzialek&quot; , &quot;Wtorek&quot; , &quot;Sroda&quot; , &quot;Czwartek&quot; , &quot;Piatek&quot; , &quot;Sobota&quot; , &quot;Niedziela&quot;<br />$include &quot;my6_8.font&quot;[/syntax]<br /><br />lista błędów poniżej <br /><a href="https://obrazkiforum.atnel.pl/988/5d371e403dcec1c5eae4ad0cbb5a60e0.gif"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/988/5d371e403dcec1c5eae4ad0cbb5a60e0.gif" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=988">slawek3000</a> — 2 maja 2016, o 06:59</p><hr />
]]></content>
</entry>
</feed>