Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Bluetooth HC05 Bootloader.

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
maxneo

Bascom Member



Joined: 07 Sep 2010
Posts: 35

PostPosted: Sun Jan 24, 2016 11:05 am    Post subject: Bluetooth HC05 Bootloader. Reply with quote

Hello
I'm working on making a wireless bootloader. I've been hanging on a Attiny45 on a HC05 listening and when they hear 123 so resettar the processor to be programmed and it works. Now for my question I detect the beginning but how I detect the end of the programming broadcast MCH something or they are someone that something advice. You can use the bootloader as to put low on PB.3 when the boot sequence is complete but I do not. I do not want to use more pins than needed.
Thanks in advance Maxneo

The code i use

$regfile = "attiny45.dat"
$prog &HFF , &HD2 , &HDC , &HFF
$crystal = 8000000
$hwstack = 64
$swstack = 64
$framesize = 64
Dim Bstatus As Byte
Dim Bretries As Byte
Const On = 1
Const Off = 0
'Ddrb = &B00011001
Led Alias Portb.4 'fungerar inte
Res Alias Portb.3
Ok Alias Pinb.2
Config Pinb.2 = Input
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
Bretries = 10
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
Led = Off 'Reset Led
End If
nop
Loop
End

(BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.7.8 )
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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