Hi all!
got back to my bootloader-check and it's working now:
Here' what I do:
mega1284p
$loadersize = 1024 (don't forget: this means 1024 words = 2048 bytes)
1) determin the start-address of the BL: start address = flash-size(in byte) - 2(BL-size(in words))
Example: flash-size: &H20000; BL-size: &H400; start-address = &H20000-2*&H400 = &H1F800
2)
Bootloader_check:
N = Cpeekh(&H1f800)
If N <> &HFF Then
Set Bootloader_present
Print #2 , "Bootloader vorhanden" ; Hex(n)
Else
Print #2 , "Warnung! BOOTLOADER IST NICHT GELADEN" ; Hex(n)
Reset Bootloader_present
End If
Here's what I did wrong before:
I used cpeek, that is only appliable on flashes with max 64K. A hint in the HELP would have been helpful...
CPEEKH will do the job. Be careful: I use 2.0.7.7, here the page is calculated by bascom. I past versions YOU must determin the correct page.
Thank you Mark for the new feature, I'm using Bascom for I do not want to bother about codepages...
↧