Posted: Sun Jun 21, 2015 5:40 pm Post subject: Wireless transmission of programs.
Hi
I have been using blutooth along with a bootloader. To avoid having to use the code in program I use a ATTiny to sniff rx and detects when the 123 will come then puts attinyn a reset pulse and waits until PB3 goes low then then it starts listening efer 123 again. It works, but you can do it more smoothly? I using HC05 as a transmitter and the transmitter operates up to 10 m.
The program
'------------------------------------------------------------------------------
' Reset signal for MCS Bootloader
'------------------------------------------------------------------------------
$regfile = "attiny45.dat"
$prog &HFF , &HD2 , &HDC , &HFF
$crystal = 8000000
$hwstack = 64
$swstack = 64
$framesize = 64
Dim Bstatus As Byte
Const On = 1
Const Off = 0
'Ddrb = &B00011001
Led Alias Pinb.4 'fungerar inte
Res Alias Pinb.3
Ok Alias Pinb.2
Config Led = Output
Config Res = Output
Config Ok = Input
Res = On 'set Res
Led = Off 'Reset Led
Ok = On
Open "comb.1:38400,8,n,1" For Input As #2
'Open "comb.0:38400,8,n,1" For Output As #1
Do
Bstatus = Waitkey(#2) '{ did we received value 123 ?
If Bstatus = 123 Then
Led = On 'Set Led
Res = Off 'Reset Res
Waitms 5
Res = On
Bitwait Ok , Reset
Led = Off 'Reset Led
End If
nop
Loop
End
Maybe there's something smarter way to do this. But it works just fine.
Sincerely Maxneo
(BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.7.8 )
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum