Skip to content

Commit 9692625

Browse files
committed
Added more detail about the convertHexToByteArray.py module
1 parent 557840f commit 9692625

File tree

1 file changed

+54
-48
lines changed

1 file changed

+54
-48
lines changed

README.md

+54-48
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,34 @@ Written by Nick Gammon.
6060
Version 1.11
6161
Compiled on Nov 4 2014 at 11:10:33
6262
Entered programming mode OK.
63-
Signature = 1E 95 0F
63+
Signature = 1E 95 0F
6464
Processor = ATmega328P
6565
Flash memory size = 32768 bytes.
66-
LFuse = FF
67-
HFuse = DE
68-
EFuse = FD
69-
Lock byte = CF
70-
Clock calibration = 8D
66+
LFuse = FF
67+
HFuse = DE
68+
EFuse = FD
69+
Lock byte = CF
70+
Clock calibration = 8D
7171
Bootloader in use: Yes
7272
EEPROM preserved through erase: No
7373
Watchdog timer always on: No
7474
Bootloader is 512 bytes starting at 7E00
7575
7676
Bootloader:
7777
78-
7E00: 11 24 84 B7 14 BE 81 FF F0 D0 85 E0 80 93 81 00
79-
7E10: 82 E0 80 93 C0 00 88 E1 80 93 C1 00 86 E0 80 93
80-
...
81-
7FE0: 11 50 E9 F7 F2 DF 1F 91 08 95 80 E0 E8 DF EE 27
82-
7FF0: FF 27 09 94 FF FF FF FF FF FF FF FF FF FF 04 04
78+
7E00: 11 24 84 B7 14 BE 81 FF F0 D0 85 E0 80 93 81 00
79+
7E10: 82 E0 80 93 C0 00 88 E1 80 93 C1 00 86 E0 80 93
80+
...
81+
7FE0: 11 50 E9 F7 F2 DF 1F 91 08 95 80 E0 E8 DF EE 27
82+
7FF0: FF 27 09 94 FF FF FF FF FF FF FF FF FF FF 04 04
8383
84-
MD5 sum of bootloader = FB F4 9B 7B 59 73 7F 65 E8 D0 F8 A5 08 12 E7 9F
84+
MD5 sum of bootloader = FB F4 9B 7B 59 73 7F 65 E8 D0 F8 A5 08 12 E7 9F
8585
Bootloader name: optiboot_atmega328
8686
8787
First 256 bytes of program memory:
8888
89-
0: 0C 94 52 05 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05
90-
10: 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05
89+
0: 0C 94 52 05 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05
90+
10: 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05 0C 94 7A 05
9191
...
9292
```
9393

@@ -124,9 +124,9 @@ Example of use:
124124
125125
Signature detector.
126126
Written by Nick Gammon.
127-
Signature = 1E 95 0F
127+
Signature = 1E 95 0F
128128
Fuses
129-
Low = FF High = D6 Ext = FD Lock = CF
129+
Low = FF High = D6 Ext = FD Lock = CF
130130
131131
Processor = ATmega328P
132132
Flash memory size = 32768
@@ -174,14 +174,14 @@ Written by Nick Gammon.
174174
Version 1.25
175175
Compiled on Nov 4 2014 at 07:33:18
176176
Entered programming mode OK.
177-
Signature = 0x1E 0x95 0x0F
177+
Signature = 0x1E 0x95 0x0F
178178
Processor = ATmega328P
179179
Flash memory size = 32768 bytes.
180-
LFuse = 0xFF
181-
HFuse = 0xDE
182-
EFuse = 0xFD
183-
Lock byte = 0xCF
184-
Clock calibration = 0x8D
180+
LFuse = 0xFF
181+
HFuse = 0xDE
182+
EFuse = 0xFD
183+
Lock byte = 0xCF
184+
Clock calibration = 0x8D
185185
Bootloader address = 0x7E00
186186
Bootloader length = 512 bytes.
187187
Type 'L' to use Lilypad (8 MHz) loader, or 'U' for Uno (16 MHz) loader ...
@@ -210,14 +210,14 @@ Example of use:
210210
```
211211
Attempting to enter programming mode ...
212212
Entered programming mode OK.
213-
Signature = 0x1E 0x95 0x0F
213+
Signature = 0x1E 0x95 0x0F
214214
Processor = ATmega328P
215215
Flash memory size = 32768 bytes.
216-
LFuse = 0xFF
217-
HFuse = 0xDE
218-
EFuse = 0xFD
219-
Lock byte = 0xCF
220-
Clock calibration = 0x8D
216+
LFuse = 0xFF
217+
HFuse = 0xDE
218+
EFuse = 0xFD
219+
Lock byte = 0xCF
220+
Clock calibration = 0x8D
221221
Actions:
222222
[E] erase flash
223223
[F] modify fuses
@@ -234,12 +234,12 @@ Wiring for the Atmega\_Hex\_Uploader sketch:
234234
```
235235
Arduino SD Card
236236
--------------------------------
237-
SS CS (chip select)
238-
MOSI DI (data in)
239-
MISO DO (data out)
240-
SCK CLK (clock)
241-
+5V 5V
242-
Gnd Gnd
237+
SS CS (chip select)
238+
MOSI DI (data in)
239+
MISO DO (data out)
240+
SCK CLK (clock)
241+
+5V 5V
242+
Gnd Gnd
243243
244244
Arduino Target chip/board
245245
-------------------------------------
@@ -248,8 +248,8 @@ D7 MOSI
248248
D4 SCK
249249
D5 Reset
250250
D9 Clock of target (if required)
251-
+5V 5V
252-
Gnd Gnd
251+
+5V 5V
252+
Gnd Gnd
253253
```
254254

255255
This sketch uses "bit banged" SPI for programming the target chip, which is why it uses pins D4, D5, D6, D7 instead of the hardware SPI pins.
@@ -271,12 +271,12 @@ Wiring for the Atmega\_Hex\_Uploader\_Fixed\_Filename sketch:
271271
```
272272
Arduino SD Card
273273
--------------------------------
274-
SS CS (chip select)
275-
MOSI DI (data in)
276-
MISO DO (data out)
277-
SCK CLK (clock)
278-
+5V 5V
279-
Gnd Gnd
274+
SS CS (chip select)
275+
MOSI DI (data in)
276+
MISO DO (data out)
277+
SCK CLK (clock)
278+
+5V 5V
279+
Gnd Gnd
280280
281281
Arduino Target chip/board
282282
-------------------------------------
@@ -285,13 +285,13 @@ D7 MOSI
285285
D4 SCK
286286
D5 Reset
287287
D9 Clock of target (if required)
288-
+5V 5V
289-
Gnd Gnd
288+
+5V 5V
289+
Gnd Gnd
290290
291291
Arduino Switch and LEDs
292292
--------------------------------
293-
D2 Start-programming switch (normally open, other end to Gnd)
294-
A0 Error LED (red)
293+
D2 Start-programming switch (normally open, other end to Gnd)
294+
A0 Error LED (red)
295295
A1 Ready LED (green)
296296
A2 Working LED (yellow)
297297
```
@@ -365,8 +365,14 @@ convertHexToByteArray.py
365365
------------------------
366366

367367
The `convertHexToByteArray.py` tool allows you to easily convert `.hex` files
368-
into a c array that you can use inside the tools above. Its an alternative to
369-
the lua script and easier to setup in most cases.
368+
into a C array that you can use inside the Atmega\_Board\_Programmer code. It's an alternative to
369+
the Lua script and easier to setup in most cases.
370370

371371
To run the script you need `python2` and the `intelhex` python library which can
372372
be downloaded [here](https://github.com/bialix/intelhex) or via `pip`.
373+
374+
Example of use:
375+
376+
```
377+
python convertHexToByteArray.py ATmegaBOOT_168_atmega328_pro_8MHz.hex > bootloader_lilypad328.h
378+
```

0 commit comments

Comments
 (0)