Ds1307 Bascom Program
IMG_6671-624x351.jpg' alt='Ds1307 Bascom Program' title='Ds1307 Bascom Program' />The LCD Module. We connect a LCD module to the AVR to run the test program. The display will be used to display the key code received from the remote. I wanted to make something for the health contest, but I had no clue where to start until my girlfriend got ill. I noticed how easily she forgot to. Build Your Own Wifi Radio 1. Steps with PicturesIll just add the full code here. It is a bit messy as I didnt have any time left to clean it up. When Ive cleaned it up and improved it, Ill post the new code. Ill also add the pictures here that I used so that you can use them too. When you program your Atmega, you should also disable JTAG in the fusebits and set the internal oscillator to 8. MHz. The code will fit into an Atmega. I used an Atmega. I want to add some extra features later. Config Serialin Buffered, Size 2. Config Serialout Buffered, Size 1. Config Graphlcd 2. Dataport Porta, Controlport Portc, Ce 5, Cd 4, Wr 7, Rd 6, Reset 2, Fs 3, Mode 8. Config Scl Portc. Config Sda Portc. Cha Alias Pind. 3. Chb Alias Pind. 4. Config Cha Input. Config Chb Input. Const Ds. 13. 07w HD0 write DS1. Const Ds. 13. 07r HD1 read ds. Const Adsecs H0. Const Admins H0. Dim Count As Byte. Dim I As Byte. Dim J As Byte. Dim Pos As Byte. Dim Oldpos As Byte. Dim Maxpos As Byte. Dim State As Byte. Dim Volume As Byte. Dim Temp As Byte. Dim Uartin As Byte. Dim Uartbuffer As Byte. Dim Hours As Byte. Dim Mins As Byte. Dim Secs As Byte. Dim Length As Byte. Dim Boxx As Byte. Dim Boxx. 2 As Byte. Dim Tube4 As Byte. Dim X As Byte. Dim Uartinstr As String 2. Dim Stationname As String 6. Dim Title As String 6. Dim Stationpos As Byte. Dim Titlepos As Byte. Dim Pointer As Byte. Dim Stationlength As Byte. Dim Titlelength As Byte. Dim Tempstr As String 4. Dim Volumestr As String 3. Dim Station2. 0 As String 3. On Int. 0 0int. Enable Int. Enable InterruptsSet Chb. On Int. 1 1int ,Enable Int. Enable Interrupts. Wait 1. Cls. Init Showpic 0, 0, Intro. Box1. 15, 9. 0 2. For I 1. 18 To 1. Step 4. J I 3. Boxfilli, 9. Wait 3. Next. Print Chr1. Wait 2. Print mpc clearFor I 0 To 3. Stationname Lookupstri, Tunerlist. Print mpc add Stationname. Next. Print mpc volume 5. Print mpc playVolume 2. Gosub Emptybuffer. I 1. Count 1. Main State ICls. If State 1 Then Goto Radio. If State 2 Then Goto Tuning. If State 3 Then Goto Vol. If State 4 Then Goto Setup. Radio Maxpos 6. Pos 1. Oldpos 1. Boxx 0. Boxx. 2 4. Showpic 0, 8. Play. Showpic 4. 0, 8. Pause. Showpic 8. Stopp. Showpic 1. Volume. Showpic 1. Tuner. Showpic 2. Clock. Box0, 8. Do. If I lt State Then Goto Main. If Pos lt Oldpos Then. Boxboxx, 8. 8 boxx. Boxx Pos 1. Boxx Boxx 4. Boxx. 2 Boxx 4. Boxboxx, 8. Empire Earth Iii Iso Download. Oldpos Pos. End If. Print echo Chr3. Chr3. Chr3. 4 Title Chr3. Chr3. 4 Name Chr3. Chr1. 3Waitms 5. Gosub Getuart. Gosub Parser. Cls Text. Locate 5, 1. Lcd Stationname. Locate 8, 1. Lcd Title. Gosub Readclock. Loop. Tuning Cls. Count 1. Do. Cls Text. If I lt State Then Goto Main. Gosub Readclock. For J 1 To 4. Stationj Lookupstrj, TunerlistNext. J Count. Locate 5, 5. Lcd StationjJ Count 1. Locate 6, 5. Lcd StationjJ Count 2. Locate 7, 5. Lcd StationjWaitms 5. Loop. Vol Cls. Do. Gosub Readclock. If I lt State Then Goto Main. Print echo Chr3. Chr3. Chr3. 4 volume Chr3. Chr1. 3Waitms 1. Gosub Getuart. Gosub Volumeparser. Cls Text. Locate 6, 1. Artha Rin Adalat Ain 2003 Bangladesh Pdf To Excel. Volume ValvolumestrLcd Volume Volume. Loop. Setup J 1. If J 1 Then Count Hours Else Count Mins. Cls. Do. Cls. If I lt State Then Goto MainGosub Readclock. If J 1 Then Hours Count Else Mins Count. Tube2 Mins 1. Temp Tube2 1. Tube1 Mins Temp. Tube4 Hours 1. Temp Tube4 1. Tube3 Hours Temp. Temp Tube4X 4. Gosub Clockpic. Temp Tube3X 7. Gosub Clockpic. Temp 1. X 9. 6Gosub Clockpic. Temp Tube2X 1. Gosub Clockpic. Temp Tube1X 1. Gosub Clockpic. Locate 8, 8. Lcd IWaitms 1. Loop. End. 0int If I 1 And Pos 1 Then Print mpc playIf I 1 And Pos 2 Then Print mpc pauseIf I 1 And Pos 3 Then Print mpc stopIf I 1 And Pos 4 Then I 3. If I 1 And Pos 6 Then I 4. If State 2 Then. Print mpc play Count. I 1. End If. If I 1 And Pos 5 Then I 2. Waitms 1. 00. If State 3 Then I 1. If I 4 And J 2 Then. Gosub Setclock. I 1. End If. If I 4 And J 1 Then. Gosub Setclock. J 2. End If. Return. 1int Waitms 1. If Cha 1 And I lt 3 Then. If Chb 0 Then Incr Count Else Decr Count. End If. If Cha 1 And I 3 Then. If Chb 0 Then Print mpc volume 5 Else Print mpc volume 5End If. Pos Count. If Pos Maxpos Then Pos Maxpos. If Pos lt 1 Then Pos 1. Return. Getuart Uartinstr Do. Uartbuffer IscharwaitingIf Uartbuffer 0 Then. Uartin InkeyIf Lenuartinstr lt 2. Then Uartinstr Uartinstr ChruartinIf Lenuartinstr 2. Then Uartinstr Uartinstr Chr1. End If. Loop Until Uartbuffer 0. Gosub Emptybuffer. Return. Volumeparser Volumestr Temp Instruartinstr, volume Temp Temp 8. Volumestr Miduartinstr, Temp, 3Return. Parser Stationname Title Stationpos Instruartinstr, Name Titlepos Instruartinstr, Title Stationpos Stationpos 6. Length 0. Do. Incr Length. Pointer Stationpos Length. Tempstr Miduartinstr, Pointer, 1Loop Until Tempstr Chr1. Or Tempstr If Length 6. Then Length 6. 0Stationname Miduartinstr, Stationpos, LengthTitlepos Titlepos 7. Length 0. Do. Incr Length. Pointer Titlepos Length. Tempstr Miduartinstr, Pointer, 1Loop Until Tempstr Chr1. Or Tempstr If Length 6. Then Length 6. 0Title Miduartinstr, Titlepos, LengthIf Stationpos 6 Then Stationname Name not foundIf Titlepos 7 Then Title Title not foundReturn. Emptybuffer Do. Uartin InkeyUartbuffer IscharwaitingLoop Until Uartbuffer 0. Return. Readclock I2cstart. I2cwbyte Ds. 13. 07w. I2cwbyte Admins. I2cstop. I2cstart. I2cwbyte Ds. I2crbyte Mins, Ack. I2crbyte Hours, Nack. Hours Hours And B0. Hours Makedechours converts BCD into Decimal. Mins MakedecminsTube2 Mins 1. Temp Tube2 1. Tube1 Mins Temp. Tube4 Hours 1. Temp Tube4 1. Tube3 Hours Temp. Temp Tube4X 4. Gosub Clockpic. Temp Tube3X 7. Gosub Clockpic. Temp 1. X 9. 6Gosub Clockpic. Temp Tube2X 1. Gosub Clockpic. Temp Tube1X 1. Gosub Clockpic. Return. Setclock Mins MakebcdminsHours MakebcdhoursReset Hours. I2cstart. I2cwbyte Ds. I2cwbyte Adsecs. I2cwbyte B0. I2cwbyte Mins. I2cwbyte Hours. I2cstop. Hours Hours And B0. Hours Makedechours converts BCD into Decimal. Mins MakedecminsReturn. Clockpic If Temp 1 Then Showpic X, 0, 1. If Temp 2 Then Showpic X, 0, 2. If Temp 3 Then Showpic X, 0, 3. If Temp 4 Then Showpic X, 0, 4. If Temp 5 Then Showpic X, 0, 5. If Temp 6 Then Showpic X, 0, 6. If Temp 7 Then Showpic X, 0, 7. If Temp 8 Then Showpic X, 0, 8. If Temp 9 Then Showpic X, 0, 9. If Temp 0 Then Showpic X, 0, 0. If Temp 1. 1 Then Showpic X, 0, Dp. Return. Intro bgf wifiradio. Play bgf play. Pause bgf pause. Stopp bgf stop. Volume bgf volume. Tuner bgf tuner. Clock bgf clock. Dp bgf dp. bgfStreep bgf streep. Tunerlist Data, 1. Network, KCEA, FM Tango Junin Argentina, TANGOCLUBTunerlist.