My finished WiFi internet radio

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
velja
Posts: 4
Joined: Wed Aug 10, 2016 7:56 am

My finished WiFi internet radio

Postby velja » Thu Aug 25, 2016 2:23 am

So, after resolving some issues I finish my radio. Here is the link.


https://www.youtube.com/watch?v=EquU11orYT8


I use ASUS WL-520gU router and controll it with AVR MEGA8 MCU. Software is written in BASCOM AVR.

User avatar
mightyohm
Site Admin
Posts: 949
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: My finished WiFi internet radio

Postby mightyohm » Sat Aug 27, 2016 5:52 pm

Very nice work, thanks for sharing!

velja
Posts: 4
Joined: Wed Aug 10, 2016 7:56 am

Re: My finished WiFi internet radio

Postby velja » Tue Sep 06, 2016 12:48 am

Here is source :

'***************************************************************************
'
' Finished version. ATMEGA8, LCD 16x2
' 28 august 2016
'***************************************************************************

$regfile = "m8def.dat"
$crystal = 8000000
$baud = 9600
$hwstack = 64
$swstack = 64
$framesize = 64

Config Adc = Single , Prescaler = 8 , Reference = Avcc
Config Serialin = Buffered , Size = 128


Dim Adc_old As Word , Adc_new As Word , Adc_malo_old As Word , Adc_malo_new As Word
Dim Nm As String * 1
Dim Temp_buffer As String * 128
Dim Name_buffer As String * 40
Dim Title_buffer As String * 40
Dim Temp_str As String * 4
Dim Start_string1 As String * 14
Dim Start_string2 As String * 14
Dim C As Byte , I As Byte , Pointer As Byte , Duzina As Byte , Duzina_i As Byte , Duzina_t As Byte
Dim Name_pos As Byte , Title_pos As Byte , Visak As Byte , Visak_i As Byte , Visak_t As Byte , Visak_new As Byte
Dim Pos As Byte

Declare Sub Adc_read
Declare Sub Shift_lcd

Config Lcdpin = Pin , Rs = Portd.2 , E = Portd.4 , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3
Config Lcd = 16 * 2
Cls
Cursor Off

Enable Interrupts

Lcd " WI FI INTERNET "
Lowerline
Lcd " RADIO "

Wait 2

Cls
Lcd "Velja Cvetkovic "
Lowerline
Lcd " 2016 "
Wait 5

Cls
Lcd "Inicijalizacija "
Lowerline
Lcd " rutera... "
Wait 40


Adc_old = 10
Start Adc

Cls
Wait 2



'******** Start detection: "AVR Start!\n"
Temp_buffer = ""
Do
Do
If Ischarwaiting() = 1 Then
Nm = Inkey()
If Len(temp_buffer) < 13 Then Temp_buffer = Temp_buffer + Nm
If Len(temp_buffer) = 13 Then Temp_buffer = Temp_buffer + Chr(13)
End If
Loop Until Ischarwaiting() = 0

Pos = Instr(temp_buffer , "AVR Start" )
Loop Until Pos <> 0



Main:
Do

Gosub Adc_read
L1:
Gosub Citanje 'Reading
Gosub Ekstrakcija 'Extraction
Temp_buffer = ""
Gosub Shift_lcd


Loop


End






Ekstrakcija:
Name_buffer = ""
Title_buffer = ""
Name_pos = Instr(temp_buffer , "Name: " )
Title_pos = Instr(temp_buffer , "Title: ")

Name_pos = Name_pos + 6
Duzina = 0
Do
Incr Duzina
Pointer = Name_pos + Duzina
Temp_str = Mid(temp_buffer , Pointer , 1)
Loop Until Temp_str = Chr(13) Or Temp_str = ""
If Duzina > 40 Then Duzina = 40
Name_buffer = Mid(temp_buffer , Name_pos , Duzina)
Visak_i = Len(name_buffer)



Title_pos = Title_pos + 7
Duzina = 0
Do
Incr Duzina
Pointer = Title_pos + Duzina
Temp_str = Mid(temp_buffer , Pointer , 1)
Loop Until Temp_str = Chr(13) Or Temp_str = ""
If Duzina > 40 Then Duzina = 40
Title_buffer = Mid(temp_buffer , Title_pos , Duzina)
Visak_t = Len(title_buffer)

Return


Citanje:
Temp_buffer = ""
Do
If Ischarwaiting() = 1 Then
Nm = Inkey()

If Len(temp_buffer) < 127 Then Temp_buffer = Temp_buffer + Nm
If Len(temp_buffer) = 127 Then Temp_buffer = Temp_buffer + Chr(13)

End If

Loop Until Ischarwaiting() = 0
Return



Sub Adc_read:
Adc_new = Getadc(4)
Adc_malo_old = Adc_old / 10
Adc_malo_new = Adc_new / 10
If Adc_malo_new <> Adc_malo_old Then
Adc_old = Adc_new
Print "tuner: " ; Adc_new
End If
End Sub


'*** Shifting: If text is longer then 16 character scroll to the left and stop
' when last character of longer line was displayed


Sub Shift_lcd:
Dim A As Byte

If Visak_i > Visak_t Then
Visak = Visak_i
Else
Visak = Visak_t
End If


If Visak > 16 Then
Visak_new = Visak - 16
End If


Cls
Lcd Name_buffer
Lowerline
Lcd Title_buffer
Wait 1
Goto Double_check
Wait 1
Goto Double_check

If Visak > 16 Then
Goto Lcd_shift
End If



End Sub

Lcd_shift:
For A = 1 To Visak_new
Shiftlcd Left 'shift the text to the right
Waitms 250
Goto Double_check 'wait a moment
Next
Wait 1
Return

Double_check:

Adc_new = Getadc(4)
Adc_malo_new = Adc_new / 10
If Adc_malo_new <> Adc_malo_old Then
Adc_old = Adc_new
Print "tuner: " ; Adc_new
Goto L1
End If
Return


Return to “Wifi Radio Project / Hacking the Asus WL-520gU”

Who is online

Users browsing this forum: No registered users and 1 guest