CRC calculation

This commit is contained in:
Alexey 'Cluster' Avdyukhin
2017-08-20 18:43:59 +03:00
parent bf286bcdcd
commit 0a582653b2
31 changed files with 17201 additions and 17156 deletions

View File

@ -2,7 +2,7 @@
#HFUSE = DD
MCU_PROGRAMMER = m64
PROGRAMMER_TYPE ?= avr109
PROGRAMMER_PORT ?= com14
PROGRAMMER_PORT ?= com6
PRG = famicom-dumper
OBJ = dumper.o usart.o comm.o jtag.o

142
README.md
View File

@ -1,71 +1,71 @@
# Famicom Dumper/Programmer
## Overview
This is simple dumper/programmer for Famicom cartridges.
![Dumper](images/dumper.jpg)
You can use it to:
* Dump cartridges, so you can play copy of your cartridge on emulator
* Read/write battery backed saves, so you can continue your saved game on emulator/console
* Write spetial cartridges like [COOLGIRL](https://github.com/ClusterM/coolgirl-famicom-multicard)
* Rewrite ultracheap chinese COOLBOY cartridges. Soldering required but it's very simple.
* Test your cartridges
* Some reverse engineering
* Anything else that requires Famicom bus simulation
## Schematics and parts list
![Schematics](schematics/famicom_dumper.png)
You need:
* ATMEGA64
* FT232RL
* 60-pin edge socket
* Printed circuit board, you can order one using files it "board" or "board2" folders.
* Some capacitors
* Maybe some leds
That's all!
## How to compile firmware
All you need is [WinAVR](http://winavr.sourceforge.net/). Just type "make hex" in command line to compile firmware or bootloader.
## How to build it
You need to flash ATMEGA64 microcontroll using any AVR programmer. It's recommended to program bootloader first, so you can flash/update firmware via USB. I'm using bootloader by Martin Thomas, you can use already configured one in bootloader folder. There are fuses for it:
* LFUSE = E4
* HFUSE = DC
* EFUSE = FF
You can program it using command like "**make program PROGRAMMER_TYPE=avrisp2 PROGRAMMER_PORT=usb**" from *bootloader* folder. Don't forget to replace *avrisp2* and *usb* with you programmer type and port.
Connect device to USB and PC will detect it as virtual serial port. First 8 seconds after power up bootloader is active (all leds are on), so you can program main firmware.
You can use command "**make program PROGRAMMER_PORT=COM10**" to program main firmware. Replace *COM10* with port assigned to your dumper (you can use Windows device manager to see it).
Also it's recommended to reprogram FT232 chip using [FT_PROG util](http://www.ftdichip.com/Support/Utilities.htm#FT_PROG) to change device name to "Famicom Dumper/Programmer", so it can be detected automatically by software.
That's all! You can use it now.
## How to use it
Now you need PC-side client to use it: https://github.com/ClusterM/famicom-dumper-client
## How to rewrite COOLBOY cartridges
There are ultracheap chinese COOLBOY cartridges like "400 in 1" or "198 in 1". You can buy them on eBay or Aliexpress. And yes, there is flash memory, so you can rewrite it.
But you need to unsolder pins /OE and /WE and connect them to TCK and TDO pins on JTAG connector:
![COOLBOY](images/coolboy.jpg)
Don't forget to solder pins back before using cartridge.
# Famicom Dumper/Programmer
## Overview
This is simple dumper/programmer for Famicom cartridges.
![Dumper](images/dumper.jpg)
You can use it to:
* Dump cartridges, so you can play copy of your cartridge on emulator
* Read/write battery backed saves, so you can continue your saved game on emulator/console
* Write spetial cartridges like [COOLGIRL](https://github.com/ClusterM/coolgirl-famicom-multicard)
* Rewrite ultracheap chinese COOLBOY cartridges. Soldering required but it's very simple.
* Test your cartridges
* Some reverse engineering
* Anything else that requires Famicom bus simulation
## Schematics and parts list
![Schematics](schematics/famicom_dumper.png)
You need:
* ATMEGA64
* FT232RL
* 60-pin edge socket
* Printed circuit board, you can order one using files it "board" or "board2" folders.
* Some capacitors
* Maybe some leds
That's all!
## How to compile firmware
All you need is [WinAVR](http://winavr.sourceforge.net/). Just type "make hex" in command line to compile firmware or bootloader.
## How to build it
You need to flash ATMEGA64 microcontroll using any AVR programmer. It's recommended to program bootloader first, so you can flash/update firmware via USB. I'm using bootloader by Martin Thomas, you can use already configured one in bootloader folder. There are fuses for it:
* LFUSE = E4
* HFUSE = DC
* EFUSE = FF
You can program it using command like "**make program PROGRAMMER_TYPE=avrisp2 PROGRAMMER_PORT=usb**" from *bootloader* folder. Don't forget to replace *avrisp2* and *usb* with you programmer type and port.
Connect device to USB and PC will detect it as virtual serial port. First 8 seconds after power up bootloader is active (all leds are on), so you can program main firmware.
You can use command "**make program PROGRAMMER_PORT=COM10**" to program main firmware. Replace *COM10* with port assigned to your dumper (you can use Windows device manager to see it).
Also it's recommended to reprogram FT232 chip using [FT_PROG util](http://www.ftdichip.com/Support/Utilities.htm#FT_PROG) to change device name to "Famicom Dumper/Programmer", so it can be detected automatically by software.
That's all! You can use it now.
## How to use it
Now you need PC-side client to use it: https://github.com/ClusterM/famicom-dumper-client
## How to rewrite COOLBOY cartridges
There are ultracheap chinese COOLBOY cartridges like "400 in 1" or "198 in 1". You can buy them on eBay or Aliexpress. And yes, there is flash memory, so you can rewrite it.
But you need to unsolder pins /OE and /WE and connect them to TCK and TDO pins on JTAG connector:
![COOLBOY](images/coolboy.jpg)
Don't forget to solder pins back before using cartridge.

View File

@ -1,239 +1,239 @@
; Drill file
; Format: 2.4 (00.0000)
M48
INCH
T01C0.0118
T02C0.0283
T03C0.0394
T04C0.0433
T05C0.0472
T06C0.1181
%
G05
G90
T01
X000830Y-020440
X000830Y-018440
X002830Y-018440
X004830Y-018440
X004830Y-020440
X002830Y-020440
X010210Y-015270
X011220Y-015590
X012220Y-015900
X013190Y-016220
X013040Y-017070
X014200Y-016530
X015190Y-016860
X016190Y-017200
X016500Y-018010
X017200Y-017490
X018200Y-017800
X018150Y-018890
X020180Y-018100
X021160Y-018440
X021460Y-019900
X023460Y-019900
X025460Y-019900
X027460Y-019900
X029460Y-019900
X031460Y-019900
X033460Y-019900
X035460Y-019900
X028160Y-017200
X027160Y-016860
X026170Y-016530
X025160Y-016220
X024190Y-015900
X023180Y-015590
X022180Y-015270
X023170Y-009770
X022600Y-007960
X021440Y-007250
X021120Y-006930
X020810Y-006620
X020490Y-006300
X020180Y-005990
X019860Y-005670
X019550Y-005360
X019230Y-005040
X019550Y-003470
X020180Y-002630
X020490Y-001260
X019900Y-000330
X022060Y-001840
X023460Y-001840
X024550Y-002480
X025790Y-002500
X026420Y-002200
X027050Y-002200
X027780Y-001900
X028410Y-000330
X029780Y-001900
X027050Y-004410
X026420Y-003780
X025220Y-003850
X025160Y-004410
X023960Y-004730
X023640Y-004410
X023330Y-004100
X023010Y-003780
X022740Y-000330
X025570Y-000330
X031460Y-005270
X033460Y-007270
X035460Y-007270
X035460Y-005270
X037240Y-002500
X035460Y-001270
X033460Y-001270
X028600Y-007960
X026600Y-007960
X024600Y-007960
X028780Y-010270
X029620Y-011170
X036800Y-011250
X036800Y-009270
X020170Y-009770
X019230Y-008920
X018920Y-009300
X018600Y-009660
X018280Y-009280
X017970Y-009670
X017660Y-009280
X016670Y-009280
X016670Y-009770
X016670Y-010250
X016670Y-010720
X016670Y-011190
X016670Y-011660
X016670Y-008510
X015710Y-008060
X014700Y-008060
X013710Y-008070
X012730Y-008060
X011690Y-008060
X010690Y-008060
X009700Y-008060
X009170Y-007260
X008510Y-008080
X006700Y-007630
X005030Y-007640
X003440Y-009210
X002240Y-010800
X001460Y-007270
X001460Y-005270
X001460Y-003270
X001460Y-001270
X003460Y-001270
X005460Y-001270
X005460Y-003270
X003460Y-003270
X003460Y-005270
X007120Y-005540
X008790Y-005530
X010600Y-005960
X011190Y-006630
X012170Y-006330
X013200Y-005990
X014170Y-005700
X014590Y-005350
X015140Y-005040
X013600Y-004960
X013640Y-003060
X012170Y-003060
X011300Y-002260
X011300Y-001590
X010690Y-003060
X011220Y-003800
X009880Y-003620
X010190Y-006940
X015030Y-002260
X015030Y-001590
X017180Y-002630
X016860Y-004310
X014610Y-018010
T02
X033880Y-006620
X033880Y-005640
T03
X035920Y-003260
X035920Y-001530
T04
X006070Y-019430
X007070Y-019430
X008070Y-019430
X009070Y-019430
X009070Y-018430
X008070Y-018430
X007070Y-018430
X006070Y-018430
X010070Y-018430
X010070Y-019430
T05
X004180Y-014440
X005180Y-014440
X006180Y-014440
X007180Y-014440
X008180Y-014440
X009180Y-014440
X010180Y-014440
X011180Y-014440
X012180Y-014440
X013180Y-014440
X014180Y-014440
X015180Y-014440
X016180Y-014440
X017180Y-014440
X018180Y-014440
X019180Y-014440
X020180Y-014440
X021180Y-014440
X022180Y-014440
X023180Y-014440
X024180Y-014440
X025180Y-014440
X026180Y-014440
X027180Y-014440
X028180Y-014440
X029180Y-014440
X030180Y-014440
X031180Y-014440
X032180Y-014440
X033180Y-014440
X033180Y-012440
X032180Y-012440
X031180Y-012440
X030180Y-012440
X029180Y-012440
X028180Y-012440
X027180Y-012440
X026180Y-012440
X025180Y-012440
X024180Y-012440
X023180Y-012440
X022180Y-012440
X021180Y-012440
X020180Y-012440
X019180Y-012440
X018180Y-012440
X017180Y-012440
X016180Y-012440
X015180Y-012440
X014180Y-012440
X013180Y-012440
X012180Y-012440
X011180Y-012440
X010180Y-012440
X009180Y-012440
X008180Y-012440
X007180Y-012440
X006180Y-012440
X005180Y-012440
X004180Y-012440
T06
X001260Y-019530
X001260Y-006300
X036220Y-006300
X036220Y-019530
M30
; Drill file
; Format: 2.4 (00.0000)
M48
INCH
T01C0.0118
T02C0.0283
T03C0.0394
T04C0.0433
T05C0.0472
T06C0.1181
%
G05
G90
T01
X000830Y-020440
X000830Y-018440
X002830Y-018440
X004830Y-018440
X004830Y-020440
X002830Y-020440
X010210Y-015270
X011220Y-015590
X012220Y-015900
X013190Y-016220
X013040Y-017070
X014200Y-016530
X015190Y-016860
X016190Y-017200
X016500Y-018010
X017200Y-017490
X018200Y-017800
X018150Y-018890
X020180Y-018100
X021160Y-018440
X021460Y-019900
X023460Y-019900
X025460Y-019900
X027460Y-019900
X029460Y-019900
X031460Y-019900
X033460Y-019900
X035460Y-019900
X028160Y-017200
X027160Y-016860
X026170Y-016530
X025160Y-016220
X024190Y-015900
X023180Y-015590
X022180Y-015270
X023170Y-009770
X022600Y-007960
X021440Y-007250
X021120Y-006930
X020810Y-006620
X020490Y-006300
X020180Y-005990
X019860Y-005670
X019550Y-005360
X019230Y-005040
X019550Y-003470
X020180Y-002630
X020490Y-001260
X019900Y-000330
X022060Y-001840
X023460Y-001840
X024550Y-002480
X025790Y-002500
X026420Y-002200
X027050Y-002200
X027780Y-001900
X028410Y-000330
X029780Y-001900
X027050Y-004410
X026420Y-003780
X025220Y-003850
X025160Y-004410
X023960Y-004730
X023640Y-004410
X023330Y-004100
X023010Y-003780
X022740Y-000330
X025570Y-000330
X031460Y-005270
X033460Y-007270
X035460Y-007270
X035460Y-005270
X037240Y-002500
X035460Y-001270
X033460Y-001270
X028600Y-007960
X026600Y-007960
X024600Y-007960
X028780Y-010270
X029620Y-011170
X036800Y-011250
X036800Y-009270
X020170Y-009770
X019230Y-008920
X018920Y-009300
X018600Y-009660
X018280Y-009280
X017970Y-009670
X017660Y-009280
X016670Y-009280
X016670Y-009770
X016670Y-010250
X016670Y-010720
X016670Y-011190
X016670Y-011660
X016670Y-008510
X015710Y-008060
X014700Y-008060
X013710Y-008070
X012730Y-008060
X011690Y-008060
X010690Y-008060
X009700Y-008060
X009170Y-007260
X008510Y-008080
X006700Y-007630
X005030Y-007640
X003440Y-009210
X002240Y-010800
X001460Y-007270
X001460Y-005270
X001460Y-003270
X001460Y-001270
X003460Y-001270
X005460Y-001270
X005460Y-003270
X003460Y-003270
X003460Y-005270
X007120Y-005540
X008790Y-005530
X010600Y-005960
X011190Y-006630
X012170Y-006330
X013200Y-005990
X014170Y-005700
X014590Y-005350
X015140Y-005040
X013600Y-004960
X013640Y-003060
X012170Y-003060
X011300Y-002260
X011300Y-001590
X010690Y-003060
X011220Y-003800
X009880Y-003620
X010190Y-006940
X015030Y-002260
X015030Y-001590
X017180Y-002630
X016860Y-004310
X014610Y-018010
T02
X033880Y-006620
X033880Y-005640
T03
X035920Y-003260
X035920Y-001530
T04
X006070Y-019430
X007070Y-019430
X008070Y-019430
X009070Y-019430
X009070Y-018430
X008070Y-018430
X007070Y-018430
X006070Y-018430
X010070Y-018430
X010070Y-019430
T05
X004180Y-014440
X005180Y-014440
X006180Y-014440
X007180Y-014440
X008180Y-014440
X009180Y-014440
X010180Y-014440
X011180Y-014440
X012180Y-014440
X013180Y-014440
X014180Y-014440
X015180Y-014440
X016180Y-014440
X017180Y-014440
X018180Y-014440
X019180Y-014440
X020180Y-014440
X021180Y-014440
X022180Y-014440
X023180Y-014440
X024180Y-014440
X025180Y-014440
X026180Y-014440
X027180Y-014440
X028180Y-014440
X029180Y-014440
X030180Y-014440
X031180Y-014440
X032180Y-014440
X033180Y-014440
X033180Y-012440
X032180Y-012440
X031180Y-012440
X030180Y-012440
X029180Y-012440
X028180Y-012440
X027180Y-012440
X026180Y-012440
X025180Y-012440
X024180Y-012440
X023180Y-012440
X022180Y-012440
X021180Y-012440
X020180Y-012440
X019180Y-012440
X018180Y-012440
X017180Y-012440
X016180Y-012440
X015180Y-012440
X014180Y-012440
X013180Y-012440
X012180Y-012440
X011180Y-012440
X010180Y-012440
X009180Y-012440
X008180Y-012440
X007180Y-012440
X006180Y-012440
X005180Y-012440
X004180Y-012440
T06
X001260Y-019530
X001260Y-006300
X036220Y-006300
X036220Y-019530
M30

View File

@ -1,56 +1,56 @@
%FSLAX34Y34*%
%MOMM*%
%LNCOPPER_TOP*%
G71*
G01*
%ADD10C, 0.00*%
%ADD11R, 1.10X2.10*%
%ADD12R, 0.30X1.30*%
%ADD13C, 0.40*%
%ADD14C, 1.10*%
%ADD15C, 1.20*%
%ADD16C, 0.30*%
%ADD17R, 2.50X2.00*%
%ADD18R, 2.30X0.40*%
%ADD19R, 3.10X1.20*%
%ADD20C, 1.80*%
%ADD21C, 0.80*%
%ADD22R, 2.20X1.80*%
%ADD23R, 1.60X2.00*%
%ADD24C, 1.00*%
%ADD25R, 1.50X0.40*%
%ADD26C, 6.10*%
%ADD27C, 1.50*%
%ADD28C, 2.50*%
%ADD29R, 1.20X2.30*%
%ADD30R, 2.30X1.20*%
%ADD31R, 3.20X4.30*%
%ADD32C, 2.80*%
%ADD33C, 7.70*%
%ADD34C, 1.80*%
%ADD35C, 1.60*%
%ADD36C, 4.70*%
%ADD37C, 1.40*%
%ADD38C, 2.40*%
%ADD39C, 3.00*%
%ADD40C, 2.20*%
%ADD41C, 4.40*%
%ADD42R, 2.00X1.60*%
%ADD43C, 0.70*%
%ADD44C, 0.20*%
%ADD45C, 3.00*%
%ADD46C, 1.64*%
%ADD47C, 2.44*%
%ADD48C, 1.50*%
%ADD49R, 1.20X0.80*%
%ADD50R, 0.80X1.20*%
%ADD51C, 2.10*%
%ADD52R, 0.40X1.50*%
%ADD53C, 0.50*%
%LPD*%
G54D10*
X0Y0D02*
X950000Y0D01*
X950000Y-530000D01*
X0Y-530000D01*
X0Y0D01*
%FSLAX34Y34*%
%MOMM*%
%LNCOPPER_TOP*%
G71*
G01*
%ADD10C, 0.00*%
%ADD11R, 1.10X2.10*%
%ADD12R, 0.30X1.30*%
%ADD13C, 0.40*%
%ADD14C, 1.10*%
%ADD15C, 1.20*%
%ADD16C, 0.30*%
%ADD17R, 2.50X2.00*%
%ADD18R, 2.30X0.40*%
%ADD19R, 3.10X1.20*%
%ADD20C, 1.80*%
%ADD21C, 0.80*%
%ADD22R, 2.20X1.80*%
%ADD23R, 1.60X2.00*%
%ADD24C, 1.00*%
%ADD25R, 1.50X0.40*%
%ADD26C, 6.10*%
%ADD27C, 1.50*%
%ADD28C, 2.50*%
%ADD29R, 1.20X2.30*%
%ADD30R, 2.30X1.20*%
%ADD31R, 3.20X4.30*%
%ADD32C, 2.80*%
%ADD33C, 7.70*%
%ADD34C, 1.80*%
%ADD35C, 1.60*%
%ADD36C, 4.70*%
%ADD37C, 1.40*%
%ADD38C, 2.40*%
%ADD39C, 3.00*%
%ADD40C, 2.20*%
%ADD41C, 4.40*%
%ADD42R, 2.00X1.60*%
%ADD43C, 0.70*%
%ADD44C, 0.20*%
%ADD45C, 3.00*%
%ADD46C, 1.64*%
%ADD47C, 2.44*%
%ADD48C, 1.50*%
%ADD49R, 1.20X0.80*%
%ADD50R, 0.80X1.20*%
%ADD51C, 2.10*%
%ADD52R, 0.40X1.50*%
%ADD53C, 0.50*%
%LPD*%
G54D10*
X0Y0D02*
X950000Y0D01*
X950000Y-530000D01*
X0Y-530000D01*
X0Y0D01*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,272 +1,272 @@
%FSLAX34Y34*%
%MOMM*%
%LNSOLDERMASK_BOTTOM*%
G71*
G01*
%ADD10C, 0.00*%
%ADD11C, 2.70*%
%ADD12C, 2.24*%
%LPD*%
G54D10*
X0Y0D02*
X950000Y0D01*
X950000Y-530000D01*
X0Y-530000D01*
X0Y0D01*
X842848Y-366888D02*
G54D11*
D03*
X817448Y-366888D02*
G54D11*
D03*
X792048Y-366888D02*
G54D11*
D03*
X766648Y-366888D02*
G54D11*
D03*
X741248Y-366888D02*
G54D11*
D03*
X715848Y-366888D02*
G54D11*
D03*
X690448Y-366888D02*
G54D11*
D03*
X665048Y-366888D02*
G54D11*
D03*
X639648Y-366888D02*
G54D11*
D03*
X614248Y-366888D02*
G54D11*
D03*
X588848Y-366888D02*
G54D11*
D03*
X563448Y-366888D02*
G54D11*
D03*
X538048Y-366888D02*
G54D11*
D03*
X512648Y-366888D02*
G54D11*
D03*
X487248Y-366888D02*
G54D11*
D03*
X461848Y-366888D02*
G54D11*
D03*
X436448Y-366888D02*
G54D11*
D03*
X411048Y-366888D02*
G54D11*
D03*
X385648Y-366888D02*
G54D11*
D03*
X360248Y-366888D02*
G54D11*
D03*
X334848Y-366888D02*
G54D11*
D03*
X309448Y-366888D02*
G54D11*
D03*
X284048Y-366888D02*
G54D11*
D03*
X258648Y-366888D02*
G54D11*
D03*
X233248Y-366888D02*
G54D11*
D03*
X207848Y-366888D02*
G54D11*
D03*
X182448Y-366888D02*
G54D11*
D03*
X157047Y-366888D02*
G54D11*
D03*
X131647Y-366888D02*
G54D11*
D03*
X106247Y-366888D02*
G54D11*
D03*
X842848Y-316089D02*
G54D11*
D03*
X817448Y-316089D02*
G54D11*
D03*
X792048Y-316089D02*
G54D11*
D03*
X766648Y-316089D02*
G54D11*
D03*
X741248Y-316089D02*
G54D11*
D03*
X715848Y-316089D02*
G54D11*
D03*
X690448Y-316089D02*
G54D11*
D03*
X665048Y-316089D02*
G54D11*
D03*
X639648Y-316089D02*
G54D11*
D03*
X614248Y-316089D02*
G54D11*
D03*
X588848Y-316089D02*
G54D11*
D03*
X563448Y-316089D02*
G54D11*
D03*
X538048Y-316089D02*
G54D11*
D03*
X512648Y-316089D02*
G54D11*
D03*
X436448Y-316089D02*
G54D11*
D03*
X411048Y-316089D02*
G54D11*
D03*
X385648Y-316089D02*
G54D11*
D03*
X360248Y-316089D02*
G54D11*
D03*
X334848Y-316089D02*
G54D11*
D03*
X309448Y-316089D02*
G54D11*
D03*
X284048Y-316089D02*
G54D11*
D03*
X258648Y-316089D02*
G54D11*
D03*
X233248Y-316089D02*
G54D11*
D03*
X207848Y-316089D02*
G54D11*
D03*
X182448Y-316089D02*
G54D11*
D03*
X157047Y-316089D02*
G54D11*
D03*
X131647Y-316089D02*
G54D11*
D03*
X106247Y-316089D02*
G54D11*
D03*
X461848Y-316088D02*
G54D11*
D03*
X487248Y-316088D02*
G54D11*
D03*
G36*
X217900Y-505900D02*
X217900Y-480900D01*
X242900Y-480900D01*
X242900Y-505900D01*
X217900Y-505900D01*
G37*
G36*
X192500Y-505900D02*
X192500Y-480900D01*
X217500Y-480900D01*
X217500Y-505900D01*
X192500Y-505900D01*
G37*
G36*
X167100Y-505900D02*
X167100Y-480900D01*
X192100Y-480900D01*
X192100Y-505900D01*
X167100Y-505900D01*
G37*
G36*
X167100Y-480500D02*
X167100Y-455500D01*
X192100Y-455500D01*
X192100Y-480500D01*
X167100Y-480500D01*
G37*
G36*
X192500Y-480500D02*
X192500Y-455500D01*
X217500Y-455500D01*
X217500Y-480500D01*
X192500Y-480500D01*
G37*
G36*
X217900Y-480500D02*
X217900Y-455500D01*
X242900Y-455500D01*
X242900Y-480500D01*
X217900Y-480500D01*
G37*
G36*
X243300Y-505900D02*
X243300Y-480900D01*
X268300Y-480900D01*
X268300Y-505900D01*
X243300Y-505900D01*
G37*
G36*
X243300Y-480500D02*
X243300Y-455500D01*
X268300Y-455500D01*
X268300Y-480500D01*
X243300Y-480500D01*
G37*
G36*
X141700Y-505900D02*
X141700Y-480900D01*
X166700Y-480900D01*
X166700Y-505900D01*
X141700Y-505900D01*
G37*
G36*
X141700Y-480500D02*
X141700Y-455500D01*
X166700Y-455500D01*
X166700Y-480500D01*
X141700Y-480500D01*
G37*
X860630Y-168070D02*
G54D12*
D03*
X860630Y-143170D02*
G54D12*
D03*
M02*
%FSLAX34Y34*%
%MOMM*%
%LNSOLDERMASK_BOTTOM*%
G71*
G01*
%ADD10C, 0.00*%
%ADD11C, 2.70*%
%ADD12C, 2.24*%
%LPD*%
G54D10*
X0Y0D02*
X950000Y0D01*
X950000Y-530000D01*
X0Y-530000D01*
X0Y0D01*
X842848Y-366888D02*
G54D11*
D03*
X817448Y-366888D02*
G54D11*
D03*
X792048Y-366888D02*
G54D11*
D03*
X766648Y-366888D02*
G54D11*
D03*
X741248Y-366888D02*
G54D11*
D03*
X715848Y-366888D02*
G54D11*
D03*
X690448Y-366888D02*
G54D11*
D03*
X665048Y-366888D02*
G54D11*
D03*
X639648Y-366888D02*
G54D11*
D03*
X614248Y-366888D02*
G54D11*
D03*
X588848Y-366888D02*
G54D11*
D03*
X563448Y-366888D02*
G54D11*
D03*
X538048Y-366888D02*
G54D11*
D03*
X512648Y-366888D02*
G54D11*
D03*
X487248Y-366888D02*
G54D11*
D03*
X461848Y-366888D02*
G54D11*
D03*
X436448Y-366888D02*
G54D11*
D03*
X411048Y-366888D02*
G54D11*
D03*
X385648Y-366888D02*
G54D11*
D03*
X360248Y-366888D02*
G54D11*
D03*
X334848Y-366888D02*
G54D11*
D03*
X309448Y-366888D02*
G54D11*
D03*
X284048Y-366888D02*
G54D11*
D03*
X258648Y-366888D02*
G54D11*
D03*
X233248Y-366888D02*
G54D11*
D03*
X207848Y-366888D02*
G54D11*
D03*
X182448Y-366888D02*
G54D11*
D03*
X157047Y-366888D02*
G54D11*
D03*
X131647Y-366888D02*
G54D11*
D03*
X106247Y-366888D02*
G54D11*
D03*
X842848Y-316089D02*
G54D11*
D03*
X817448Y-316089D02*
G54D11*
D03*
X792048Y-316089D02*
G54D11*
D03*
X766648Y-316089D02*
G54D11*
D03*
X741248Y-316089D02*
G54D11*
D03*
X715848Y-316089D02*
G54D11*
D03*
X690448Y-316089D02*
G54D11*
D03*
X665048Y-316089D02*
G54D11*
D03*
X639648Y-316089D02*
G54D11*
D03*
X614248Y-316089D02*
G54D11*
D03*
X588848Y-316089D02*
G54D11*
D03*
X563448Y-316089D02*
G54D11*
D03*
X538048Y-316089D02*
G54D11*
D03*
X512648Y-316089D02*
G54D11*
D03*
X436448Y-316089D02*
G54D11*
D03*
X411048Y-316089D02*
G54D11*
D03*
X385648Y-316089D02*
G54D11*
D03*
X360248Y-316089D02*
G54D11*
D03*
X334848Y-316089D02*
G54D11*
D03*
X309448Y-316089D02*
G54D11*
D03*
X284048Y-316089D02*
G54D11*
D03*
X258648Y-316089D02*
G54D11*
D03*
X233248Y-316089D02*
G54D11*
D03*
X207848Y-316089D02*
G54D11*
D03*
X182448Y-316089D02*
G54D11*
D03*
X157047Y-316089D02*
G54D11*
D03*
X131647Y-316089D02*
G54D11*
D03*
X106247Y-316089D02*
G54D11*
D03*
X461848Y-316088D02*
G54D11*
D03*
X487248Y-316088D02*
G54D11*
D03*
G36*
X217900Y-505900D02*
X217900Y-480900D01*
X242900Y-480900D01*
X242900Y-505900D01*
X217900Y-505900D01*
G37*
G36*
X192500Y-505900D02*
X192500Y-480900D01*
X217500Y-480900D01*
X217500Y-505900D01*
X192500Y-505900D01*
G37*
G36*
X167100Y-505900D02*
X167100Y-480900D01*
X192100Y-480900D01*
X192100Y-505900D01*
X167100Y-505900D01*
G37*
G36*
X167100Y-480500D02*
X167100Y-455500D01*
X192100Y-455500D01*
X192100Y-480500D01*
X167100Y-480500D01*
G37*
G36*
X192500Y-480500D02*
X192500Y-455500D01*
X217500Y-455500D01*
X217500Y-480500D01*
X192500Y-480500D01*
G37*
G36*
X217900Y-480500D02*
X217900Y-455500D01*
X242900Y-455500D01*
X242900Y-480500D01*
X217900Y-480500D01*
G37*
G36*
X243300Y-505900D02*
X243300Y-480900D01*
X268300Y-480900D01*
X268300Y-505900D01*
X243300Y-505900D01*
G37*
G36*
X243300Y-480500D02*
X243300Y-455500D01*
X268300Y-455500D01*
X268300Y-480500D01*
X243300Y-480500D01*
G37*
G36*
X141700Y-505900D02*
X141700Y-480900D01*
X166700Y-480900D01*
X166700Y-505900D01*
X141700Y-505900D01*
G37*
G36*
X141700Y-480500D02*
X141700Y-455500D01*
X166700Y-455500D01*
X166700Y-480500D01*
X141700Y-480500D01*
G37*
X860630Y-168070D02*
G54D12*
D03*
X860630Y-143170D02*
G54D12*
D03*
M02*

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
G04 DipTrace 2.4.0.2*
%INBoardOutline.gbr*%
%MOIN*%
%ADD11C,0.0055*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNBoardOutline*%
%LPD*%
X3937Y20437D2*
D11*
X36937D1*
Y3937D1*
X3937D1*
Y20437D1*
M02*
G04 DipTrace 2.4.0.2*
%INBoardOutline.gbr*%
%MOIN*%
%ADD11C,0.0055*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNBoardOutline*%
%LPD*%
X3937Y20437D2*
D11*
X36937D1*
Y3937D1*
X3937D1*
Y20437D1*
M02*

File diff suppressed because it is too large Load Diff

View File

@ -1,100 +1,100 @@
G04 DipTrace 2.4.0.2*
%INBottomMask.gbr*%
%MOIN*%
%ADD33C,0.1378*%
%ADD45R,0.0679X0.0679*%
%ADD47C,0.0679*%
%ADD53C,0.0787*%
%ADD57C,0.0709*%
%ADD59R,0.0709X0.0709*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNBotMask*%
%LPD*%
D59*
X32562Y11687D3*
D57*
Y10687D3*
D33*
X35437Y19062D3*
Y12437D3*
X5437Y19062D3*
Y12437D3*
D53*
X34937Y16812D3*
Y14812D3*
X33937Y16812D3*
Y14812D3*
X29937Y16812D3*
Y14812D3*
X28937Y16812D3*
Y14812D3*
X27937Y16812D3*
Y14812D3*
X24937D3*
Y16812D3*
X23937D3*
Y14812D3*
X19937D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X5937D3*
X6937D3*
X7937D3*
X8937D3*
X9937D3*
X10937D3*
X11937D3*
X12937D3*
X13937D3*
X14937D3*
X19937Y16812D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X14937D3*
X13937D3*
X12937D3*
X11937D3*
X10937D3*
X9937D3*
X8937D3*
X7937D3*
X6937D3*
X5937D3*
X20937Y14812D3*
Y16812D3*
X21937D3*
Y14812D3*
X22937Y16812D3*
Y14812D3*
X25937D3*
Y16812D3*
X26937D3*
Y14812D3*
X30937D3*
Y16812D3*
X31937Y14812D3*
Y16812D3*
X32937Y14812D3*
Y16812D3*
D47*
X6937Y7812D3*
Y8812D3*
X7937D3*
Y7812D3*
X8937Y8812D3*
Y7812D3*
X9937Y8812D3*
Y7812D3*
X10937D3*
D45*
Y8812D3*
M02*
G04 DipTrace 2.4.0.2*
%INBottomMask.gbr*%
%MOIN*%
%ADD33C,0.1378*%
%ADD45R,0.0679X0.0679*%
%ADD47C,0.0679*%
%ADD53C,0.0787*%
%ADD57C,0.0709*%
%ADD59R,0.0709X0.0709*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNBotMask*%
%LPD*%
D59*
X32562Y11687D3*
D57*
Y10687D3*
D33*
X35437Y19062D3*
Y12437D3*
X5437Y19062D3*
Y12437D3*
D53*
X34937Y16812D3*
Y14812D3*
X33937Y16812D3*
Y14812D3*
X29937Y16812D3*
Y14812D3*
X28937Y16812D3*
Y14812D3*
X27937Y16812D3*
Y14812D3*
X24937D3*
Y16812D3*
X23937D3*
Y14812D3*
X19937D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X5937D3*
X6937D3*
X7937D3*
X8937D3*
X9937D3*
X10937D3*
X11937D3*
X12937D3*
X13937D3*
X14937D3*
X19937Y16812D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X14937D3*
X13937D3*
X12937D3*
X11937D3*
X10937D3*
X9937D3*
X8937D3*
X7937D3*
X6937D3*
X5937D3*
X20937Y14812D3*
Y16812D3*
X21937D3*
Y14812D3*
X22937Y16812D3*
Y14812D3*
X25937D3*
Y16812D3*
X26937D3*
Y14812D3*
X30937D3*
Y16812D3*
X31937Y14812D3*
Y16812D3*
X32937Y14812D3*
Y16812D3*
D47*
X6937Y7812D3*
Y8812D3*
X7937D3*
Y7812D3*
X8937Y8812D3*
Y7812D3*
X9937Y8812D3*
Y7812D3*
X10937D3*
D45*
Y8812D3*
M02*

View File

@ -1,12 +1,12 @@
G04 DipTrace 2.4.0.2*
%INBottomSilk.gbr*%
%MOIN*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNBotSilk*%
%LPD*%
M02*
G04 DipTrace 2.4.0.2*
%INBottomSilk.gbr*%
%MOIN*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNBotSilk*%
%LPD*%
M02*

View File

@ -1,203 +1,203 @@
M48
INCH
T01C0.0118
T02C0.0354
T03C0.038
T04C0.1378
%
T01
X+030125Y+013375
X+028875Y+013375
X+029380Y+012150
X+028380Y+011590
X+029125Y+010437
X+030979Y+011256
X+031812Y+013500
X+033750Y+013500
X+033711Y+015658
X+033380Y+016422
X+035562Y+017750
X+036625Y+020125
X+026055Y+015658
X+024380Y+016359
X+023937Y+015658
X+021695Y+014182
X+021035Y+013532
X+020610Y+012841
X+020925Y+012506
X+021319Y+012565
X+022187Y+011687
X+022687Y+011812
X+023380Y+011453
X+023518Y+011059
X+023281Y+010803
X+023519Y+010557
X+023937Y+010242
X+024380Y+009927
X+024380Y+009012
X+025423Y+009096
X+025812Y+008187
X+026875Y+008187
X+027081Y+007699
X+027690Y+007125
X+028455Y+007266
X+028753Y+006625
X+029687Y+006687
X+029734Y+007581
X+030253Y+008188
X+030562Y+007062
X+031750Y+008500
X+033441Y+007063
X+033441Y+006500
X+032937Y+006000
X+036625Y+004250
X+028375Y+008125
X+027000Y+006125
X+025437Y+006312
X+023562Y+006312
X+022937Y+005264
X+022605Y+005542
X+021909Y+006387
X+021555Y+006368
X+020925Y+006364
X+020610Y+008014
X+020295Y+008250
X+019665Y+008821
X+020500Y+009125
X+020325Y+010318
X+021625Y+009875
X+021909Y+010482
X+021965Y+010826
X+021319Y+011285
X+019937Y+012447
X+018937Y+013237
X+018406Y+012447
X+017812Y+012750
X+017875Y+013375
X+016839Y+012427
X+015937Y+012750
X+015937Y+013847
X+014000Y+013625
X+013437Y+012750
X+012875Y+011875
X+014000Y+011875
X+012875Y+013625
X+011312Y+012750
X+010380Y+011374
X+009000Y+012750
X+007438Y+013313
X+007937Y+018298
X+004250Y+020125
X+015380Y+015895
X+020380Y+017255
X+022687Y+013062
X+025380Y+011363
X+025375Y+010437
X+026163Y+010642
X+021909Y+008014
X+021625Y+008500
X+018720Y+009590
X+018406Y+008536
X+017627Y+007375
X+017127Y+007125
X+015937Y+005562
X+015937Y+004978
X+016681Y+004467
X+017016Y+004538
X+019449Y+004900
X+014064Y+006250
X+013625Y+005562
X+013439Y+006812
X+011693Y+007160
X+012110Y+005264
X+012110Y+004585
X+012445Y+004467
X+013812Y+009187
X+012875Y+010062
X+015154Y+009375
X+015750Y+010250
X+017380Y+010200
X+017954Y+011266
X+026390Y+004312
X+004250Y+004250
T02
X+032562Y+011687
X+032562Y+010687
T03
X+034937Y+016812
X+033937Y+016812
X+032937Y+016812
X+031937Y+016812
X+030937Y+016812
X+029937Y+016812
X+028937Y+016812
X+027937Y+016812
X+026937Y+016812
X+025937Y+016812
X+024937Y+016812
X+023937Y+016812
X+022937Y+016812
X+021937Y+016812
X+020937Y+016812
X+019937Y+016812
X+018937Y+016812
X+017937Y+016812
X+016937Y+016812
X+015937Y+016812
X+014937Y+016812
X+013937Y+016812
X+012937Y+016812
X+011937Y+016812
X+010937Y+016812
X+009937Y+016812
X+008937Y+016812
X+007937Y+016812
X+006937Y+016812
X+005937Y+016812
X+005937Y+014812
X+006937Y+014812
X+007937Y+014812
X+008937Y+014812
X+009937Y+014812
X+010937Y+014812
X+011937Y+014812
X+012937Y+014812
X+013937Y+014812
X+014937Y+014812
X+015937Y+014812
X+016937Y+014812
X+017937Y+014812
X+018937Y+014812
X+019937Y+014812
X+020937Y+014812
X+021937Y+014812
X+022937Y+014812
X+023937Y+014812
X+024937Y+014812
X+025937Y+014812
X+026937Y+014812
X+027937Y+014812
X+028937Y+014812
X+029937Y+014812
X+030937Y+014812
X+031937Y+014812
X+032937Y+014812
X+033937Y+014812
X+034937Y+014812
X+010937Y+008812
X+009937Y+008812
X+008937Y+008812
X+007937Y+008812
X+007937Y+007812
X+008937Y+007812
X+009937Y+007812
X+010937Y+007812
X+006937Y+007812
X+006937Y+008812
T04
X+035437Y+019062
X+035437Y+012437
X+005437Y+012437
X+005437Y+019062
T00
M30
M48
INCH
T01C0.0118
T02C0.0354
T03C0.038
T04C0.1378
%
T01
X+030125Y+013375
X+028875Y+013375
X+029380Y+012150
X+028380Y+011590
X+029125Y+010437
X+030979Y+011256
X+031812Y+013500
X+033750Y+013500
X+033711Y+015658
X+033380Y+016422
X+035562Y+017750
X+036625Y+020125
X+026055Y+015658
X+024380Y+016359
X+023937Y+015658
X+021695Y+014182
X+021035Y+013532
X+020610Y+012841
X+020925Y+012506
X+021319Y+012565
X+022187Y+011687
X+022687Y+011812
X+023380Y+011453
X+023518Y+011059
X+023281Y+010803
X+023519Y+010557
X+023937Y+010242
X+024380Y+009927
X+024380Y+009012
X+025423Y+009096
X+025812Y+008187
X+026875Y+008187
X+027081Y+007699
X+027690Y+007125
X+028455Y+007266
X+028753Y+006625
X+029687Y+006687
X+029734Y+007581
X+030253Y+008188
X+030562Y+007062
X+031750Y+008500
X+033441Y+007063
X+033441Y+006500
X+032937Y+006000
X+036625Y+004250
X+028375Y+008125
X+027000Y+006125
X+025437Y+006312
X+023562Y+006312
X+022937Y+005264
X+022605Y+005542
X+021909Y+006387
X+021555Y+006368
X+020925Y+006364
X+020610Y+008014
X+020295Y+008250
X+019665Y+008821
X+020500Y+009125
X+020325Y+010318
X+021625Y+009875
X+021909Y+010482
X+021965Y+010826
X+021319Y+011285
X+019937Y+012447
X+018937Y+013237
X+018406Y+012447
X+017812Y+012750
X+017875Y+013375
X+016839Y+012427
X+015937Y+012750
X+015937Y+013847
X+014000Y+013625
X+013437Y+012750
X+012875Y+011875
X+014000Y+011875
X+012875Y+013625
X+011312Y+012750
X+010380Y+011374
X+009000Y+012750
X+007438Y+013313
X+007937Y+018298
X+004250Y+020125
X+015380Y+015895
X+020380Y+017255
X+022687Y+013062
X+025380Y+011363
X+025375Y+010437
X+026163Y+010642
X+021909Y+008014
X+021625Y+008500
X+018720Y+009590
X+018406Y+008536
X+017627Y+007375
X+017127Y+007125
X+015937Y+005562
X+015937Y+004978
X+016681Y+004467
X+017016Y+004538
X+019449Y+004900
X+014064Y+006250
X+013625Y+005562
X+013439Y+006812
X+011693Y+007160
X+012110Y+005264
X+012110Y+004585
X+012445Y+004467
X+013812Y+009187
X+012875Y+010062
X+015154Y+009375
X+015750Y+010250
X+017380Y+010200
X+017954Y+011266
X+026390Y+004312
X+004250Y+004250
T02
X+032562Y+011687
X+032562Y+010687
T03
X+034937Y+016812
X+033937Y+016812
X+032937Y+016812
X+031937Y+016812
X+030937Y+016812
X+029937Y+016812
X+028937Y+016812
X+027937Y+016812
X+026937Y+016812
X+025937Y+016812
X+024937Y+016812
X+023937Y+016812
X+022937Y+016812
X+021937Y+016812
X+020937Y+016812
X+019937Y+016812
X+018937Y+016812
X+017937Y+016812
X+016937Y+016812
X+015937Y+016812
X+014937Y+016812
X+013937Y+016812
X+012937Y+016812
X+011937Y+016812
X+010937Y+016812
X+009937Y+016812
X+008937Y+016812
X+007937Y+016812
X+006937Y+016812
X+005937Y+016812
X+005937Y+014812
X+006937Y+014812
X+007937Y+014812
X+008937Y+014812
X+009937Y+014812
X+010937Y+014812
X+011937Y+014812
X+012937Y+014812
X+013937Y+014812
X+014937Y+014812
X+015937Y+014812
X+016937Y+014812
X+017937Y+014812
X+018937Y+014812
X+019937Y+014812
X+020937Y+014812
X+021937Y+014812
X+022937Y+014812
X+023937Y+014812
X+024937Y+014812
X+025937Y+014812
X+026937Y+014812
X+027937Y+014812
X+028937Y+014812
X+029937Y+014812
X+030937Y+014812
X+031937Y+014812
X+032937Y+014812
X+033937Y+014812
X+034937Y+014812
X+010937Y+008812
X+009937Y+008812
X+008937Y+008812
X+007937Y+008812
X+007937Y+007812
X+008937Y+007812
X+009937Y+007812
X+010937Y+007812
X+006937Y+007812
X+006937Y+008812
T04
X+035437Y+019062
X+035437Y+012437
X+005437Y+012437
X+005437Y+019062
T00
M30

File diff suppressed because it is too large Load Diff

View File

@ -1,242 +1,242 @@
G04 DipTrace 2.4.0.2*
%INTopMask.gbr*%
%MOIN*%
%ADD33C,0.1378*%
%ADD37R,0.0276X0.0787*%
%ADD39R,0.0787X0.0276*%
%ADD41R,0.0236X0.0787*%
%ADD43R,0.0669X0.0472*%
%ADD45R,0.0679X0.0679*%
%ADD47C,0.0679*%
%ADD49R,0.1063X0.0866*%
%ADD51R,0.0984X0.0276*%
%ADD53C,0.0787*%
%ADD55R,0.0472X0.065*%
%ADD57C,0.0709*%
%ADD59R,0.0709X0.0709*%
%ADD61R,0.0354X0.0433*%
%ADD63R,0.0433X0.0354*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNTopMask*%
%LPD*%
D63*
X30699Y10187D3*
X30187D3*
X18937Y4312D3*
X19449D3*
D61*
X26687Y7187D3*
Y7699D3*
D59*
X32562Y11687D3*
D57*
Y10687D3*
D55*
X15307Y4437D3*
X15937D3*
X25307D3*
X25937D3*
D33*
X35437Y19062D3*
Y12437D3*
X5437Y19062D3*
Y12437D3*
D53*
X34937Y16812D3*
Y14812D3*
X33937Y16812D3*
Y14812D3*
X29937Y16812D3*
Y14812D3*
X28937Y16812D3*
Y14812D3*
X27937Y16812D3*
Y14812D3*
X24937D3*
Y16812D3*
X23937D3*
Y14812D3*
X19937D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X5937D3*
X6937D3*
X7937D3*
X8937D3*
X9937D3*
X10937D3*
X11937D3*
X12937D3*
X13937D3*
X14937D3*
X19937Y16812D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X14937D3*
X13937D3*
X12937D3*
X11937D3*
X10937D3*
X9937D3*
X8937D3*
X7937D3*
X6937D3*
X5937D3*
X20937Y14812D3*
Y16812D3*
X21937D3*
Y14812D3*
X22937Y16812D3*
Y14812D3*
X25937D3*
Y16812D3*
X26937D3*
Y14812D3*
X30937D3*
Y16812D3*
X31937Y14812D3*
Y16812D3*
X32937Y14812D3*
Y16812D3*
D51*
X34187Y7062D3*
Y7377D3*
Y7692D3*
Y8007D3*
Y8322D3*
D49*
X34226Y5940D3*
Y9444D3*
X36392Y5940D3*
Y9444D3*
D47*
X6937Y7812D3*
Y8812D3*
X7937D3*
Y7812D3*
X8937Y8812D3*
Y7812D3*
X9937Y8812D3*
Y7812D3*
X10937D3*
D45*
Y8812D3*
D43*
X14500Y6875D3*
Y10625D3*
Y9375D3*
Y8125D3*
D63*
X12937Y4437D3*
X13449D3*
X22937D3*
X23449D3*
X17437Y4312D3*
X17949D3*
D41*
X27687Y6062D3*
X27943D3*
X28199D3*
X28455D3*
X28711D3*
X28967D3*
X29222D3*
X29478D3*
X29734D3*
X29990D3*
X30246D3*
X30502D3*
X30758D3*
X31014D3*
Y8897D3*
X30758D3*
X30502D3*
X30246D3*
X29990D3*
X29734D3*
X29478D3*
X29222D3*
X28967D3*
X28711D3*
X28455D3*
X28199D3*
X27943D3*
X27687D3*
D39*
X16437Y11187D3*
Y10872D3*
Y10557D3*
Y10242D3*
Y9927D3*
Y9612D3*
Y9297D3*
Y8982D3*
Y8667D3*
Y8352D3*
Y8037D3*
Y7722D3*
Y7407D3*
Y7093D3*
Y6778D3*
Y6463D3*
D37*
X17146Y5754D3*
X17461D3*
X17776D3*
X18091D3*
X18406D3*
X18720D3*
X19035D3*
X19350D3*
X19665D3*
X19980D3*
X20295D3*
X20610D3*
X20925D3*
X21240D3*
X21555D3*
X21870D3*
D39*
X22579Y6463D3*
Y6778D3*
Y7093D3*
Y7407D3*
Y7722D3*
Y8037D3*
Y8352D3*
Y8667D3*
Y8982D3*
Y9297D3*
Y9612D3*
Y9927D3*
Y10242D3*
Y10557D3*
Y10872D3*
Y11187D3*
D37*
X21870Y11896D3*
X21555D3*
X21240D3*
X20925D3*
X20610D3*
X20295D3*
X19980D3*
X19665D3*
X19350D3*
X19035D3*
X18720D3*
X18406D3*
X18091D3*
X17776D3*
X17461D3*
X17146D3*
M02*
G04 DipTrace 2.4.0.2*
%INTopMask.gbr*%
%MOIN*%
%ADD33C,0.1378*%
%ADD37R,0.0276X0.0787*%
%ADD39R,0.0787X0.0276*%
%ADD41R,0.0236X0.0787*%
%ADD43R,0.0669X0.0472*%
%ADD45R,0.0679X0.0679*%
%ADD47C,0.0679*%
%ADD49R,0.1063X0.0866*%
%ADD51R,0.0984X0.0276*%
%ADD53C,0.0787*%
%ADD55R,0.0472X0.065*%
%ADD57C,0.0709*%
%ADD59R,0.0709X0.0709*%
%ADD61R,0.0354X0.0433*%
%ADD63R,0.0433X0.0354*%
%FSLAX44Y44*%
G04*
G70*
G90*
G75*
G01*
%LNTopMask*%
%LPD*%
D63*
X30699Y10187D3*
X30187D3*
X18937Y4312D3*
X19449D3*
D61*
X26687Y7187D3*
Y7699D3*
D59*
X32562Y11687D3*
D57*
Y10687D3*
D55*
X15307Y4437D3*
X15937D3*
X25307D3*
X25937D3*
D33*
X35437Y19062D3*
Y12437D3*
X5437Y19062D3*
Y12437D3*
D53*
X34937Y16812D3*
Y14812D3*
X33937Y16812D3*
Y14812D3*
X29937Y16812D3*
Y14812D3*
X28937Y16812D3*
Y14812D3*
X27937Y16812D3*
Y14812D3*
X24937D3*
Y16812D3*
X23937D3*
Y14812D3*
X19937D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X5937D3*
X6937D3*
X7937D3*
X8937D3*
X9937D3*
X10937D3*
X11937D3*
X12937D3*
X13937D3*
X14937D3*
X19937Y16812D3*
X18937D3*
X17937D3*
X16937D3*
X15937D3*
X14937D3*
X13937D3*
X12937D3*
X11937D3*
X10937D3*
X9937D3*
X8937D3*
X7937D3*
X6937D3*
X5937D3*
X20937Y14812D3*
Y16812D3*
X21937D3*
Y14812D3*
X22937Y16812D3*
Y14812D3*
X25937D3*
Y16812D3*
X26937D3*
Y14812D3*
X30937D3*
Y16812D3*
X31937Y14812D3*
Y16812D3*
X32937Y14812D3*
Y16812D3*
D51*
X34187Y7062D3*
Y7377D3*
Y7692D3*
Y8007D3*
Y8322D3*
D49*
X34226Y5940D3*
Y9444D3*
X36392Y5940D3*
Y9444D3*
D47*
X6937Y7812D3*
Y8812D3*
X7937D3*
Y7812D3*
X8937Y8812D3*
Y7812D3*
X9937Y8812D3*
Y7812D3*
X10937D3*
D45*
Y8812D3*
D43*
X14500Y6875D3*
Y10625D3*
Y9375D3*
Y8125D3*
D63*
X12937Y4437D3*
X13449D3*
X22937D3*
X23449D3*
X17437Y4312D3*
X17949D3*
D41*
X27687Y6062D3*
X27943D3*
X28199D3*
X28455D3*
X28711D3*
X28967D3*
X29222D3*
X29478D3*
X29734D3*
X29990D3*
X30246D3*
X30502D3*
X30758D3*
X31014D3*
Y8897D3*
X30758D3*
X30502D3*
X30246D3*
X29990D3*
X29734D3*
X29478D3*
X29222D3*
X28967D3*
X28711D3*
X28455D3*
X28199D3*
X27943D3*
X27687D3*
D39*
X16437Y11187D3*
Y10872D3*
Y10557D3*
Y10242D3*
Y9927D3*
Y9612D3*
Y9297D3*
Y8982D3*
Y8667D3*
Y8352D3*
Y8037D3*
Y7722D3*
Y7407D3*
Y7093D3*
Y6778D3*
Y6463D3*
D37*
X17146Y5754D3*
X17461D3*
X17776D3*
X18091D3*
X18406D3*
X18720D3*
X19035D3*
X19350D3*
X19665D3*
X19980D3*
X20295D3*
X20610D3*
X20925D3*
X21240D3*
X21555D3*
X21870D3*
D39*
X22579Y6463D3*
Y6778D3*
Y7093D3*
Y7407D3*
Y7722D3*
Y8037D3*
Y8352D3*
Y8667D3*
Y8982D3*
Y9297D3*
Y9612D3*
Y9927D3*
Y10242D3*
Y10557D3*
Y10872D3*
Y11187D3*
D37*
X21870Y11896D3*
X21555D3*
X21240D3*
X20925D3*
X20610D3*
X20295D3*
X19980D3*
X19665D3*
X19350D3*
X19035D3*
X18720D3*
X18406D3*
X18091D3*
X17776D3*
X17461D3*
X17146D3*
M02*

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) */
#ifndef F_CPU
// #define F_CPU 7372800
//#define F_CPU (7372800/2)
//#define F_CPU (7372800/2)
//#define F_CPU 11059200UL
#define F_CPU 8000000UL
#endif
@ -70,19 +70,19 @@
#define BLPIN PIND
#define BLPNUM PIND7
/*
* <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> - <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
*/
#define ENABLE_BOOT_LED
#define BIPORT PORTB
#define BIDDR DDRB
#define BIPIN PINB
#define BIPNUM PINB6
#define BIPNUM2 PINB7
#define BIPNUM PINB6
#define BIPNUM2 PINB7
/*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@ -154,13 +154,13 @@
#define GET_EXTENDED_FUSE_BITS 0x0002
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> USART*/
#ifdef UART_DOUBLESPEED
#ifdef UART_DOUBLESPEED
#define UART_CALC_BAUDRATE(baudRate) ((uint32_t)((F_CPU) + ((uint32_t)baudRate * 4UL)) / ((uint32_t)(baudRate) * 8UL) - 1)
#define UART_CALC_BAUDRATE(baudRate) ((uint32_t)((F_CPU) + ((uint32_t)baudRate * 4UL)) / ((uint32_t)(baudRate) * 8UL) - 1)
#else
#else
#define UART_CALC_BAUDRATE(baudRate) ((uint32_t)((F_CPU) + ((uint32_t)baudRate * 8UL)) / ((uint32_t)(baudRate) * 16UL) - 1)
#define UART_CALC_BAUDRATE(baudRate) ((uint32_t)((F_CPU) + ((uint32_t)baudRate * 8UL)) / ((uint32_t)(baudRate) * 16UL) - 1)
#endif
@ -201,7 +201,7 @@ static inline void eraseFlash(void)
{
// erase only main section (bootloader protection)
uint32_t addr = 0;
while (APP_END > addr)
while (APP_END > addr)
{
boot_page_erase(addr); // Perform page erase
boot_spm_busy_wait(); // Wait until the memory is erased.
@ -215,7 +215,7 @@ static inline void recvBuffer(pagebuf_t size)
pagebuf_t cnt;
uint8_t *tmp = gBuffer;
for (cnt = 0; cnt < sizeof(gBuffer); cnt++)
for (cnt = 0; cnt < sizeof(gBuffer); cnt++)
{
*tmp++ = (cnt < size) ? recvchar() : 0xFF;
}
@ -228,7 +228,7 @@ static inline uint16_t writeFlashPage(uint16_t waddr, pagebuf_t size)
uint16_t data;
uint8_t *tmp = gBuffer;
do
do
{
data = *tmp++;
data |= *tmp++ << 8;
@ -236,7 +236,7 @@ static inline uint16_t writeFlashPage(uint16_t waddr, pagebuf_t size)
baddr += 2; // Select next word in memory
size -= 2; // Reduce number of bytes to write by two
}
}
while (size); // Loop until all bytes written
boot_page_write(pagestart);
@ -250,12 +250,12 @@ static inline uint16_t writeEEpromPage(uint16_t address, pagebuf_t size)
{
uint8_t *tmp = gBuffer;
do
do
{
eeprom_write_byte( (uint8_t*)address, *tmp++ );
address++; // Select next byte
size--; // Decreas number of bytes to write
}
}
while (size); // Loop until all bytes written
// eeprom_busy_wait();
@ -268,29 +268,29 @@ static inline uint16_t readFlashPage(uint16_t waddr, pagebuf_t size)
uint32_t baddr = (uint32_t)waddr<<1;
uint16_t data;
do
{
do
{
#ifndef READ_PROTECT_BOOTLOADER
#warning "Bootloader not read-protected"
#warning "Bootloader not read-protected"
#if defined(RAMPZ)
data = pgm_read_word_far(baddr);
#else
data = pgm_read_word_near(baddr);
#endif
#endif
#else
// don't read bootloader
if ( baddr < APP_END )
{
if ( baddr < APP_END )
{
#if defined(RAMPZ)
data = pgm_read_word_far(baddr);
#else
data = pgm_read_word_near(baddr);
#endif
}
else
else
{
data = 0xFFFF; // fake empty
}
@ -299,19 +299,19 @@ static inline uint16_t readFlashPage(uint16_t waddr, pagebuf_t size)
sendchar((data >> 8)); // send MSB
baddr += 2; // Select next word in memory
size -= 2; // Subtract two bytes from number of bytes to read
}
}
while (size); // Repeat until block has been read
return baddr>>1;
}
static inline uint16_t readEEpromPage(uint16_t address, pagebuf_t size)
{
do
do
{
sendchar( eeprom_read_byte( (uint8_t*)address ) );
address++;
size--; // Decrease number of bytes to read
}
}
while (size); // Repeat until block has been read
return address;
@ -357,16 +357,16 @@ int main(void)
if (MCUCSR & (1<<WDRF)) jump_to_app();
MCUCSR = 0;
uint16_t address = 0;
uint8_t device = 0, val;
#ifdef ENABLE_BOOT_LED // LED ON
BIPORT |= ((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR |= ((1<<BIPNUM)|(1<<BIPNUM2));
#endif
uint8_t device = 0, val;
#ifdef ENABLE_BOOT_LED // LED ON
BIPORT |= ((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR |= ((1<<BIPNUM)|(1<<BIPNUM2));
#endif
#ifdef DISABLE_WDT_AT_STARTUP
#ifdef WDT_OFF_SPECIAL
#warning "using target specific watchdog_off"
@ -403,41 +403,41 @@ int main(void)
the main parser-loop gives a lot a possibilities (timeout, sleep-modes
etc.).
*/
for(;OK;)
for(;OK;)
{
if ((BLPIN & (1<<BLPNUM)))
if ((BLPIN & (1<<BLPNUM)))
{
// jump to main app if pin is not grounded
BLPORT &= ~(1<<BLPNUM); // set to default
BLPORT &= ~(1<<BLPNUM); // set to default
#ifdef UART_DOUBLESPEED
UART_STATUS &= ~( 1<<UART_DOUBLE );
#endif
#ifdef ENABLE_BOOT_LED // LED OFF
BIPORT &= ~((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR &= ~((1<<BIPNUM)|(1<<BIPNUM2));
#endif
#endif
#ifdef ENABLE_BOOT_LED // LED OFF
BIPORT &= ~((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR &= ~((1<<BIPNUM)|(1<<BIPNUM2));
#endif
jump_to_app(); // Jump to application sector
}
else
}
else
{
val = recvchar();
/* ESC */
if (val == 0x1B)
if (val == 0x1B)
{
// AVRPROG connection
// Wait for signon
while (val != 'S')
val = recvchar();
val = recvchar();
send_boot(); // Report signon
OK = 0;
}
else
}
else
{
sendchar('?');
}
@ -449,16 +449,16 @@ int main(void)
if ((BLPIN & (1<<BLPNUM))) {
// jump to main app if pin is not grounded
BLPORT &= ~(1<<BLPNUM); // set to default
BLPORT &= ~(1<<BLPNUM); // set to default
#ifdef UART_DOUBLESPEED
UART_STATUS &= ~( 1<<UART_DOUBLE );
#endif
#ifdef ENABLE_BOOT_LED // LED OFF
BIPORT &= ~((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR &= ~((1<<BIPNUM)|(1<<BIPNUM2));
#endif
#endif
#ifdef ENABLE_BOOT_LED // LED OFF
BIPORT &= ~((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR &= ~((1<<BIPNUM)|(1<<BIPNUM2));
#endif
jump_to_app(); // Jump to application sector
}
@ -473,12 +473,12 @@ int main(void)
break;
if (cnt++ >= WAIT_VALUE) {
BLPORT &= ~(1<<BLPNUM); // set to default
#ifdef ENABLE_BOOT_LED // LED OFF
BIPORT &= ~((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR &= ~((1<<BIPNUM)|(1<<BIPNUM2));
BLPORT &= ~(1<<BLPNUM); // set to default
#ifdef ENABLE_BOOT_LED // LED OFF
BIPORT &= ~((1<<BIPNUM)|(1<<BIPNUM2));
BIDDR &= ~((1<<BIPNUM)|(1<<BIPNUM2));
#endif
jump_to_app(); // Jump to application sector
}
@ -492,36 +492,36 @@ int main(void)
#else
#error "Select START_ condition for bootloader in main.c"
#endif
#endif
for(;;)
for(;;)
{
val = recvchar();
// Autoincrement?
if (val == 'a')
if (val == 'a')
{
sendchar('Y'); // Autoincrement is quicker
//write address
}
else if (val == 'A')
}
else if (val == 'A')
{
address = recvchar(); //read address 8 MSB
address = (address<<8) | recvchar();
sendchar('\r');
// Buffer load support
}
else if (val == 'b')
}
else if (val == 'b')
{
sendchar('Y'); // Report buffer load supported
sendchar((sizeof(gBuffer) >> 8) & 0xFF); // Report buffer size in bytes
sendchar(sizeof(gBuffer) & 0xFF);
// Start buffer load
}
else if (val == 'B')
}
else if (val == 'B')
{
pagebuf_t size;
size = recvchar() << 8; // Load high byte of buffersize
@ -529,54 +529,54 @@ int main(void)
val = recvchar(); // Load memory type ('E' or 'F')
recvBuffer(size);
if (device == DEVTYPE)
if (device == DEVTYPE)
{
if (val == 'F')
if (val == 'F')
{
address = writeFlashPage(address, size);
}
else if (val == 'E')
}
else if (val == 'E')
{
address = writeEEpromPage(address, size);
}
sendchar('\r');
}
else
}
else
{
sendchar(0);
}
// Block read
}
else if (val == 'g')
}
else if (val == 'g')
{
pagebuf_t size;
size = recvchar() << 8; // Load high byte of buffersize
size |= recvchar(); // Load low byte of buffersize
val = recvchar(); // Get memtype
if (val == 'F')
if (val == 'F')
{
address = readFlashPage(address, size);
}
else if (val == 'E')
}
else if (val == 'E')
{
address = readEEpromPage(address, size);
}
// Chip erase
}
else if (val == 'e')
}
else if (val == 'e')
{
if (device == DEVTYPE)
if (device == DEVTYPE)
{
eraseFlash();
}
sendchar('\r');
// Exit upgrade
}
else if (val == 'E')
}
else if (val == 'E')
{
wdt_enable(EXIT_WDT_TIME); // Enable Watchdog Timer to give reset
sendchar('\r');
@ -585,10 +585,10 @@ int main(void)
#warning "Extension 'WriteLockBits' enabled"
// TODO: does not work reliably
// write lockbits
}
else if (val == 'l')
}
else if (val == 'l')
{
if (device == DEVTYPE)
if (device == DEVTYPE)
{
// write_lock_bits(recvchar());
boot_lock_bits_set(recvchar()); // boot.h takes care of mask
@ -597,75 +597,75 @@ int main(void)
sendchar('\r');
#endif
// Enter programming mode
}
else if (val == 'P')
}
else if (val == 'P')
{
sendchar('\r');
// Leave programming mode
}
else if (val == 'L')
}
else if (val == 'L')
{
sendchar('\r');
// return programmer type
}
else if (val == 'p')
}
else if (val == 'p')
{
sendchar('S'); // always serial programmer
#ifdef ENABLEREADFUSELOCK
#warning "Extension 'ReadFuseLock' enabled"
// read "low" fuse bits
}
else if (val == 'F')
}
else if (val == 'F')
{
sendchar(read_fuse_lock(GET_LOW_FUSE_BITS));
// read lock bits
}
else if (val == 'r')
}
else if (val == 'r')
{
sendchar(read_fuse_lock(GET_LOCK_BITS));
// read high fuse bits
}
else if (val == 'N')
}
else if (val == 'N')
{
sendchar(read_fuse_lock(GET_HIGH_FUSE_BITS));
// read extended fuse bits
}
else if (val == 'Q')
}
else if (val == 'Q')
{
sendchar(read_fuse_lock(GET_EXTENDED_FUSE_BITS));
#endif
// Return device type
}
else if (val == 't')
}
else if (val == 't')
{
sendchar(DEVTYPE);
sendchar(0);
// clear and set LED ignored
}
else if ((val == 'x') || (val == 'y'))
}
else if ((val == 'x') || (val == 'y'))
{
recvchar();
sendchar('\r');
// set device
}
else if (val == 'T')
}
else if (val == 'T')
{
device = recvchar();
sendchar('\r');
// Return software identifier
}
else if (val == 'S')
}
else if (val == 'S')
{
send_boot();
// Return Software Version
}
}
else if (val == 'V') {
sendchar(VERSION_HIGH);
sendchar(VERSION_LOW);
@ -673,16 +673,16 @@ int main(void)
// Return Signature Bytes (it seems that
// AVRProg expects the "Atmel-byte" 0x1E last
// but shows it first in the dialog-window)
}
else if (val == 's')
}
else if (val == 's')
{
sendchar(SIG_BYTE3);
sendchar(SIG_BYTE2);
sendchar(SIG_BYTE1);
/* ESC */
}
else if(val != 0x1b)
}
else if(val != 0x1b)
{
sendchar('?');
}

View File

@ -1,70 +1,62 @@
:10F8000011241FBECFEFD0E1DEBFCDBF12E0A0E0DC
:10F81000B1E001C01D92A030B107E1F70E94327C37
:10F820000C941E7E0C94147C08955D9BFECF81E4A5
:10F830008CB95D9BFECF86E58CB95D9BFECF82E5E2
:10F840008CB95D9BFECF82E48CB95D9BFECF8FE4CB
:10F850008CB95D9BFECF8FE48CB95D9BFECF84E5B8
:10F860008CB908952F923F924F925F926F927F9240
:10F870008F929F92AF92BF92CF92DF92EF92FF92C0
:10F880000F931F93DF93CF9300D00F92CDB7DEB7C6
:10F8900004B603FE03C0E0E0F0E0099514BE88B3AF
:10F8A000806C88BB87B3806C87BBF894A89598E17F
:10F8B0000FB6F89491BD11BC0FBE8F98979A109215
:10F8C000900089E189B99AB986E080939500CC24AB
:10F8D000DD24EE24FF2400E21EE45F9B03C08CB114
:10F8E0008335A9F020E2C21623E0D20648F09798AB
:10F8F00088B38F7388BB87B38F7387BBF701099574
:10F900000894C11CD11CC8010197F1F7E6CF0E94F1
:10F91000157C1982AA24BB245F9BFECF9CB1913633
:10F9200021F45D9BFECF39E5A2C0913479F45F9B51
:10F93000FECF9CB15F9BFECF8CB15D9BFECF392E7D
:10F940002224A82EBB24A228B3280EC1923659F433
:10F950005D9BFECF89E58CB95D9BFECF91E09CB9A4
:10F960005D9BFECF19C1923409F086C05F9BFECF2C
:10F970009CB15F9BFECF8CB1592E4424C82EDD2450
:10F98000C428D5285F9BFECF3CB180E090E0E0E04A
:10F99000F1E08C159D0510F02FEF03C05F9BFECFAB
:10F9A0002CB12083019621E08030920711F031962E
:10F9B000F0CF6981663409F05CC0363409F039C093
:10F9C000750100E010E0EE0CFF1C001F111FA801E4
:10F9D0009701A0E0B1E08C9190E011969C90119776
:10F9E000882488299929129661E0F9010C01609315
:10F9F0006800E89511242E5F3F4F4F4F5F4F8EEF09
:10FA00009FEFC80ED91EC114D10429F765E0F70194
:10FA100060936800E8958091680080FDFCCF81E1EB
:10FA200080936800E8955695479537952795590135
:10FA30001BC03534C9F4DB82CA82850140E0E42E64
:10FA400041E0F42EF70161917F01C8010E94117E0F
:10FA50000F5F1F4F2A813B81215030403B832A8317
:10FA6000232B81F7AC0CBD1C5D9BFECF3DE03CB968
:10FA700053CF5D9BFECF90C0973609F047C05F9B88
:10FA8000FECF9CB15F9BFECF8CB1792E6624C82E31
:10FA9000DD24C628D7285F9BFECF8CB1863401F5C4
:10FAA000C501A0E0B0E0880F991FAA1FBB1FFC0191
:10FAB000259134915D9BFECF2CB95D9BFECF3CB967
:10FAC0000296A11DB11DEEEFFFEFCE0EDF1EC11499
:10FAD000D10469F7B695A795979587955C011CCFDA
:10FAE000853409F019CF76018501C8010E94097E8D
:10FAF0005D9BFECF8CB90F5F1F4F0894E108F108A2
:10FB0000E114F10491F7AC0CBD1C06CF9536D1F48D
:10FB1000F981F634A1F4E0E0F0E023E020936800FE
:10FB2000E8958091680080FDFCCFE050FF4F38EFF2
:10FB3000E030F30791F761E160936800E8955D9B21
:10FB4000FECF19C0953461F4E8E1F0E02CE00FB687
:10FB5000F894A895E1BD0FBE21BD5D9BFECF86CF79
:10FB6000903529F45D9BFECF6DE06CB9D5CE9C3409
:10FB700021F45D9BFECF8DE033C0903729F45D9B6F
:10FB8000FECF93E59CB9C8CE943741F45D9BFECF80
:10FB9000E6E4ECB95D9BFECF1CB8BECE892F88573A
:10FBA000823038F45F9BFECF8CB15D9BFECFFDE0D1
:10FBB00026C0943539F45F9BFECF2CB129835D9B21
:10FBC000FECF54CF933519F40E94157CA5CE9635FF
:10FBD00049F45D9BFECF60E36CB95D9BFECF88E38B
:10FBE0008CB99ACE933769F45D9BFECF92E09CB9B5
:10FBF0005D9BFECFE6E9ECB95D9BFECFFEE1FCB973
:10FC00008BCE9B3109F488CE5D9BFECF2FE32CB9C0
:10FC100083CEE199FECF9FBB8EBBE09A99278DB32F
:10FC20000895262FE199FECF9FBB8EBB2DBB0FB64B
:10FC3000F894E29AE19A0FBE01960895F894FFCFE6
:040000030000F80001
:00000001FF
:10F8000011241FBECFEFD0E1DEBFCDBF22E0A0E0CC
:10F81000B1E001C01D92A030B207E1F70E94327C36
:10F820000C94DE7D0C94317C5D9BFECF8CB90895E9
:10F830005F9BFECF8CB1089581E40E94147C86E525
:10F840000E94147C82E50E94147C82E40E94147C55
:10F850008FE40E94147C8FE40E94147C84E50C9455
:10F86000147C0895CF93DF9300D01F92CDB7DEB7FD
:10F8700004B603FE03C0E0E0F0E0099514BE88B3CF
:10F88000806C88BB87B3806C87BBF894A8950FB653
:10F89000F894A89581B5886181BD11BC0FBE8F9881
:10F8A000979A1092900089E189B988E18AB986E037
:10F8B00080939500E12CF12C00E010E05F9B03C0E9
:10F8C0008CB18335C1F0F0E2EF16F3E0FF0648F0AB
:10F8D000979888B38F7388BB87B38F7387BBF80102
:10F8E00009958FE19EE40197F1F700C000009FEFBA
:10F8F000E91AF90AE3CF0E941C7CF12C1B821A82C0
:10F90000E8E13E2EFCE04F2EA3E07A2EB1E1EB2E93
:10F910006624639415E0512E0E94187C813611F400
:10F9200089E534C1813459F40E94187C082F10E015
:10F93000102F00270E94187C9801282B83C0823644
:10F9400029F489E50E94147C81E0F4C0823409F036
:10F950007CC00E94187C082F10E0102F00270E9406
:10F96000187C082B0E94187C982F60E0862E61E09E
:10F97000962E6401A12CB12CA016B10628F499830F
:10F980000E94187C998101C08FEFF60181936F016D
:10F99000FFEFAF1ABF0AA11421E0B20669F736E4FF
:10F9A000F312CAC0963409F036C02A813B8149015E
:10F9B000A12CB12C880C991CAA1CBB1C2091000105
:10F9C000B501A401A0E0B1E01296FD01319780815C
:10F9D00030E0382BFA01090160926800E8951124A3
:10F9E0004E5F5F4F6F4F7F4F0250110911F02C9106
:10F9F000EBCFF40150926800E8958091680080FD9B
:10FA0000FCCFE0926800E895769567955795479505
:10FA10005B834A839FC0953409F09CC06801AA802B
:10FA2000BB80F40161914F01C5010E94D17DFFEFC0
:10FA3000AF1ABF0A21E0C21AD10899F72A813B8187
:10FA4000200F311F3B832A8385C0873609F047C0CA
:10FA50000E94187C082F10E0102F00270E94187CAD
:10FA6000082B0E94187C863409F52A813B814901C4
:10FA7000A12CB12C880C991CAA1CBB1CF401C590AC
:10FA8000D4908C2D0E94147C8D2D0E94147C32E029
:10FA9000830E911CA11CB11C0250110979F7B69478
:10FAA000A794979487949B828A8236CF853409F0F5
:10FAB00033CF6801AA80BB80C5010E94C97D0E9426
:10FAC000147C8FEFA81AB80A91E0C91AD108A1F7DF
:10FAD0002A813B81200F311F3B832A831DCF85362E
:10FAE000A9F436E4F31236C0E0E0F0E0709268006A
:10FAF000E8958091680080FDFCCFF395E11588EFD3
:10FB0000F807A1F7E0926800E89524C0853439F43D
:10FB10000FB6F894A89531BC0FBE41BC1BC0803510
:10FB2000C9F08C34B9F0803711F483E52FC08437E5
:10FB300029F486E40E94147C80E028C098E8980F9D
:10FB4000923018F40E94187C05C0843529F40E9474
:10FB5000187CF82E8DE01AC0833519F40E941C7CA5
:10FB6000DBCE863529F480E30E94147C88E30EC046
:10FB7000833741F482E00E94147C86E90E94147C61
:10FB80008EE104C08B3109F4C7CE8FE30E94147C50
:10FB9000C3CEE199FECF9FBB8EBBE09A99278DB370
:10FBA0000895262FE199FECF9FBB8EBB2DBB0FB6CC
:10FBB000F894E29AE19A0FBE01960895F894FFCF67
:040000030000F80001
:00000001FF

View File

@ -1,39 +1,39 @@
#ifndef _MEGA64_H_
#define _MEGA64_H_
/* Part-Code ISP */
#define DEVTYPE_ISP 0x45
/* Part-Code Boot */
#define DEVTYPE_BOOT 0x46
#define SIG_BYTE1 0x1E
#define SIG_BYTE2 0x96
#define SIG_BYTE3 0x02
#ifndef UART_USE_SECOND
#define UART_BAUD_HIGH UBRR0H
#define UART_BAUD_LOW UBRR0L
#define UART_STATUS UCSR0A
#define UART_TXREADY UDRE0
#define UART_RXREADY RXC0
#define UART_DOUBLE U2X0
#define UART_CTRL UCSR0B
#define UART_CTRL_DATA ((1<<TXEN0) | (1<<RXEN0))
#define UART_CTRL2 UCSR0C
#define UART_CTRL2_DATA ((1<<UCSZ01) | (1<<UCSZ00))
#define UART_DATA UDR0
#else
#define UART_BAUD_HIGH UBRR1H
#define UART_BAUD_LOW UBRR1L
#define UART_STATUS UCSR1A
#define UART_TXREADY UDRE1
#define UART_RXREADY RXC1
#define UART_DOUBLE U2X1
#define UART_CTRL UCSR1B
#define UART_CTRL_DATA ((1<<TXEN1) | (1<<RXEN1))
#define UART_CTRL2 UCSR1C
#define UART_CTRL2_DATA ((1<<UCSZ11) | (1<<UCSZ10))
#define UART_DATA UDR1
#endif
#endif // #ifndef _MEGA64_H_
#ifndef _MEGA64_H_
#define _MEGA64_H_
/* Part-Code ISP */
#define DEVTYPE_ISP 0x45
/* Part-Code Boot */
#define DEVTYPE_BOOT 0x46
#define SIG_BYTE1 0x1E
#define SIG_BYTE2 0x96
#define SIG_BYTE3 0x02
#ifndef UART_USE_SECOND
#define UART_BAUD_HIGH UBRR0H
#define UART_BAUD_LOW UBRR0L
#define UART_STATUS UCSR0A
#define UART_TXREADY UDRE0
#define UART_RXREADY RXC0
#define UART_DOUBLE U2X0
#define UART_CTRL UCSR0B
#define UART_CTRL_DATA ((1<<TXEN0) | (1<<RXEN0))
#define UART_CTRL2 UCSR0C
#define UART_CTRL2_DATA ((1<<UCSZ01) | (1<<UCSZ00))
#define UART_DATA UDR0
#else
#define UART_BAUD_HIGH UBRR1H
#define UART_BAUD_LOW UBRR1L
#define UART_STATUS UCSR1A
#define UART_TXREADY UDRE1
#define UART_RXREADY RXC1
#define UART_DOUBLE U2X1
#define UART_CTRL UCSR1B
#define UART_CTRL_DATA ((1<<TXEN1) | (1<<RXEN1))
#define UART_CTRL2 UCSR1C
#define UART_CTRL2_DATA ((1<<UCSZ11) | (1<<UCSZ10))
#define UART_DATA UDR1
#endif
#endif // #ifndef _MEGA64_H_

View File

@ -1,267 +1,267 @@
======================================================
ATMEL AVR UART Bootloader for AVR-GCC/avr-libc
by Martin Thomas, Kaiserslautern, Germany
mthomas@rhrk.uni-kl.de
eversmith@heizung-thomas.de
http://www.siwawi.arubi.uni-kl.de/avr_projects
** Addtional code and improvements contributed **
** by Uwe Bonnes, Bjoern Riemer and Olaf Rempel. **
Eearly versions of this bootloader-code have been
based on the AVR Butterfly bootloader-source REV02
which has been available from atmel.com.
======================================================
Programming-Software (on the "PC-Side"):
* AVRProg (included in AVRStudio) available at www.atmel.com.
MS-Windows only. AVRProg can be used as stand-alone application.
(avrprog.exe)
* avrdude available at http://savannah.nongnu.org/projects/avrdude/
"Multiplattform"
* Installation instructions at the end of this file.
3. Dec. 2008 - Version 0.85
* disable U2X before jump to app as suggested be Alexander D<>ller
* moved UBRR-macros to main.c and changed them. Inspired by code from avr-libc setbaud.
(macros which are commented out (//) are from Pavel Fertser)
6. Nov. 2008 - Version 0.84
* Added definitions for ATmega64 provided by Pavel Fertser - Thanks.
12. Apr. 2008 - Version 0.83
* Added definitions for ATmega644P and ATmega324P
* Tested with ATmega324P, gcc 4.2.2, avr-libc 1.4.6
* Added testapp to verify "exit bootloader" with
watchdog (n.b.: watchdog-disable called early in testapp)
27. Jan. 2007 - Version 0.82
* Added definitions for ATmega644.
* Using avr-lib's eeprom-functions (old "direct-access"-code
has not been compatible with ATmega644).
* Watchdog-disable at startup (configurable): avoids problems with
repeated login to bootloader. Not needed if the bootloader is
never re-entered again between an "exit programming" and
a system-reset/power-toogle.
* Additional watchdog disable-function for ATmega644.
* Made watchdog-enable time at exit-programming a configuration-value
(define).
* Bootloader read-protection: if enabled the bootloader fakes
an empty boot-section (configurable by define)
Since more of the avr-libc functions's are used this version
should be more portable for other AVRs but the size of the
binary increases a little bit.
Make sure to disable the watchdog early in the user-application
esp. when using a "modern" AVR (i.e. ATmega48/88/168/644/324P/644P).
3. Dec. 2006 - Version 0.81
* Added definitions for ATmega162.
* Fixed init for double-speed (bitmask). Thanks to Bernhard Roth
28. May 2006 - Version 0.8beta3
* Supports discarding of interrupt-vectors which saves some space
if no interrupts are needed in the bootloader. Added option
in makefile to enable this feature, modified LDFLAGS,
additional code in main.c for a pseudo default_interrupt ISR.
The modified linker-scripts have been contributed by
Olaf Rempel (basicly just the .vector-section is not linked).
* Reverted the order of signatur-byte-numbers in part-
configurations to the usual order in the datasheet,
also reverted in main.c for sending the signature.
* Definitions for lock/fuse-readout.
* Updated installation-instruction at the end of this file.
* Added DEVTYPE_ISP/DEVTYPE_BOOT to part-configurations,
added configuration-option for this in main.c.
* A remark about the DEVTYPE: Usualy there are two
Part-Codes/Device-Codes. One is for ISP: AVRProg shows
the type of the AVR. The other code is for bootloading:
AVRprog shows the type plus "BOOT". When a boot-device-code
gets detected by AVRprog it "knows" how do handle the
limited functionality of bootloaders. (When receiving the
ISP-code AVRProg expects an AVR910-type programmer.)
The offset between the codes is usualy 0x01 where the
ISP-code is the smaller value, i.e. ATmega32 ISP-code
is 0x72->"ATmega32" and boot-code is 0x73->"ATmega32 BOOT".
When using avrdude the bootloader's device-code must match
the device-code in the avrdude.conf. Check the avrdude-
code to see if both codes (AVR910 and AVR109) are supported.
-- I have got some e-mails from users which have been
confused by this. Hopefully this explanation is good enough.
* This bootloader lets the watchdog do a reset when the
user selects "Exit programmer" (i.e. in AVRProg) after an
update. Make sure to disable or reset the watchdog early in
your application.
27. May 2006 - Version 0.8beta2
* More very well done improvements contributed by Olaf Rempel.
* Olaf Rempel also modified the STARTUP_WAIT method.
21. May 2006 - Version 0.8beta
* Version contributed by Olaf Rempel. He has done a lot of modifications.
-> "cleaner code", smaller binaries.
09. Feb. 2006 - Version 0.75
* additional STARTUP_WAIT support contributed by Bjoern Riemer
18. Aug. 2005 - Version 0.74
* AT90CAN128 support contributed by Uwe Bonnes
* Makefile modifications contributed by Uwe Bonnes
23. Feb. 2005 - Version 0.7
* (Version 0.6 has never been available on the web-page)
* ATmega128 support
* code cleanup
* This version has been tested with ATmega8, ATmega32 and
ATmega128
7. Apr. 2004 - Version 0.5
* added different startup-methods
* compatible with ATmega8 now
* included makefile adapted to ATmega8 now
(ATmega16 options still available)
* fixed jump to application which did not work
reliably before
* tested with ATmega8
* minimal options and startup-code result in
bootloader-size < 512 words
6. Apr. 2004 - Version 0.4
* Buffered read of chars from UART during programming
since eeprom-write is too slow for unbuffered
operation. So EEPROM-upload does work now.
* Added BOOTICE-mode to flash JTAGICE-compatible
hardware (ATmega16@7,3Mhz) (if you know about BOOTICE,
you may unterstand why this has been added, if not
just keep the option disabled)
* small changes in (my)boot.h (lock-bit-mask) found
out during the development of the STK-500-compatible
bootloader. But setting lock-bits still does not
work with this bootloader.
* read of the low-fuse byte works (high byte still TODO)
* read of the lock-byte works (write still TODO)
27. Mar 2004 - Version 0.3
Felt that as much functions from avr-libc's boot.h
as possible should be used without modifications.
Latest CVS-version of boot.h is included.
Only the read-routine is still "self-made" based
on ATMELs assembler-code.
EEPROM write on Mega16 does not work (and did not
work with V0.2 too). May be caused by my old Mega16
chip. Needs testing. Flash read/write and EEPROM
read works. Still only tested with ATmega16.
This version may not work with the ATmega169 any
more.
24. Mar 2004 - Version 0.2
During the development of a data-logger application
with the AVR-Butterfly there was a need to make
some changes in the bootloader. The same problem
again: no IAR compiler. The same way to solve the
problem: a port of the code to avr-gcc/avr-libc.
So this code is based on the ATMEL Butterfly
bootloader source code Rev 0.2 for IAR.
The bootloader-port for the Butterfly which mimics
the complete functionality of the original
BF-bootloader is availabe at:
www.siwawi.arubi.uni-kl.de/avr_projects
Atmel used a separate "lib" written in "pure"
assembly to access the low-level functions
for flash read/write. Well, so far I
don't know how to use "mixed language sources"
with the avr-gcc toolchain, so the low-level
routines have been implemented as inline assembler.
The avr-libc boot.h module written by Eric
Weddington served as a template Three of the four
low-level routines found in lowlevel.c come from
boot.h with minimal changes. The read routine has
been developed based on the ATMEL assembler code.
Ignore the fuse and lock-bit readout. Read and Set is
not enabled (TODO).
--------------- Installation -----------------
- Change the MCU type in the makefile.
- Change the boot(loader)-size in Makefile. The needed
space depends on the features selected in main.c
- Set baudrate in main.c, a doublespeed configuration-option
is available too.
- Change the F_CPU in main.c to the clock-frequency
of your board. See the datasheet for frequencies
with minimum error at the selected baudrate.
- Select the start-condition in main.c.
- Please use at least avr-gcc 3.3.1/avr-libc 1.0
or WINAVR Sept. 2003 or later to compile and link
this bootloader.
- Upload the hex-File to the AVR (STK500, STK200, SP12
evertool, AVR910 etc.)
- Program the "Boot Flash section size" (BOOTSZ fuses)
according to the boot-size selected in the makefile
i.e. BOOTSZ=00 for boot-size 1024 words (2048 bytes)
on ATmega16
- enable the BOOT Reset Vector fuse (BOOTRST=0)
- Set the lock bits to protect the bootloader from
SPM-writes (Boot Loader Protection Mode 2 in STK500-
plugin) so that it can not overwrite itself.
- Connect the AVR UART Pins via level-shifter/inverter
(i.e. MAX232) to your PCs COM-Port.
- Reset the AVR while fullfilling the bootloader start-
condition. (Default: selected pin connected to GND).
The condition must be "true" until you see the
AVRPROG dialog or avrdude connects.
- Start AVRPROG (AVRStudio/Tools or stand-alone avrprog.exe)
AVRDUDE is supported too, check it's manual
for command-line options. Read the text above for
information about Device-Types and AVRDUDE
- AVRPROG or AVRDUDE should detect the bootloader.
- see AVRStudio's online-help for more information how
to use AVRPROG
- make sure to EXIT from AVRPROG (button) to start
your main-application or toogle power/reset.
Feedback welcome, Good luck.
Martin
======================================================
ATMEL AVR UART Bootloader for AVR-GCC/avr-libc
by Martin Thomas, Kaiserslautern, Germany
mthomas@rhrk.uni-kl.de
eversmith@heizung-thomas.de
http://www.siwawi.arubi.uni-kl.de/avr_projects
** Addtional code and improvements contributed **
** by Uwe Bonnes, Bjoern Riemer and Olaf Rempel. **
Eearly versions of this bootloader-code have been
based on the AVR Butterfly bootloader-source REV02
which has been available from atmel.com.
======================================================
Programming-Software (on the "PC-Side"):
* AVRProg (included in AVRStudio) available at www.atmel.com.
MS-Windows only. AVRProg can be used as stand-alone application.
(avrprog.exe)
* avrdude available at http://savannah.nongnu.org/projects/avrdude/
"Multiplattform"
* Installation instructions at the end of this file.
3. Dec. 2008 - Version 0.85
* disable U2X before jump to app as suggested be Alexander D<>ller
* moved UBRR-macros to main.c and changed them. Inspired by code from avr-libc setbaud.
(macros which are commented out (//) are from Pavel Fertser)
6. Nov. 2008 - Version 0.84
* Added definitions for ATmega64 provided by Pavel Fertser - Thanks.
12. Apr. 2008 - Version 0.83
* Added definitions for ATmega644P and ATmega324P
* Tested with ATmega324P, gcc 4.2.2, avr-libc 1.4.6
* Added testapp to verify "exit bootloader" with
watchdog (n.b.: watchdog-disable called early in testapp)
27. Jan. 2007 - Version 0.82
* Added definitions for ATmega644.
* Using avr-lib's eeprom-functions (old "direct-access"-code
has not been compatible with ATmega644).
* Watchdog-disable at startup (configurable): avoids problems with
repeated login to bootloader. Not needed if the bootloader is
never re-entered again between an "exit programming" and
a system-reset/power-toogle.
* Additional watchdog disable-function for ATmega644.
* Made watchdog-enable time at exit-programming a configuration-value
(define).
* Bootloader read-protection: if enabled the bootloader fakes
an empty boot-section (configurable by define)
Since more of the avr-libc functions's are used this version
should be more portable for other AVRs but the size of the
binary increases a little bit.
Make sure to disable the watchdog early in the user-application
esp. when using a "modern" AVR (i.e. ATmega48/88/168/644/324P/644P).
3. Dec. 2006 - Version 0.81
* Added definitions for ATmega162.
* Fixed init for double-speed (bitmask). Thanks to Bernhard Roth
28. May 2006 - Version 0.8beta3
* Supports discarding of interrupt-vectors which saves some space
if no interrupts are needed in the bootloader. Added option
in makefile to enable this feature, modified LDFLAGS,
additional code in main.c for a pseudo default_interrupt ISR.
The modified linker-scripts have been contributed by
Olaf Rempel (basicly just the .vector-section is not linked).
* Reverted the order of signatur-byte-numbers in part-
configurations to the usual order in the datasheet,
also reverted in main.c for sending the signature.
* Definitions for lock/fuse-readout.
* Updated installation-instruction at the end of this file.
* Added DEVTYPE_ISP/DEVTYPE_BOOT to part-configurations,
added configuration-option for this in main.c.
* A remark about the DEVTYPE: Usualy there are two
Part-Codes/Device-Codes. One is for ISP: AVRProg shows
the type of the AVR. The other code is for bootloading:
AVRprog shows the type plus "BOOT". When a boot-device-code
gets detected by AVRprog it "knows" how do handle the
limited functionality of bootloaders. (When receiving the
ISP-code AVRProg expects an AVR910-type programmer.)
The offset between the codes is usualy 0x01 where the
ISP-code is the smaller value, i.e. ATmega32 ISP-code
is 0x72->"ATmega32" and boot-code is 0x73->"ATmega32 BOOT".
When using avrdude the bootloader's device-code must match
the device-code in the avrdude.conf. Check the avrdude-
code to see if both codes (AVR910 and AVR109) are supported.
-- I have got some e-mails from users which have been
confused by this. Hopefully this explanation is good enough.
* This bootloader lets the watchdog do a reset when the
user selects "Exit programmer" (i.e. in AVRProg) after an
update. Make sure to disable or reset the watchdog early in
your application.
27. May 2006 - Version 0.8beta2
* More very well done improvements contributed by Olaf Rempel.
* Olaf Rempel also modified the STARTUP_WAIT method.
21. May 2006 - Version 0.8beta
* Version contributed by Olaf Rempel. He has done a lot of modifications.
-> "cleaner code", smaller binaries.
09. Feb. 2006 - Version 0.75
* additional STARTUP_WAIT support contributed by Bjoern Riemer
18. Aug. 2005 - Version 0.74
* AT90CAN128 support contributed by Uwe Bonnes
* Makefile modifications contributed by Uwe Bonnes
23. Feb. 2005 - Version 0.7
* (Version 0.6 has never been available on the web-page)
* ATmega128 support
* code cleanup
* This version has been tested with ATmega8, ATmega32 and
ATmega128
7. Apr. 2004 - Version 0.5
* added different startup-methods
* compatible with ATmega8 now
* included makefile adapted to ATmega8 now
(ATmega16 options still available)
* fixed jump to application which did not work
reliably before
* tested with ATmega8
* minimal options and startup-code result in
bootloader-size < 512 words
6. Apr. 2004 - Version 0.4
* Buffered read of chars from UART during programming
since eeprom-write is too slow for unbuffered
operation. So EEPROM-upload does work now.
* Added BOOTICE-mode to flash JTAGICE-compatible
hardware (ATmega16@7,3Mhz) (if you know about BOOTICE,
you may unterstand why this has been added, if not
just keep the option disabled)
* small changes in (my)boot.h (lock-bit-mask) found
out during the development of the STK-500-compatible
bootloader. But setting lock-bits still does not
work with this bootloader.
* read of the low-fuse byte works (high byte still TODO)
* read of the lock-byte works (write still TODO)
27. Mar 2004 - Version 0.3
Felt that as much functions from avr-libc's boot.h
as possible should be used without modifications.
Latest CVS-version of boot.h is included.
Only the read-routine is still "self-made" based
on ATMELs assembler-code.
EEPROM write on Mega16 does not work (and did not
work with V0.2 too). May be caused by my old Mega16
chip. Needs testing. Flash read/write and EEPROM
read works. Still only tested with ATmega16.
This version may not work with the ATmega169 any
more.
24. Mar 2004 - Version 0.2
During the development of a data-logger application
with the AVR-Butterfly there was a need to make
some changes in the bootloader. The same problem
again: no IAR compiler. The same way to solve the
problem: a port of the code to avr-gcc/avr-libc.
So this code is based on the ATMEL Butterfly
bootloader source code Rev 0.2 for IAR.
The bootloader-port for the Butterfly which mimics
the complete functionality of the original
BF-bootloader is availabe at:
www.siwawi.arubi.uni-kl.de/avr_projects
Atmel used a separate "lib" written in "pure"
assembly to access the low-level functions
for flash read/write. Well, so far I
don't know how to use "mixed language sources"
with the avr-gcc toolchain, so the low-level
routines have been implemented as inline assembler.
The avr-libc boot.h module written by Eric
Weddington served as a template Three of the four
low-level routines found in lowlevel.c come from
boot.h with minimal changes. The read routine has
been developed based on the ATMEL assembler code.
Ignore the fuse and lock-bit readout. Read and Set is
not enabled (TODO).
--------------- Installation -----------------
- Change the MCU type in the makefile.
- Change the boot(loader)-size in Makefile. The needed
space depends on the features selected in main.c
- Set baudrate in main.c, a doublespeed configuration-option
is available too.
- Change the F_CPU in main.c to the clock-frequency
of your board. See the datasheet for frequencies
with minimum error at the selected baudrate.
- Select the start-condition in main.c.
- Please use at least avr-gcc 3.3.1/avr-libc 1.0
or WINAVR Sept. 2003 or later to compile and link
this bootloader.
- Upload the hex-File to the AVR (STK500, STK200, SP12
evertool, AVR910 etc.)
- Program the "Boot Flash section size" (BOOTSZ fuses)
according to the boot-size selected in the makefile
i.e. BOOTSZ=00 for boot-size 1024 words (2048 bytes)
on ATmega16
- enable the BOOT Reset Vector fuse (BOOTRST=0)
- Set the lock bits to protect the bootloader from
SPM-writes (Boot Loader Protection Mode 2 in STK500-
plugin) so that it can not overwrite itself.
- Connect the AVR UART Pins via level-shifter/inverter
(i.e. MAX232) to your PCs COM-Port.
- Reset the AVR while fullfilling the bootloader start-
condition. (Default: selected pin connected to GND).
The condition must be "true" until you see the
AVRPROG dialog or avrdude connects.
- Start AVRPROG (AVRStudio/Tools or stand-alone avrprog.exe)
AVRDUDE is supported too, check it's manual
for command-line options. Read the text above for
information about Device-Types and AVRDUDE
- AVRPROG or AVRDUDE should detect the bootloader.
- see AVRStudio's online-help for more information how
to use AVRPROG
- make sure to EXIT from AVRPROG (button) to start
your main-application or toogle power/reset.
Feedback welcome, Good luck.
Martin

284
comm.c
View File

@ -1,142 +1,142 @@
#include "defines.h"
#include <inttypes.h>
#include <util/delay.h>
#include "comm.h"
#include "usart.h"
static uint8_t comm_send_crc;
static unsigned int comm_send_length;
static unsigned int comm_send_pos;
static int comm_recv_pos;
static uint8_t comm_recv_crc;
static uint8_t comm_recv_error;
volatile uint8_t comm_recv_command;
volatile unsigned int comm_recv_length;
volatile uint8_t recv_buffer[RECV_BUFFER];
volatile uint8_t comm_recv_done;
static void comm_calc_send_crc(uint8_t inbyte)
{
uint8_t j;
for (j=0;j<8;j++)
{
uint8_t mix = (comm_send_crc ^ inbyte) & 0x01;
comm_send_crc >>= 1;
if (mix)
comm_send_crc ^= 0x8C;
inbyte >>= 1;
}
}
static void comm_calc_recv_crc(uint8_t inbyte)
{
uint8_t j;
for (j=0;j<8;j++)
{
uint8_t mix = (comm_recv_crc ^ inbyte) & 0x01;
comm_recv_crc >>= 1;
if (mix)
comm_recv_crc ^= 0x8C;
inbyte >>= 1;
}
}
static void comm_send_and_calc(uint8_t data)
{
comm_calc_send_crc(data);
USART_TransmitByte(data);
#ifdef SEND_DELAY
_delay_us(SEND_DELAY);
#endif
}
void comm_start(uint8_t command, unsigned int length)
{
comm_send_crc = 0;
comm_send_and_calc('F');
comm_send_and_calc(command);
comm_send_and_calc(length & 0xff);
comm_send_and_calc((length >> 8) & 0xff);
comm_send_length = length;
comm_send_pos = 0;
if (!comm_send_length)
USART_TransmitByte(comm_send_crc);
}
void comm_send_byte(uint8_t data)
{
comm_send_and_calc(data);
comm_send_pos++;
if (comm_send_pos == comm_send_length)
USART_TransmitByte(comm_send_crc);
}
void comm_proceed(uint8_t data)
{
if (comm_recv_error && data != 'F') return;
comm_recv_error = 0;
if (!comm_recv_pos)
{
comm_recv_crc = 0;
comm_recv_done = 0;
}
comm_calc_recv_crc(data);
unsigned int l = comm_recv_pos-4;
switch (comm_recv_pos)
{
case 0:
if (data != 'F')
{
comm_recv_error = 1;
comm_start(COMMAND_ERROR_INVALID, 0);
}
break;
case 1:
comm_recv_command = data;
break;
case 2:
comm_recv_length = data;
break;
case 3:
comm_recv_length |= (uint16_t)data << 8;
break;
default:
if (l >= RECV_BUFFER)
{
comm_recv_pos = 0;
comm_recv_error = 1;
comm_start(COMMAND_ERROR_OVERFLOW, 0);
return;
}
else if (l < comm_recv_length)
{
recv_buffer[l] = data;
} else if (l == comm_recv_length)
{
if (!comm_recv_crc)
{
comm_recv_done = 1;
}
else
{
comm_recv_error = 1;
comm_start(COMMAND_ERROR_CRC, 0);
}
comm_recv_pos = 0;
return;
}
break;
}
comm_recv_pos++;
}
void comm_init()
{
comm_recv_pos = 0;
comm_recv_done = 0;
comm_recv_error = 0;
}
#include "defines.h"
#include <inttypes.h>
#include <util/delay.h>
#include "comm.h"
#include "usart.h"
static uint8_t comm_send_crc;
static unsigned int comm_send_length;
static unsigned int comm_send_pos;
static int comm_recv_pos;
static uint8_t comm_recv_crc;
static uint8_t comm_recv_error;
volatile uint8_t comm_recv_command;
volatile unsigned int comm_recv_length;
volatile uint8_t recv_buffer[RECV_BUFFER];
volatile uint8_t comm_recv_done;
static void comm_calc_send_crc(uint8_t inbyte)
{
uint8_t j;
for (j=0;j<8;j++)
{
uint8_t mix = (comm_send_crc ^ inbyte) & 0x01;
comm_send_crc >>= 1;
if (mix)
comm_send_crc ^= 0x8C;
inbyte >>= 1;
}
}
static void comm_calc_recv_crc(uint8_t inbyte)
{
uint8_t j;
for (j=0;j<8;j++)
{
uint8_t mix = (comm_recv_crc ^ inbyte) & 0x01;
comm_recv_crc >>= 1;
if (mix)
comm_recv_crc ^= 0x8C;
inbyte >>= 1;
}
}
static void comm_send_and_calc(uint8_t data)
{
comm_calc_send_crc(data);
USART_TransmitByte(data);
#ifdef SEND_DELAY
_delay_us(SEND_DELAY);
#endif
}
void comm_start(uint8_t command, unsigned int length)
{
comm_send_crc = 0;
comm_send_and_calc('F');
comm_send_and_calc(command);
comm_send_and_calc(length & 0xff);
comm_send_and_calc((length >> 8) & 0xff);
comm_send_length = length;
comm_send_pos = 0;
if (!comm_send_length)
USART_TransmitByte(comm_send_crc);
}
void comm_send_byte(uint8_t data)
{
comm_send_and_calc(data);
comm_send_pos++;
if (comm_send_pos == comm_send_length)
USART_TransmitByte(comm_send_crc);
}
void comm_proceed(uint8_t data)
{
if (comm_recv_error && data != 'F') return;
comm_recv_error = 0;
if (!comm_recv_pos)
{
comm_recv_crc = 0;
comm_recv_done = 0;
}
comm_calc_recv_crc(data);
unsigned int l = comm_recv_pos-4;
switch (comm_recv_pos)
{
case 0:
if (data != 'F')
{
comm_recv_error = 1;
comm_start(COMMAND_ERROR_INVALID, 0);
}
break;
case 1:
comm_recv_command = data;
break;
case 2:
comm_recv_length = data;
break;
case 3:
comm_recv_length |= (uint16_t)data << 8;
break;
default:
if (l >= RECV_BUFFER)
{
comm_recv_pos = 0;
comm_recv_error = 1;
comm_start(COMMAND_ERROR_OVERFLOW, 0);
return;
}
else if (l < comm_recv_length)
{
recv_buffer[l] = data;
} else if (l == comm_recv_length)
{
if (!comm_recv_crc)
{
comm_recv_done = 1;
}
else
{
comm_recv_error = 1;
comm_start(COMMAND_ERROR_CRC, 0);
}
comm_recv_pos = 0;
return;
}
break;
}
comm_recv_pos++;
}
void comm_init()
{
comm_recv_pos = 0;
comm_recv_done = 0;
comm_recv_error = 0;
}

110
comm.h
View File

@ -1,54 +1,56 @@
#include <inttypes.h>
#define COMMAND_PRG_STARTED 0
#define COMMAND_CHR_STARTED 1
#define COMMAND_ERROR_INVALID 2
#define COMMAND_ERROR_CRC 3
#define COMMAND_ERROR_OVERFLOW 4
#define COMMAND_PRG_INIT 5
#define COMMAND_CHR_INIT 6
#define COMMAND_PRG_READ_REQUEST 7
#define COMMAND_PRG_READ_RESULT 8
#define COMMAND_PRG_WRITE_REQUEST 9
#define COMMAND_PRG_WRITE_DONE 10
#define COMMAND_CHR_READ_REQUEST 11
#define COMMAND_CHR_READ_RESULT 12
#define COMMAND_CHR_WRITE_REQUEST 13
#define COMMAND_CHR_WRITE_DONE 14
#define COMMAND_PHI2_INIT 15
#define COMMAND_PHI2_INIT_DONE 16
#define COMMAND_MIRRORING_REQUEST 17
#define COMMAND_MIRRORING_RESULT 18
#define COMMAND_RESET 19
#define COMMAND_RESET_ACK 20
#define COMMAND_PRG_EPROM_WRITE_REQUEST 21
#define COMMAND_CHR_EPROM_WRITE_REQUEST 22
#define COMMAND_EPROM_PREPARE 23
#define COMMAND_PRG_FLASH_ERASE_REQUEST 24
#define COMMAND_PRG_FLASH_WRITE_REQUEST 25
#define COMMAND_CHR_FLASH_ERASE_REQUEST 26
#define COMMAND_CHR_FLASH_WRITE_REQUEST 27
#define COMMAND_JTAG_SETUP 28
#define COMMAND_JTAG_SHUTDOWN 29
#define COMMAND_JTAG_EXECUTE 30
#define COMMAND_JTAG_RESULT 31
#define COMMAND_TEST_SET 32
#define COMMAND_TEST_RESULT 33
#define COMMAND_COOLBOY_READ_REQUEST 34
#define COMMAND_COOLBOY_ERASE_REQUEST 35
#define COMMAND_COOLBOY_WRITE_REQUEST 36
#define COMMAND_COOLGIRL_ERASE_SECTOR_REQUEST 37
#define COMMAND_COOLGIRL_WRITE_REQUEST 38
#define COMMAND_BOOTLOADER 0xFE
#define COMMAND_DEBUG 0xFF
void comm_init();
void comm_start(uint8_t command, unsigned int length);
void comm_send_byte(uint8_t data);
void comm_proceed(uint8_t data);
extern volatile uint8_t comm_recv_command;
extern volatile unsigned int comm_recv_length;
extern volatile uint8_t recv_buffer[RECV_BUFFER];
extern volatile uint8_t comm_recv_done;
#include <inttypes.h>
#define COMMAND_PRG_STARTED 0
#define COMMAND_CHR_STARTED 1
#define COMMAND_ERROR_INVALID 2
#define COMMAND_ERROR_CRC 3
#define COMMAND_ERROR_OVERFLOW 4
#define COMMAND_PRG_INIT 5
#define COMMAND_CHR_INIT 6
#define COMMAND_PRG_READ_REQUEST 7
#define COMMAND_PRG_READ_RESULT 8
#define COMMAND_PRG_WRITE_REQUEST 9
#define COMMAND_PRG_WRITE_DONE 10
#define COMMAND_CHR_READ_REQUEST 11
#define COMMAND_CHR_READ_RESULT 12
#define COMMAND_CHR_WRITE_REQUEST 13
#define COMMAND_CHR_WRITE_DONE 14
#define COMMAND_PHI2_INIT 15
#define COMMAND_PHI2_INIT_DONE 16
#define COMMAND_MIRRORING_REQUEST 17
#define COMMAND_MIRRORING_RESULT 18
#define COMMAND_RESET 19
#define COMMAND_RESET_ACK 20
#define COMMAND_PRG_EPROM_WRITE_REQUEST 21
#define COMMAND_CHR_EPROM_WRITE_REQUEST 22
#define COMMAND_EPROM_PREPARE 23
#define COMMAND_PRG_FLASH_ERASE_REQUEST 24
#define COMMAND_PRG_FLASH_WRITE_REQUEST 25
#define COMMAND_CHR_FLASH_ERASE_REQUEST 26
#define COMMAND_CHR_FLASH_WRITE_REQUEST 27
#define COMMAND_JTAG_SETUP 28
#define COMMAND_JTAG_SHUTDOWN 29
#define COMMAND_JTAG_EXECUTE 30
#define COMMAND_JTAG_RESULT 31
#define COMMAND_TEST_SET 32
#define COMMAND_TEST_RESULT 33
#define COMMAND_COOLBOY_READ_REQUEST 34
#define COMMAND_COOLBOY_ERASE_REQUEST 35
#define COMMAND_COOLBOY_WRITE_REQUEST 36
#define COMMAND_COOLGIRL_ERASE_SECTOR_REQUEST 37
#define COMMAND_COOLGIRL_WRITE_REQUEST 38
#define COMMAND_PRG_CRC_READ_REQUEST 39
#define COMMAND_CHR_CRC_READ_REQUEST 40
#define COMMAND_BOOTLOADER 0xFE
#define COMMAND_DEBUG 0xFF
void comm_init();
void comm_start(uint8_t command, unsigned int length);
void comm_send_byte(uint8_t data);
void comm_proceed(uint8_t data);
extern volatile uint8_t comm_recv_command;
extern volatile unsigned int comm_recv_length;
extern volatile uint8_t recv_buffer[RECV_BUFFER];
extern volatile uint8_t comm_recv_done;

View File

@ -1,12 +1,12 @@
#define F_CPU 8000000UL
//#define F_CPU 11059200UL
//#define UART_BAUD 38400UL
#define UART_BAUD 250000UL
#define RECV_BUFFER 1050
//#define SEND_DELAY 100
#define JTAG_PORT B
#define TMS_PIN 2
#define TCK_PIN 4
#define TDO_PIN 3
#define TDI_PIN 1
#define F_CPU 8000000UL
//#define F_CPU 11059200UL
//#define UART_BAUD 38400UL
#define UART_BAUD 250000UL
#define RECV_BUFFER 1050
//#define SEND_DELAY 100
#define JTAG_PORT B
#define TMS_PIN 2
#define TCK_PIN 4
#define TDO_PIN 3
#define TDI_PIN 1

1870
dumper.c

File diff suppressed because it is too large Load Diff

View File

@ -1,387 +1,366 @@
:100000000C9446000C9458000C9458000C94580022
:100010000C9458000C9458000C9458000C94580000
:100020000C9458000C9458000C9458000C945800F0
:100030000C9458000C9458000C9458000C945800E0
:100040000C9458000C9458000C943B080C945800E5
:100050000C9458000C9458000C9458000C945800C0
:100060000C9458000C9458000C9458000C945800B0
:100070000C9458000C9458000C9458000C945800A0
:100080000C9458000C9458000C94580011241FBE76
:10009000CFEFD0E1DEBFCDBF15E0A0E0B1E001C001
:1000A0001D92AC33B107E1F70E94BA010C940E0C1B
:1000B0000C9400008BBB95BB95FD06C0809162003F
:1000C0008061809362000895809162008F7E8093AA
:1000D000620008950F931F938C018FEF82BB11BABA
:1000E00080916200806880936200C8010E945A007B
:1000F0008091620081608093620017FD0CC0809146
:10010000620082608093620082E08A95F1F780B39A
:100110001F910F910895809162008D7F80936200FE
:10012000F3CF0F931F932FEF22BB11BA02E610E01B
:10013000F8012081216020832081226020830E9499
:100140005A00F80180818F7D808382E08A95F1F7E3
:1001500080B39081906290831F910F9108950F93C7
:100160001F932FEF22BB11BA02E610E0F8012081A5
:10017000206820830E945A00F8018081816080837A
:1001800080818D7F8083C39AC49882E08A95F1F73D
:1001900080B31F910F9108950F931F938C0180914D
:1001A00062008E7F80936200809162008260809303
:1001B00062008FEF81BB809162008F778093620035
:1001C00062BBC8010E945A008091620081608093E6
:1001D000620017FD29C080916200826080936200F6
:1001E00092E0892F8A95F1F7809162008E7F80934B
:1001F00062009A95F1F780916200826080936200BC
:10020000809162008068809362008FEF82BB11BA98
:1002100080E090E00E945A008091620081608093AB
:1002200062001F910F910895809162008D7F8093ED
:100230006200D6CFFF920F931F9302E610E0F80101
:1002400020812E7F2083208122602083FF24FA9446
:10025000F1BA62BB0E945A00F80180818B7F8083D3
:10026000808184608083F2BA11BA80E090E00E94BD
:100270005A00F8018081816080831F910F91FF9067
:10028000089590680E94CC000895EF92FF920F931A
:100290001F93F62EC49AC39A02E610E0F80120815B
:1002A000226020832081206820830E945A00EE244F
:1002B000EA94E1BAF2BAF80180818160808380819A
:1002C0008D7F808382E0982F9A95F1F7C3988A9565
:1002D000F1F7C39A80E090E00E945A00F801808113
:1002E00082608083E2BA11BA1F910F91FF90EF9064
:1002F00008951F9382E164E070E00E94E608C69AC8
:1003000080E090E00E945A0012E0812F8A95F1F778
:1003100081B18695869581700E94CE0880E094E038
:100320000E945A00812F8A95F1F781B186958695B2
:1003300081700E94CE0880E098E00E945A00812FD0
:100340008A95F1F781B18695869581700E94CE08D5
:1003500080E09CE00E945A001A95F1F781B18695E1
:10036000869581700E94CE0880E090E00E945A003D
:100370001F9108953F924F925F926F927F928F925A
:100380009F92AF92BF92CF92DF92EF92FF920F9324
:100390001F93DF93CF93CDB7DEB7A8970FB6F8942E
:1003A000DEBF0FBECDBF78940E94640887B3806C17
:1003B00087BB87EB809361001FEF10936200129858
:1003C0001A9A12BB11BA80E090E00E945A001ABB40
:1003D00014BB0E94B609C798C6980E94AF0880E077
:1003E00060E070E00E94E60855E8352E4AE1C42E30
:1003F0008FB589628FBD8EB581608EBD21E030E002
:1004000040E050E0E0E060E070E08091200188236F
:1004100009F043C08FB589628FBD8EB581608EBDF6
:10042000203187E2380780E0480780E0580708F469
:100430005FC0EE2309F066C06F5F7F4F6E367105B7
:100440000CF0E1E06436710534F06456704079BD1B
:1004500068BD6C597F4FEE2309F44FC08EE690E0E3
:10046000861B970B853191050CF047C08B309105A9
:100470002CF024E130E0281B390BC901880F991FAB
:10048000909379008093780020E030E040E050E0E5
:1004900080912001882309F4BDCF10922001109291
:1004A000790010927800809178009091790099BD40
:1004B00088BD88B599B58FBD80912101893109F436
:1004C00023C58A3148F58B3009F4AEC48C3008F06E
:1004D00079C1863009F46EC4873008F0A6C1853032
:1004E00009F086CF80E060E070E00E94E60880CFEF
:1004F0002F5F3F4F4F4F5F4F88CF20E030E040E00D
:1005000050E083CF6150704009F09CCF20E030E094
:1005100040E050E0E0E079CF823209F4B6C48332A3
:1005200008F090C08C3109F4ADC48D3108F00DC2D3
:100530008A3109F433C28B3109F05ACF90912201EC
:10054000809123018AA319A2A92EBB24E9A1FAA1B3
:10055000AE2ABF2A90912401809125018CA31BA271
:10056000892E99242BA13CA1822A932AC79AB7FCF1
:100570007DC58114910409F45EC0EE24FF24870137
:100580000A0D1B1DF701EE5DFE4FD48080E090E068
:1005900060EF0E941A0185E595E06AEA0E941A015F
:1005A0008AEA92E065E50E941A0185E595E060EA35
:1005B0000E941A01C8016D2D0E941A01106866245C
:1005C000772407C088EC90E00197F1F70894611C4C
:1005D000711CC8010E949100D816A1F09AE069161A
:1005E000710481F780E090E00E945A0080916200DF
:1005F0008E7F8093620080916200826080936200AF
:10060000C798F6CE80E090E00E945A008091620088
:100610008E7F80936200809162008260809362008E
:10062000EAE06E16710464F70894E11CF11C8E1464
:100630009F0409F0A4CFC7988EE060E070E00E94AC
:10064000E608D6CE853209F4ACC2863208F071C114
:10065000833209F41CC3843209F0CACE30912201DE
:100660002091230190912401809125018A8B198A80
:10067000A92EBB2489899A89A82AB92AC79AC49A1B
:10068000C39ABC9ABB9A8091620082608093620098
:10069000A114B10409F4CDC42C8B1B8AE32FF0E024
:1006A0002B893C89E22BF32BF8A7EFA396E2492E86
:1006B00091E0592E2FA138A5207E32018FA098A459
:1006C00010E005C0C401807E2817390789F4F301C2
:1006D00080818F3F09F01F5F0894811C911C089452
:1006E000A108B1080894611C711CA114B10451F750
:1006F000112341F4A114B10409F49BC498A68FA25C
:100700002301D8CF8AEA9AE06AEA0E94450185E58A
:1007100095E065E50E94450180E090E065E20E9479
:100720004501612F615080E090E00E94450101C0C9
:100730002C01F20160816F3F29F08FA198A50E94E2
:10074000450111502FA138A52F5F3F4F38A72FA388
:10075000C2010196112361F780E090E069E20E94F6
:1007600045018C2D8A95F1F7DD24EE24FF248701C5
:100770008FA198A50197906898A78FA312C08C2D80
:100780008A95F1F70894E11CF11C011D111DF0EA96
:10079000EF16F6E8FF06F1E00F07F0E01F07E1F1C2
:1007A000D92E8FA198A50E94AF00982F809162004A
:1007B0008260809362009D1511F7F2018081D81646
:1007C000F1F698CF813109F45FC2823108F067C039
:1007D0008D3009F4F5C28F3009F00ACE80916200A5
:1007E00081608093620030916200809162008E7F10
:1007F000809362002091620080E890E02BBB3BBBBD
:100800000197E1F780E160E070E00E94E608F0CD3A
:1008100080E090E00E945A008091620082608093A4
:1008200062000E94B609C798E3CD873009F486C2FA
:10083000893009F0DDCD3091220120912301909182
:100840002401809125018E831D82E92EFF248D8154
:100850009E81E82AF92AC79AE114F104C9F0288791
:100860001F82032F10E0EF81F8850E2B1F2BAA2487
:10087000BB24F501EE5DFE4FC501800F911F648121
:100880000E94CC000894A11CB11CEA14FB0489F757
:10089000C7988AE060E070E00E94E608A9CD833145
:1008A00009F4D0C1883109F0A3CDC79A80E090E067
:1008B00060EF0E9441018AEA9AE06AEA0E944101DF
:1008C00085E595E065E50E9441018AEA9AE060E8E5
:1008D0000E9441018AEA9AE06AEA0E94410185E5A4
:1008E00095E065E50E9441018AEA9AE060E10E9494
:1008F000410104C080ED97E00197F1F780E090E8B6
:100900000E946A008F3FB1F780E090E00E945A0099
:1009100080916200816080936200809162008260B9
:1009200080936200C7988AE060E070E00E94E60869
:100930005FCD863209F47EC08E3F09F059CDF89420
:1009400014BEE0E0F8EF099553CD8D31E1F08E3122
:1009500009F04ECD00912201F09023018FE161E07A
:1009600070E00E94E608C79AFEA21DA210E08DA1C9
:100970009EA1802B912B64E271E00E94BD090E9430
:10098000CE08C79835CD0E94B6098FE161E070E0CE
:100990000E94E60881E00E94CE082ACDC79A80E036
:1009A00090E060EF0E941A0185E595E06AEA0E94F6
:1009B0001A018AEA92E065E50E941A0185E595E050
:1009C00060E80E941A0185E595E06AEA0E941A0132
:1009D0008AEA92E065E50E941A0185E595E060E10A
:1009E0000E941A0100E010E00BC037E2003113074B
:1009F00009F42DC380ED97E00197F1F70F5F1F4FCA
:100A000080E090E00E9491008F3F79F780E090E0D5
:100A10000E945A0080916200816080936200809100
:100A20006200826080936200C798005117420CF008
:100A3000DFCC02CE3091220120912301909124013C
:100A4000809125018E8B1D8AA92EBB248D899E89BC
:100A5000A82AB92AC79A80916200826080936200B6
:100A6000A114B10409F4D9C2288F1F8AE32FF0E042
:100A70002F89388DE22BF32BF8A7EFA386E2482EBF
:100A800081E0582E2FA138A5207E32018FA098A496
:100A900010E005C0C401807E2817390789F4F301EE
:100AA00080818F3F09F01F5F0894811C911C08947E
:100AB000A108B1080894611C711CA114B10451F77C
:100AC000112341F4A114B10409F4A7C298A68FA27E
:100AD0002301D8CF8AEA9AE06AEA0E94410185E5BB
:100AE00095E065E50E94410180E090E065E20E94AA
:100AF0004101612F615080E090E00E94410101C0FE
:100B00002C01F20160816F3F29F08FA198A50E940E
:100B1000410111502FA138A52F5F3F4F38A72FA3B8
:100B2000C2010196112361F780E090E069E20E9422
:100B300041018C2D8A95F1F7DD24EE24FF248701F5
:100B40008FA198A50197906898A78FA312C08C2DAC
:100B50008A95F1F70894E11CF11C011D111DF0EAC2
:100B6000EF16F6E8FF06F1E00F07F0E01F0791F03F
:100B7000D92E8FA198A50E946A00982F80916200BB
:100B80008260809362009D1511F7F2018081D81672
:100B9000F1F698CF80916200826080936200C798DE
:100BA00027CCC79A80E090E060EF0E9441018AEA7A
:100BB0009AE06AEA0E94410185E595E065E50E94B8
:100BC00041018AEA9AE060E80E9441018AEA9AE0DB
:100BD0006AEA0E94410185E595E065E50E944101D0
:100BE00080E090E060E30E94410100E010E00BC073
:100BF0002BE0083B120709F42AC280ED97E0019729
:100C0000F1F70F5F1F4F80E090E80E946A008F3F6E
:100C100079F780E090E00E945A0080916200816044
:100C20008093620080916200826080936200C79826
:100C3000085B1B400CF0DCCB8AE060E070E00E94B7
:100C4000E608D6CBC79AC69A809162008E7F8093C1
:100C500062008091620082608093620020E137E24E
:100C600088EC90E00197F1F721503040C9F780916E
:100C70006200816080936200C798C69884E160E05A
:100C800070E00E94E608B4CB0E947901B1CBC79A0C
:100C9000C49AC39ABC9ABB9A809162008260809386
:100CA000620080E090E060EF0E9445018AEA9AE0ED
:100CB0006AEA0E94450185E595E065E50E944501E7
:100CC0008AEA9AE060E80E9445018AEA9AE06AEAC4
:100CD0000E94450185E595E065E50E94450180E0BB
:100CE00090E060E30E94450100E010E00BC09BE053
:100CF000083B190709F48CCD80ED97E00197F1F7D7
:100D00000F5F1F4F80E090E80E94AF008F3F79F7A0
:100D100080E090E00E945A0080916200826080939F
:100D200062000E94B609C798085B1B400CF060CBBC
:100D30008AE060E070E00E94E6085ACBE090220171
:100D4000F090230190912401809125018A831982DA
:100D5000092F10E089819A81082B192BC69A88E007
:100D6000B8010E94E60801151105A1F0FC821B8262
:100D7000FF24EB81FC81EE2AFF2AC7010E946A0052
:100D80000E94CE08015010400894E11CF11C01158E
:100D9000110599F780E090E00E945A00809162006E
:100DA0008160809362008091620082608093620023
:100DB000C6981ECB81E060E070E00E94E60818CB88
:100DC00030912201209123019091240180912501ED
:100DD0008E8F1D8EE92EFF24ED8DFE8DEE2AFF2ACB
:100DE000C79AE114F104C9F028A31F8E032F10E065
:100DF0002F8D38A1022B132BAA24BB24F501EE5D05
:100E0000FE4FC501800F911F64810E941A01089452
:100E1000A11CB11CEA14FB0489F7C7988EE060E0BE
:100E200070E00E94E608E4CAE0902201F0902301FD
:100E300090912401809125018A8F198E092F10E04D
:100E4000298D3A8D022B132BC69A8CE0B8010E9493
:100E5000E6080115110509F49DCFFC8E1B8EFF24B9
:100E60008B8D9C8DE82AF92AC7010E9491000E946F
:100E7000CE08015010400894E11CF11C0115110529
:100E800099F788CF0E94AC0980CDE0902201F090C4
:100E9000230190912401809125018A871986092FC9
:100EA00010E029853A85022B132BC69AC49AC39A5F
:100EB000BC9ABB9A88E0B8010E94E60801151105AA
:100EC000A1F0FC861B86FF248B859C85E82AF92AE5
:100ED000C7010E94AF000E94CE0801501040089444
:100EE000E11CF11C0115110599F780E090E00E94CA
:100EF0005A0080916200826080936200C49AC39A13
:100F00000E94B609C69874CA30912201209123012B
:100F100090912401809125018E871D86692E77246A
:100F2000ED85FE856E2A7F2AC79A6114710409F443
:100F3000AFCC288B1F86832E99242F853889822A4F
:100F4000932AAA24BB248501080D191DF501EE5D25
:100F5000FE4FD48080E090E060EF0E94410185E583
:100F600095E06AEA0E9441018AEA92E065E50E9402
:100F7000410185E595E060EA0E944101C8016D2DBF
:100F80000E944101832D8A95F1F7E12C20E8F22E91
:100F9000E02AF12A10E0442455240BC0832D8A95C1
:100FA000F1F70894411C511C88EC4816510451F18A
:100FB000192FC7010E946A00982F809162008260F9
:100FC00080936200911751F7D11641F7809162002A
:100FD00082608093620080E090E00E945A003AE0D4
:100FE000431651040CF00CCB0894A11CB11CA614A0
:100FF000B70409F0A8CFC7988AE060E070E00E94CB
:10100000E608F6C98091620082608093620080E009
:1010100090E00E945A00C798EBC9809162008260FC
:1010200080936200C7988AE060E070E00E94E60862
:10103000DFC9809162008260809362000E94B609DD
:10104000C7988AE060E070E00E94E608D1C980E0BD
:1010500090E00E945A00809162008160809362005B
:1010600080916200826080936200CACA80E090E84A
:10107000A80EB91E7ECA1F920F920FB60F921124AE
:101080002F933F934F935F936F937F938F939F9390
:10109000AF93BF93EF93FF935F9B05C08CB10E940A
:1010A0000B095F99FBCFFF91EF91BF91AF919F919A
:1010B0008F917F916F915F914F913F912F910F9001
:1010C0000FBE0F901F90189581E089B91092900083
:1010D00088E98AB9E5E9F0E0808186608083089537
:1010E0005D9BFECF8CB90895982F92959F709A3092
:1010F00070F4905D8F708A3040F4805D5D9BFECF10
:101100009CB95D9BFECF8CB90895895CF7CF995C43
:10111000F1CFFC018081882339F05D9BFECF8CB933
:10112000319680818823C9F708959C0141155105A6
:101130006105710599F080E090E0A0E0B0E0F90170
:10114000E80FF91FE0815D9BFECFECB90196A11D70
:10115000B11D84179507A607B70788F30895109265
:1011600006011092050110922001109208010895C5
:10117000582F90910001382F20E04CE801C036959F
:10118000892F8327969580FD94272F5F2830B9F704
:1011900090930001852F0E94700808950E94B8085E
:1011A0008091030190910401019690930401809332
:1011B000030120910101309102018217930709F088
:1011C0000895809100010E9470080895FF920F9386
:1011D0001F93F82E8B011092000186E40E94B8083C
:1011E0008F2D0E94B808802F0E94B808812F0E947E
:1011F000B8081093020100930101109204011092AB
:101200000301012B21F4809100010E9470081F91BD
:101210000F91FF900895782F80910801882319F08D
:10122000763409F00895109208014091050150911B
:1012300006014115510509F440C030910701272FDF
:1012400090E06CE801C02695832F8227369580FDBB
:1012500036279F5F9830B9F7309307014130510529
:1012600089F1423051050CF44AC04230510509F46D
:101270003FC04330510579F1FA01349784E0EA31F7
:10128000F80708F053C080911E0190911F01E817E4
:10129000F90708F447C080911E0190911F01E817DB
:1012A000F90791F4332309F04EC081E080932001C7
:1012B00010920601109205010895109207011092F4
:1012C0002001BBCF709321014F5F5F4F5093060108
:1012D00040930501089520911E0130911F01972F21
:1012E00080E0822B932B90931F0180931E01ECCF03
:1012F000872F90E090931F0180931E01E5CF411549
:10130000510509F0B9CF7634F9F281E080930801F4
:1013100082E060E070E00E94E60840910501509193
:101320000601D2CFEE5DFE4F7083CECF1092060144
:101330001092050181E08093080184E060E070E094
:101340000E94E608089581E08093080183E060E050
:1013500070E00E94E608ACCF88B3817F88BB87B37A
:10136000866187BBBB9810920901089588B3817E7E
:1013700088BB87B3817E87BB08952F923F924F929F
:101380005F926F927F928F929F92AF92BF92CF9215
:10139000DF92EF92FF920F931F93DF93CF93CDB71E
:1013A000DEB72A970FB6F894DEBF0FBECDBF9C8381
:1013B0008B837E836D83181619060CF079C02090FC
:1013C0001C0130901D0160901A0170901B0120914A
:1013D0001801309119013A8329838090140190906B
:1013E0001501A0901601B090170140911001509185
:1013F00011016091120170911301E0900C01F090C5
:101400000D0100910E0110910F0180910A01909140
:101410000B019A87898750900901CC24DD24ED8146
:10142000FE81EC0DFD1DE0819DEF591609F443C0CE
:10143000AEEF5A1609F4C1C0552009F06EC05E2EF9
:101440001A8619860894C11CD11C2B813C81C216B6
:10145000D3062CF330921D0120921C0170921B01C7
:1014600060921A0189819A819093190180931801E1
:101470008092140190921501A0921601B09217016A
:101480004093100150931101609312017093130166
:10149000E0920C01F0920D0100930E0110930F01E8
:1014A000A985BA85B0930B01A0930A015092090156
:1014B00021E030E068C029853A85232B09F0BDC0C2
:1014C0008E2E9924AA24BB2440E050E060E070E016
:1014D000EE24FF248701D501C40186709070A070AE
:1014E000B0700097A105B10509F480C08430910562
:1014F000A105B10509F42DC182309105A105B10501
:1015000009F427C10697A105B10509F469C0A985A9
:10151000BA851196BA87A98795CF30921D0120927E
:101520001C0170921B0160921A01A981BA81B093CB
:101530001901A09318018092140190921501A092B4
:101540001601B0921701409310015093110160935E
:10155000120170931301E0920C01F0920D010093BF
:101560000E0110930F01E985FA85F0930B01E093CA
:101570000A015092090188B3817E88BB87B3817EBE
:1015800087BB20E030E0C9012A960FB6F894DEBF91
:101590000FBECDBFCF91DF911F910F91FF90EF90C4
:1015A000DF90CF90BF90AF909F908F907F906F9083
:1015B0005F904F903F902F90089529853A85232B77
:1015C00009F05CC08E2F90E09A8389832224332413
:1015D0006624772489859A8501969A87898732CFF0
:1015E00029853A852830310509F091CF80FE95C0D4
:1015F000C29AC49AE114F1040105110571F020E0CA
:1016000030E088B390E1892788BB88B3892788BBFD
:101610002F5F3F4F2E153F05A1F74115510561057D
:10162000710549F080E090E022E02A95F1F70196FB
:1016300084179507C9F755246ACF89859A85049739
:1016400008F06DC081FC8BC08E2F90E0A0E0B0E070
:1016500029853A852150304E220F331F220F331F28
:10166000220F331F04C0880F991FAA1FBB1F2A9582
:10167000D2F7482B592B6A2B7B2B2DCFA985BA8506
:10168000119709F48DC02114310479F4E7FD0AC0E3
:101690002E2E332429813A816216730608F49ACFDC
:1016A000552498CFA1E02A2E312C8E2F90E0DC011A
:1016B000A170B070F2E04F2E4E22E2FD6AC0EFEF53
:1016C000FFEF2114310409F476C020E030E01EC0A1
:1016D000C29A442001F1C19AC498C49A8FEFEF3F97
:1016E000F80759F086B386958695869590E08170C7
:1016F0009070E817F90709F061C00894611C711C2B
:101700002F5F3F4F2215330508F055C0109701F7A2
:10171000C298442001F7C198DFCFC2986ACF8E2FBC
:1017200090E0A0E0B0E029853A852550304E220FA8
:10173000331F220F331F220F331F04C0880F991F3E
:10174000AA1FBB1F2A95D2F7482B592B6A2B7B2B3C
:10175000C2CEE985FA85349709F0D4CE47CF8E2FD3
:1017600090E0A0E0B0E029853A852150304E220F6C
:10177000331F220F331F220F331F04C0880F991FFE
:10178000AA1FBB1F2A95D2F7E82AF92A0A2B1B2B7E
:10179000A2CEE695E695E695F0E0E170F07091CF87
:1017A000E8871F82E981FA812F813885E22BF32BAC
:1017B000FA83E9830FCF222433246CCF30921D01AA
:1017C00020921C0170921B0160921A01A981BA81BA
:1017D000B0931901A0931801809214019092150101
:1017E000A0921601B092170140931001509311017D
:1017F0006093120170931301E0920C01F0920D01BD
:1018000000930E0110930F01E985FA85F0930B0107
:10181000E0930A018EEF80930901ADCEF894FFCFDB
:00000001FF
:100000000C9446000C9458000C9458000C94580022
:100010000C9458000C9458000C9458000C94580000
:100020000C9458000C9458000C9458000C945800F0
:100030000C9458000C9458000C9458000C945800E0
:100040000C9458000C9458000C947B010C945800AC
:100050000C9458000C9458000C9458000C945800C0
:100060000C9458000C9458000C9458000C945800B0
:100070000C9458000C9458000C9458000C945800A0
:100080000C9458000C9458000C94580011241FBE76
:10009000CFEFD0E1DEBFCDBF25E0A0E0B1E001C0F1
:1000A0001D92AC33B207E1F70E942D050C94600B52
:1000B0000C9400008BBB95BB95FD06C0809162003F
:1000C0008061809362000895809162008F7E8093AA
:1000D00062000895CF93DF932FEF22BB11BAC2E6DF
:1000E000D0E02881216028832881226028830E9413
:1000F0005A0088818F7D888382E08A95F1F700C05D
:1001000080B3988190629883DF91CF910895CF93C7
:10011000DF932FEF22BB11BAC2E6D0E0288120681E
:1001200028830E945A0088818160888388818D7F1E
:100130008883C39AC49882E08A95F1F700C080B39F
:10014000DF91CF9108951F93CF93DF93C2E6D0E064
:1001500028812E7F28832881226028831FEF11BBEE
:1001600062BB0E945A0088818B7F888382E08A95D7
:10017000F1F700C088818460888312BB11BA80E0E7
:1001800090E00E945A00888181608883DF91CF913E
:100190001F910895EF92FF921F93CF93DF931F92C9
:1001A000CDB7DEB7C49AC39A22E6E22EF12CF7014E
:1001B00020812260208320812068208369830E941F
:1001C0005A001FEF11BB698162BBF701808181601A
:1001D000808380818D7F8083F2E0FA95F1F700C003
:1001E000C39882E08A95F1F700C0C39A80E090E05E
:1001F0000E945A00F70180818260808312BB11BA8D
:100200000F90DF91CF911F91FF90EF900895CF93C2
:10021000DF93EC018FEF82BB11BA9091620090687E
:1002200090936200CE010E945A009091620091600A
:100230009093620080916200D7FD0BC08260809332
:10024000620082E08A95F1F700C080B3DF91CF9120
:1002500008958D7F80936200F4CFCF93DF93EC01FC
:10026000909162009E7F90936200909162009260F4
:10027000909362008FEF81BB909162009F77909383
:10028000620062BBCE010E945A00909162009160B0
:100290009093620080916200D7FD29C082608093B4
:1002A000620082E08A95F1F700C0809162008E7F43
:1002B0008093620082E08A95F1F700C0809162002D
:1002C0008260809362008091620080688093620007
:1002D0008FEF82BB11BA80E090E00E945A008091BB
:1002E0006200816080936200DF91CF9108958D7FDD
:1002F00080936200D6CF1F920F920FB60F921124F7
:100300002F933F934F935F936F937F938F939F931D
:10031000AF93BF93EF93FF935F9B05C08CB10E9497
:1003200077025F99FBCFFF91EF91BF91AF919F91C2
:100330008F917F916F915F914F913F912F910F908E
:100340000FBE0F901F90189564E070E082E10E944C
:100350003802C69A80E090E00E945A0082E08A95B6
:10036000F1F700C081B182FB882780F90E9460020A
:1003700080E094E00E945A0082E08A95F1F700C084
:1003800081B182FB882780F90E94600280E098E0BA
:100390000E945A0082E08A95F1F700C081B182FB89
:1003A000882780F90E94600280E09CE00E945A0049
:1003B00082E08A95F1F700C081B182FB882780F93D
:1003C0000E94600280E090E00C945A0081E089B9BC
:1003D0001092900088E98AB9E5E9F0E080818660B2
:1003E000808308955D9BFECF8CB90895982F9295D8
:1003F0009F709A3070F4905D8F708A3040F4805D09
:100400005D9BFECF9CB95D9BFECF8CB90895895C46
:10041000F7CF995CF1CFFC019081992339F03196A7
:100420005D9BFECF9CB991919111FACF0895411532
:1004300051056105710551F0FC01480F591F81916B
:100440005D9BFECF8CB9E417F507C9F7089590912D
:100450000801382F28E05CE8432F4927969540FD96
:10046000952736952150C1F7909308010C94F2011D
:100470001F93CF93DF93182FEB011092080186E4AE
:100480000E942702812F0E9427028C2F0E942702A0
:100490008D2F0E942702D0930701C093060110926E
:1004A000050110920401CD2B21F0DF91CF911F9116
:1004B000089580910801DF91CF911F910C94F20172
:1004C0000E9427028091040190910501019690936A
:1004D00005018093040120910601309107018217E4
:1004E000930709F00895809108010C94F20190910E
:1004F0000001992319F0863409F008951092000143
:1005000060910201709103016115710559F190919B
:100510000101382F28E05CE8492F4327969540FDDC
:10052000952736952150C1F79093010161307105EF
:1005300009F447C0DCF062307105E9F16330710500
:1005400039F520911E0130911F01A901582B5093BC
:100550001F0140931E016F5F7F4F709303016093F3
:10056000020108951092200190E0D3CF611571052A
:1005700079F4863481F381E08093000160E070E0DB
:1005800082E00E9438026091020170910301E3CF82
:100590009B01245031092A3154E0350738F5409148
:1005A0001E0150911F012417350770F4F901EE5D0B
:1005B000FE4F8083D0CF90E090931F0180931E0167
:1005C000CACF80932101C7CF40911E0150911F01D6
:1005D0002417350709F0BFCF81E0911113C0809334
:1005E000200110920301109202010895109203015C
:1005F0001092020181E08093000160E070E084E0ED
:100600000C9438028093000160E070E083E00E9467
:100610003802E7CF109203011092020110922001DC
:1006200010920001089588B3817F88BB87B38661EB
:1006300087BBBB9810921D01089588B3817E88BB4B
:1006400087B3817E87BB08952F923F924F925F922E
:100650006F927F928F929F92AF92BF92CF92DF92D2
:10066000FF920F931F93CF93DF9300D000D000D061
:10067000CDB7DEB7181619060CF082C0FB015B017E
:10068000A80EB91EBE82AD8240E1F42E222423942E
:10069000312C419180911D018D3F31F18E3F09F444
:1006A00079C0882309F46FC088B3817E88BB87B383
:1006B000817E87BB80E090E026960FB6F894DEBF7F
:1006C0000FBECDBFDF91CF911F910F91FF90DF90B3
:1006D000CF90BF90AF909F908F907F906F905F90E2
:1006E0004F903F902F90089580911B0190911C0195
:1006F000009709F064C01092130110921401109237
:1007000015011092160110920F0110921001109213
:10071000110110921201442E512C612C712C409227
:100720001701509218016092190170921A01B301D9
:10073000A2014670552766277727411551056105A7
:10074000710509F4EAC0443051056105710509F4E9
:1007500027C1423051056105710509F421C14630B8
:1007600051056105710509F4D4C0019690931C01EF
:1007700080931B01AD80BE80EA15FB0509F089CF8F
:1007800081E090E099CF40931D0110921C011092DE
:100790001B01F0CF80911B0190911C01009709F083
:1007A0005CC050E050930E0140930D0110920C017B
:1007B00010920B0110920A0110920901D6CF8430D9
:1007C000910508F0F2C04090170150901801609018
:1007D000190170901A01A42EB12CC12CD12CBC018E
:1007E0006150704E660F771F660F771F660F771F79
:1007F00004C0AA0CBB1CCC1CDD1C6A95D2F7B60148
:10080000A50141FE15C08090130190901401A090A5
:100810001501B0901601482959296A297B2940936E
:1008200013015093140160931501709316017FCF4B
:1008300080900F0190901001A0901101B0901201D2
:10084000482959296A297B2940930F0150931001A7
:1008500060931101709312016ACF8130910509F400
:10086000E8C06091090170910A01672BD1F447FD3E
:1008700014C050E050930A014093090160910B01AC
:1008800070910C0140910D0150910E016417750794
:1008900008F46BCF10921D0168CF30920A012092AC
:1008A000090142FDB6C00FEF1FEF542F5270952E75
:1008B00080E090E0417026C0C29A992041F1C19A2F
:1008C000C498C49A0F3FAFEF1A0749F056B353FBD1
:1008D000222720F930E02017310709F0E5CE60919A
:1008E0000B0170910C016F5F7F4F70930C0160934F
:1008F0000B010196A0900901B0900A018A159B0591
:1009000008F0A2C04111D8CFC2989110D8CFC19899
:10091000D7CF8830910509F028CF80900F019090B3
:100920001001A0901101B09012014091130150915B
:100930001401609115017091160140FE68C0C29AC1
:10094000C49A411551056105710571F0BA0140E085
:1009500050E098B39F2598BB98B39F2598BB4F5FF5
:100960005F4F46175707A9F781149104A104B104FA
:1009700081F040E050E0BA01B2E0BA95F1F700C072
:100980004F5F5F4F6F4F7F4F481559056A057B05D5
:1009900099F710921D0180911B0190911C01E5CEE9
:1009A0008430910509F0E1CEB8CF50E060E070E00E
:1009B0005C01A5E0AA1AA0EEBA0AAA0CBB1CAA0CFC
:1009C000BB1CAA0CBB1C04C0440F551F661F771F1D
:1009D000AA94D2F780900F0190901001A09011017D
:1009E000B0901201482959296A297B2940930F01A7
:1009F0005093100160931101709312014090170100
:100A0000509018016090190170901A0190CEC29810
:100A100097CF43FB002700F910E060910901709126
:100A20000A01672B09F041CF60910B0170910C0115
:100A30000FC060910D0170910E015B01B42AB0925C
:100A40000E01A0920D0191CE80911B0190911C018D
:100A500010920A011092090115CF78940E94E601C4
:100A600087B3806C87BB87EB80936100CFEFC09327
:100A7000620012981A9AC2BB11BA80E090E00E94FC
:100A80005A00CABBC4BB0E941D03C798C6980E94E7
:100A90000A0360E070E080E00E9438020EE610E099
:100AA0008FB589628FBD8EB581608EBD20E030E04C
:100AB000E0E041E050E060E070E0809120018111D1
:100AC00036C08FB589628FBD8EB581608EBD4031D5
:100AD00087E258076105710508F44EC0E11151C065
:100AE000C90101968E3691050CF453C0E1E09C01DA
:100AF0002456310939BD28BD9C01C801821B930BC6
:100B0000853191050CF057C08B3091051CF0C9015F
:100B10008A559109880F991F9093790080937800E6
:100B200040E050E0BA0180912001882351F21092F8
:100B30002001109279001092780019BC18BC1FBCDB
:100B4000809121018A3109F479C3C8F58D3009F407
:100B5000DFC408F04BC0873009F47AC408F06AC0DB
:100B6000853009F465C3863009F09ACF60E070E003
:100B700081E00E94380294CF4F5F5F4F6F4F7F4FED
:100B80009CCF2150310989F4E0E040E050E0BA0107
:100B900094CF8436910524F02356310939BD28BD00
:100BA0009C0140E050E0BA0188CF243631050CF4B6
:100BB000A4CFC9019CCF40E050E0BA017ECF833280
:100BC00009F4CDC208F1863209F4C2C408F476C132
:100BD000883209F4DAC308F483C38E3F09F060CF8A
:100BE000F89414BEE0E0F8EF09955ACF833109F488
:100BF00094C208F08AC08F3009F404C3813109F02F
:100C00004FCF0E94A4014CCF8D3109F41EC408F0CF
:100C100045C08B3109F4EFC08C3109F041CF0E94FF
:100C2000130361E070E08FE10E94380281E00E94CE
:100C3000600236CF893009F44BC48B3009F030CFD5
:100C4000E090220180912301F12CF82AC091240127
:100C500080912501D0E0D82BC69ABE018CE00E947D
:100C60003802209759F0C7010E946A000E94600272
:100C700021978FEFE81AF80A2097A9F780E090E013
:100C80000E945A008091620081608093620080918E
:100C90006200826080936200C69802CF8E3109F4B0
:100CA000BFC3823209F0FCCEE09022018091230183
:100CB000F12CF82AC091240180912501D0E0D82B95
:100CC000C69AC49AC39ABC9ABB9ABE0188E00E9495
:100CD0003802209759F0C7010E9487000E946002E5
:100CE00021972FEFE21AF20A2097A9F780E090E00F
:100CF0000E945A0080916200826080936200C49AD0
:100D0000C39A0E941D03C698CBCE883109F4C5C191
:100D1000893109F0C5CEC090220180912301D12CE8
:100D2000D82AE090240180912501F12CF82AC79A55
:100D3000E114F10409F458C0F6E2AF2EF1E0BF2E41
:100D4000F50161905F0160EF80E090E80E942D0165
:100D50006AEA85E595E80E942D0165E58AEA92E850
:100D60000E942D0160EA85E595E80E942D01E601CB
:100D7000D068662DCE010E942D01F5E8FA95F1F7B5
:100D80000000812C912C712C0DC025E82A95F1F7DB
:100D900000009FEF891A990A782EE8EC8E169104CC
:100DA00009F481C0CE010E94070190916200926017
:100DB000909362008711E9CF6710E7CF80916200BE
:100DC00082608093620080E090E00E945A00FAE026
:100DD0008F1691040CF065C02FEFC21AD20A81E081
:100DE000E81AF10809F0ACCFC79860E070E08AE03B
:100DF0000E94380255CEC090220180912301D12C4F
:100E0000D82AA090240180912501B12CB82AC79A34
:100E1000D7FC46C4A114B10409F453C386E2882E5A
:100E200081E0982EF40171904F0160EF80E090E036
:100E30000E94A3006AEA85E595E00E94A30065E5AB
:100E40008AEA92E00E94A30060EA85E595E00E94AC
:100E5000A300672DC6010E94A30076016894F7F8ED
:100E6000C0E0D0E007C087EC90E00197F1F700C048
:100E700000002196C7010E946A00781609F408C391
:100E8000CA30D10581F780E090E00E945A0080913D
:100E900062008E7F80936200809162008260809306
:100EA0006200C798FDCD80916200826080936200ED
:100EB00080E090E00E945A00C798F2CD843209F495
:100EC00050C0853209F0ECCDC79A60EF80E090E821
:100ED0000E942D016AEA8AEA9AE80E942D0165E5DE
:100EE00085E595E80E942D0160E88AEA9AE80E946B
:100EF0002D016AEA8AEA9AE80E942D0165E585E5F6
:100F000095E80E942D0160E380E090E80E942D01A9
:100F1000C0E0D0E00CC0C83B9BE0D90709F4B8C3DF
:100F20008FEC97E00197F1F700C00000219680E078
:100F300090E80E9407018F3F71F780E090E00E94E7
:100F40005A0080916200816080936200809162000B
:100F5000826080936200C798C83BDB4009F4A0CD53
:100F600044CFE090220180912301F12CF82A809057
:100F7000240180912501912C982AC79AC49AC39A7A
:100F8000BC9ABB9A80916200826080936200811457
:100F90009104E1F0E6E2AE2EE1E0BE2E9701207E64
:100FA0006501F501E701712C05C0CE01807E28178F
:100FB0003907A1F481918F3F09F07394219681E064
:100FC000881A91085F0189F771100CC08091620046
:100FD0008260809362000E941D0306CF711002C0E0
:100FE0007E01DCCF6AEA8AEA9AE00E94CA0065E5DF
:100FF00085E595E00E94CA0065E280E090E00E94ED
:10100000CA006FEF670D80E090E00E94CA0001C047
:101010007C01F60161916F016F3F21F0C7010E94D1
:10102000CA007A94C70101967110F2CF69E280E09C
:1010300090E00E94CA00FAE1FA95F1F700C070EA68
:10104000472E76E8572E66246394712C312C6894D1
:10105000F7F821E0C21AD1080CC0FAE1FA95F1F7CD
:1010600000C021E0421A510861087108382E09F4C5
:1010700006C3C7010E94870090916200926090931E
:1010800062008311EACFF60190813912E6CF811414
:10109000910409F49BCF7E0181CFC79A60EF80E075
:1010A00090E80E942D016AEA8AEA9AE80E942D01DE
:1010B00065E585E595E80E942D0160E88AEA9AE8F1
:1010C0000E942D016AEA8AEA9AE80E942D0165E5EC
:1010D00085E595E80E942D0160E18AEA9AE80E9480
:1010E0002D0106C08FEC97E00197F1F700C00000DA
:1010F00080E090E80E9407018F3FA1F780E090E038
:101100000E945A0080916200816080936200809109
:10111000620082608093620067CEC79AC69A80910F
:1011200062008E7F80936200809162008260809373
:1011300062008FEF90E7E2E081509040E040E1F7FD
:1011400000C0000080916200816080936200C798B7
:10115000C69860E070E084E10E943802A1CCC79A92
:10116000C49AC39ABC9ABB9A8091620082608093B1
:10117000620060EF80E090E00E94CA006AEA8AEABA
:101180009AE00E94CA0065E585E595E00E94CA00E4
:1011900060E88AEA9AE00E94CA006AEA8AEA9AE06B
:1011A0000E94CA0065E585E595E00E94CA0060E3FB
:1011B00080E090E00E94CA00C0E0D0E00CC0C83BD4
:1011C000FBE0DF0709F457C2EFECF7E03197F1F7E6
:1011D00000C00000219680E090E80E9487008F3FC9
:1011E00071F780E090E00E945A0080916200826076
:1011F000809362000E941D03C798C83BDB4009F43E
:101200004FCCF3CD30916200316030936200209179
:1012100062002E7F2093620080E890E02BBB3BBBF6
:101220000197E1F760E070E080E10E94380238CC7D
:1012300060E070E080E00E94380232CCC79A60EF34
:1012400080E090E00E94A3006AEA85E595E00E94B4
:10125000A30065E58AEA92E00E94A30060E885E5C4
:1012600095E00E94A3006AEA85E595E00E94A3004C
:1012700065E58AEA92E00E94A30060E185E595E0D9
:101280000E94A300C0E0D0E00CC0C03197E2D907B3
:1012900009F4FEC18FEC97E00197F1F700C0000060
:1012A000219680E090E00E946A008F3F71F780E015
:1012B00090E00E945A0080916200816080936200F9
:1012C00080916200826080936200C798C031D742EB
:1012D00009F4E6CB60E070E08EE00E943802E0CBDB
:1012E000C091220180912301D0E0D82BE09024010D
:1012F00080912501F12CF82AC69ACE010E9407019F
:10130000E114F10409F4D9C120E030E0CBBBD5BB36
:1013100082E08A95F1F700C080B3282748E050E0CA
:1013200009C03695279591E0292790EA3927415041
:10133000510939F020FDF5CF3695279541505109D7
:10134000C9F7E1E0EE1AF1082196E114F104F1F693
:10135000D22FC32F80E090E00E945A00909162004B
:10136000916090936200909162009260909362000D
:1013700062E070E088E00E9438028D2F0E946002D7
:101380008C2F0E946002C6988BCBC0902201809166
:101390002301D12CD82AE090240180912501F12C41
:1013A000F82AC69AE114F10409F484C1C0E0D0E03F
:1013B000C6010E946A00C82728E030E09C2FD6951D
:1013C000C79590FF04C0E1E0CE27E0EADE27215078
:1013D0003109A1F7F1E0EF1AF1082FEFC21AD20A92
:1013E000E114F10429F7FC2ECD2F80E090E00E945B
:1013F0005A00909162009160909362009091620017
:1014000092609093620062E070E08CE00E9438028B
:101410008F2D0E9460028C2F0E946002C69840CBE4
:10142000C091220180912301D0E0D82B61E070E0CF
:101430008FE10E943802C79A64E271E0CE010E94F7
:1014400024030E946002C7982BCB0E941D03E9CBA6
:10145000E090220180912301F12CF82AC09124010F
:1014600080912501D0E0D82BC69ABE0188E00E9469
:101470003802209709F402CCC7010E9407010E949C
:10148000600221979FEFE91AF90A2097A9F7F6CB96
:1014900080E090E00E945A00809162008E7F8093ED
:1014A0006200809162008260809362002A9709F452
:1014B000F8CC9FEFC91AD90AE1E0AE1AB10809F0D9
:1014C000B1CCC79860E070E08EE00E943802E8CAB4
:1014D000E090220180912301F12CF82AC09124018F
:1014E00080912501D0E0D82BC79A209709F47CCCB5
:1014F000A6E2CA2EA1E0DA2EF60161916F01C701C2
:101500000E942D01FFEFEF1AFF0A2197A9F76CCC7B
:10151000E090220180912301F12CF82AC09124014E
:1015200080912501D0E0D82BC79A209751F296E2FE
:10153000C92E91E0D92EF60161916F01C7010E9479
:10154000A300FFEFEF1AFF0A2197A9F7C798BACFB8
:10155000E090220180912301F12CF82A809024014F
:1015600080912501912C982AC79A8091620082600F
:10157000809362008114910409F4C9CD66E2A62E1D
:1015800061E0B62E9701207E6501F501E701712C1F
:1015900006C0CE01807E2817390709F068C0819106
:1015A0008F3F09F07394219681E0881A91085F01BA
:1015B00081F7772009F4ABCD6AEA8AEA9AE80E94BB
:1015C0002D0165E585E595E80E942D0165E280E045
:1015D00090E80E942D016FEF670D80E090E80E9477
:1015E0002D0101C07C01F60161916F016F3F29F06F
:1015F000C70190680E942D017A94C701019671106D
:10160000F1CF69E280E090E80E942D01FAE1FA95BD
:10161000F1F700C050EA452E56E8552E6624639433
:10162000712C312C6894F7F821E0C21AD1080BC054
:10163000FAE1FA95F1F700C021E0421A5108610879
:101640007108382E81F1C7010E9407019091620054
:101650009260909362008311EBCFF6019081391272
:10166000E7CF8114910409F452CD7E018BCF711024
:10167000A3CF7E0187CF80E090E00E945A00809146
:1016800062008260809362000E941D03C79808CAAE
:1016900080E090E00E945A00809162008160FACB65
:1016A000F0E8DF1AB7CB809162008260809362001D
:1016B000C798F6C9C0E0F12C98CEC0E0D0E04ACE81
:0416C000F894FFCFCC
:00000001FF

350
jtag.c
View File

@ -1,175 +1,175 @@
#include "defines.h"
#include <avr/io.h>
#include <util/delay.h>
#include <inttypes.h>
#include "jtag.h"
#include "jtag_commands.h"
static uint8_t jtag_current_command = 0;
static uint16_t jtag_pos = 0;
static uint32_t jtag_tck_delay_value = 0;
static uint32_t jtag_num_tck = 0;
static uint32_t jtag_usecs = 0;
static uint16_t jtag_multi_count = 0;
static uint16_t jtag_multi_pos = 0;
static uint16_t jtag_multi_multi = 0;
static void tck_delay(uint8_t tms, uint32_t num_tck, uint32_t usecs)
{
if (tms)
PORT |= (1<<TMS_PIN);
else
PORT &= ~(1<<TMS_PIN);
PORT |= 1<<TCK_PIN;
int i;
for (i = 0; i < num_tck; i++)
{
PORT ^= 1<<TCK_PIN;
//_delay_us(1);
PORT ^= 1<<TCK_PIN;
//_delay_us(1);
}
for (i = 0; i < usecs; i++)
_delay_us(1);
}
static uint8_t pulse_tck(int tms, int tdi, int tdo)
{
if (tms)
PORT |= (1<<TMS_PIN);
else
PORT &= ~(1<<TMS_PIN);
if (tdi >= 0)
{
if (tdi)
PORT |= (1<<TDI_PIN);
else
PORT &= ~(1<<TDI_PIN);
}
PORT &= ~(1<<TCK_PIN);
//_delay_us(1);
PORT |= 1<<TCK_PIN;
//_delay_us(1);
if (tdo < 0) return 1;
return ((PORT_PIN >> TDO_PIN) & 1) == tdo;
}
static int jtag_parse_byte(uint8_t data)
{
int i, tms, tdi, tdo;
switch (jtag_current_command)
{
case 0:
jtag_current_command = data;
jtag_pos = 0;
break;
case JTAG_PULSE_TCK_DELAY:
if (jtag_pos == 0)
{
jtag_num_tck = 0;
jtag_usecs = 0;
jtag_tck_delay_value = data;
} else {
if ((jtag_pos < 4) && (jtag_tck_delay_value & 0b10)) // num_tck
{
jtag_num_tck |= (uint32_t)data << (8*(jtag_pos-1));
} else if ((jtag_pos < 4) && !(jtag_tck_delay_value & 0b10)) // usecs
{
jtag_usecs |= (uint32_t)data << (8*(jtag_pos-1));
} else {
jtag_usecs |= (uint32_t)data << (8*(jtag_pos-5));
}
}
if ( ((jtag_tck_delay_value & 0b110) == 0)
|| (((((jtag_tck_delay_value & 0b110) == 0b100) || (jtag_tck_delay_value & 0b110) == 0b010)) && jtag_pos == 4)
|| (((jtag_tck_delay_value & 0b110) == 0b110) && jtag_pos == 8)
)
{
tck_delay(jtag_tck_delay_value&1, jtag_num_tck, jtag_usecs);
jtag_current_command = 0;
}
jtag_pos++;
break;
case JTAG_PULSE_TCK_MULTI:
if (jtag_pos == 0)
{
jtag_multi_count = data;
jtag_multi_pos = 0;
jtag_multi_multi = 0;
} else if (jtag_pos == 1)
{
jtag_multi_count |= (uint16_t)data << 8;
} else {
if (!jtag_multi_multi && !(data & 0x80))
{
jtag_multi_multi = data;
} else {
if (!jtag_multi_multi) jtag_multi_multi = 1;
tms = data&1;
tdi = (data>>1)&1;
tdo = -1;
if (data & (1<<2))
{
tdo = (data>>3)&1;
}
for (i = 0; i < jtag_multi_multi; i++)
{
if (!pulse_tck(tms, tdi, tdo)) return 0;
jtag_multi_pos++;
}
jtag_multi_multi = 0;
}
if (jtag_multi_pos >= jtag_multi_count)
jtag_current_command = 0;
}
jtag_pos++;
break;
/*
case JTAG_PULSE_TCK:
tms = data&1;
tdi = (data>>1)&1;
tdo = -1;
if (data & (1<<2))
{
tdo = (data>>3)&1;
}
if (!pulse_tck(tms, tdi, tdo)) return 0;
jtag_current_command = 0;
break;
*/
default:
return 0;
}
return 1;
}
void jtag_setup()
{
PORT &= ~((1<<TMS_PIN) | (1<<TDO_PIN) | (1<<TDI_PIN)) | (1<<TCK_PIN);
PORT_DDR |= (1<<TMS_PIN) | (1<<TCK_PIN) | (1<<TDI_PIN);
PORT_DDR &= ~(1<<TDO_PIN);
jtag_current_command = 0;
}
void jtag_shutdown()
{
PORT &= ~((1<<TMS_PIN) | (1<<TCK_PIN) | (1<<TDO_PIN) | (1<<TDI_PIN));
PORT_DDR &= ~((1<<TMS_PIN) | (1<<TCK_PIN) | (1<<TDO_PIN) | (1<<TDI_PIN));
}
int jtag_execute(int count, uint8_t* data)
{
int i;
for (i = 0; i < count; i++)
{
if (!jtag_parse_byte(data[i]))
{
jtag_shutdown();
return 0;
}
}
return 1;
}
#include "defines.h"
#include <avr/io.h>
#include <util/delay.h>
#include <inttypes.h>
#include "jtag.h"
#include "jtag_commands.h"
static uint8_t jtag_current_command = 0;
static uint16_t jtag_pos = 0;
static uint32_t jtag_tck_delay_value = 0;
static uint32_t jtag_num_tck = 0;
static uint32_t jtag_usecs = 0;
static uint16_t jtag_multi_count = 0;
static uint16_t jtag_multi_pos = 0;
static uint16_t jtag_multi_multi = 0;
static void tck_delay(uint8_t tms, uint32_t num_tck, uint32_t usecs)
{
if (tms)
PORT |= (1<<TMS_PIN);
else
PORT &= ~(1<<TMS_PIN);
PORT |= 1<<TCK_PIN;
int i;
for (i = 0; i < num_tck; i++)
{
PORT ^= 1<<TCK_PIN;
//_delay_us(1);
PORT ^= 1<<TCK_PIN;
//_delay_us(1);
}
for (i = 0; i < usecs; i++)
_delay_us(1);
}
static uint8_t pulse_tck(int tms, int tdi, int tdo)
{
if (tms)
PORT |= (1<<TMS_PIN);
else
PORT &= ~(1<<TMS_PIN);
if (tdi >= 0)
{
if (tdi)
PORT |= (1<<TDI_PIN);
else
PORT &= ~(1<<TDI_PIN);
}
PORT &= ~(1<<TCK_PIN);
//_delay_us(1);
PORT |= 1<<TCK_PIN;
//_delay_us(1);
if (tdo < 0) return 1;
return ((PORT_PIN >> TDO_PIN) & 1) == tdo;
}
static int jtag_parse_byte(uint8_t data)
{
int i, tms, tdi, tdo;
switch (jtag_current_command)
{
case 0:
jtag_current_command = data;
jtag_pos = 0;
break;
case JTAG_PULSE_TCK_DELAY:
if (jtag_pos == 0)
{
jtag_num_tck = 0;
jtag_usecs = 0;
jtag_tck_delay_value = data;
} else {
if ((jtag_pos < 4) && (jtag_tck_delay_value & 0b10)) // num_tck
{
jtag_num_tck |= (uint32_t)data << (8*(jtag_pos-1));
} else if ((jtag_pos < 4) && !(jtag_tck_delay_value & 0b10)) // usecs
{
jtag_usecs |= (uint32_t)data << (8*(jtag_pos-1));
} else {
jtag_usecs |= (uint32_t)data << (8*(jtag_pos-5));
}
}
if ( ((jtag_tck_delay_value & 0b110) == 0)
|| (((((jtag_tck_delay_value & 0b110) == 0b100) || (jtag_tck_delay_value & 0b110) == 0b010)) && jtag_pos == 4)
|| (((jtag_tck_delay_value & 0b110) == 0b110) && jtag_pos == 8)
)
{
tck_delay(jtag_tck_delay_value&1, jtag_num_tck, jtag_usecs);
jtag_current_command = 0;
}
jtag_pos++;
break;
case JTAG_PULSE_TCK_MULTI:
if (jtag_pos == 0)
{
jtag_multi_count = data;
jtag_multi_pos = 0;
jtag_multi_multi = 0;
} else if (jtag_pos == 1)
{
jtag_multi_count |= (uint16_t)data << 8;
} else {
if (!jtag_multi_multi && !(data & 0x80))
{
jtag_multi_multi = data;
} else {
if (!jtag_multi_multi) jtag_multi_multi = 1;
tms = data&1;
tdi = (data>>1)&1;
tdo = -1;
if (data & (1<<2))
{
tdo = (data>>3)&1;
}
for (i = 0; i < jtag_multi_multi; i++)
{
if (!pulse_tck(tms, tdi, tdo)) return 0;
jtag_multi_pos++;
}
jtag_multi_multi = 0;
}
if (jtag_multi_pos >= jtag_multi_count)
jtag_current_command = 0;
}
jtag_pos++;
break;
/*
case JTAG_PULSE_TCK:
tms = data&1;
tdi = (data>>1)&1;
tdo = -1;
if (data & (1<<2))
{
tdo = (data>>3)&1;
}
if (!pulse_tck(tms, tdi, tdo)) return 0;
jtag_current_command = 0;
break;
*/
default:
return 0;
}
return 1;
}
void jtag_setup()
{
PORT &= ~((1<<TMS_PIN) | (1<<TDO_PIN) | (1<<TDI_PIN)) | (1<<TCK_PIN);
PORT_DDR |= (1<<TMS_PIN) | (1<<TCK_PIN) | (1<<TDI_PIN);
PORT_DDR &= ~(1<<TDO_PIN);
jtag_current_command = 0;
}
void jtag_shutdown()
{
PORT &= ~((1<<TMS_PIN) | (1<<TCK_PIN) | (1<<TDO_PIN) | (1<<TDI_PIN));
PORT_DDR &= ~((1<<TMS_PIN) | (1<<TCK_PIN) | (1<<TDO_PIN) | (1<<TDI_PIN));
}
int jtag_execute(int count, uint8_t* data)
{
int i;
for (i = 0; i < count; i++)
{
if (!jtag_parse_byte(data[i]))
{
jtag_shutdown();
return 0;
}
}
return 1;
}

32
jtag.h
View File

@ -1,16 +1,16 @@
#include "defines.h"
#define CLUJTAG_CONCAT(a, b) a ## b
#define CLUJTAG_OUTPORT(name) CLUJTAG_CONCAT(PORT, name)
#define CLUJTAG_INPORT(name) CLUJTAG_CONCAT(PIN, name)
#define CLUJTAG_DDRPORT(name) CLUJTAG_CONCAT(DDR, name)
#define PORT CLUJTAG_OUTPORT(JTAG_PORT)
#define PORT_DDR CLUJTAG_DDRPORT(JTAG_PORT)
#define PORT_PIN CLUJTAG_INPORT(JTAG_PORT)
#define PORT_LED CLUJTAG_OUTPORT(LED_PORT)
#define PORT_LED_DDR CLUJTAG_DDRPORT(LED_PORT)
void jtag_setup();
void jtag_shutdown();
int jtag_execute(int count, uint8_t* data);
#include "defines.h"
#define CLUJTAG_CONCAT(a, b) a ## b
#define CLUJTAG_OUTPORT(name) CLUJTAG_CONCAT(PORT, name)
#define CLUJTAG_INPORT(name) CLUJTAG_CONCAT(PIN, name)
#define CLUJTAG_DDRPORT(name) CLUJTAG_CONCAT(DDR, name)
#define PORT CLUJTAG_OUTPORT(JTAG_PORT)
#define PORT_DDR CLUJTAG_DDRPORT(JTAG_PORT)
#define PORT_PIN CLUJTAG_INPORT(JTAG_PORT)
#define PORT_LED CLUJTAG_OUTPORT(LED_PORT)
#define PORT_LED_DDR CLUJTAG_DDRPORT(LED_PORT)
void jtag_setup();
void jtag_shutdown();
int jtag_execute(int count, uint8_t* data);

View File

@ -1,7 +1,7 @@
#define JTAG_PULSE_TCK_DELAY 0xFD
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 <20><><EFBFBD><EFBFBD>: 0<><30><EFBFBD> - TMS, 1<><31><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TCK, 2<><32><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TCK, <20><><EFBFBD><EFBFBD><EFBFBD> 4 <20><><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> 4 <20><><EFBFBD><EFBFBD><EFBFBD> usec
#define JTAG_PULSE_TCK_MULTI 0xFE
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 <20><><EFBFBD><EFBFBD>: <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>:
// <20><><EFBFBD><EFBFBD><EFBFBD> 1-127 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>: 0<><30><EFBFBD> - TMS, 1<><31><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDI, 2<><32><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDI, 3<><33><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDO, 4<><34><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDO
// <20><><EFBFBD><EFBFBD> 7<><37><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 1<><31><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDI, 2<><32><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDI, 3<><33><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDI, 4<><34><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDO
#define JTAG_PULSE_TCK_DELAY 0xFD
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 <20><><EFBFBD><EFBFBD>: 0<><30><EFBFBD> - TMS, 1<><31><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TCK, 2<><32><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TCK, <20><><EFBFBD><EFBFBD><EFBFBD> 4 <20><><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> 4 <20><><EFBFBD><EFBFBD><EFBFBD> usec
#define JTAG_PULSE_TCK_MULTI 0xFE
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 <20><><EFBFBD><EFBFBD>: <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>:
// <20><><EFBFBD><EFBFBD><EFBFBD> 1-127 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>: 0<><30><EFBFBD> - TMS, 1<><31><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDI, 2<><32><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDI, 3<><33><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDO, 4<><34><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDO
// <20><><EFBFBD><EFBFBD> 7<><37><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 1<><31><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDI, 2<><32><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDI, 3<><33><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> TDI, 4<><34><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TDO

106
usart.c
View File

@ -1,54 +1,54 @@
#include "defines.h"
#include <avr/io.h>
#include "defines.h"
#include <avr/io.h>
#include <util/delay.h>
void USART_init(void)
{
unsigned int bd = (F_CPU / (16UL * UART_BAUD)) - 1;
UBRR0L = bd & 0xFF;
UBRR0H = bd >> 8;
UCSR0B = _BV(TXEN0) | _BV(RXEN0) | _BV(RXCIE0); /* tx/rx enable */
// UCSRC = 1<<URSEL|1<<UCSZ0|1<<UCSZ1;
UCSR0C |= /*_BV(UMSEL0) |*/ _BV(UCSZ01) | _BV(UCSZ00);
//UCSRA = _BV(U2X);
}
void USART_TransmitByte( unsigned char data )
{
/* Wait for empty transmit buffer */
while ( !( UCSR0A & (1<<UDRE0)) );
/* Put data into buffer, sends the data */
UDR0 = data;
}
void USART_TransmitHex( unsigned char data )
{
unsigned char h = data>>4;
char ho = (h < 10) ? (h+'0') : (h+'A'-10);
unsigned char l = data & 0xF;
char lo = (l < 10) ? (l+'0') : (l+'A'-10);
while ( !( UCSR0A & (1<<UDRE0)) );
UDR0 = ho;
while ( !( UCSR0A & (1<<UDRE0)) );
UDR0 = lo;
}
void USART_TransmitText(char* data)
{
while (*data != 0)
{
/* Wait for empty transmit buffer */
while ( !( UCSR0A & (1<<UDRE0)) );
/* Put data into buffer, sends the data */
UDR0 = *data;
data++;
}
}
void USART_Transmit(void* p, unsigned long int len)
{
unsigned char* buff = (unsigned char*)p;
unsigned long int b;
for (b = 0; b < len; b++) USART_TransmitByte(buff[b]);
}
void USART_init(void)
{
unsigned int bd = (F_CPU / (16UL * UART_BAUD)) - 1;
UBRR0L = bd & 0xFF;
UBRR0H = bd >> 8;
UCSR0B = _BV(TXEN0) | _BV(RXEN0) | _BV(RXCIE0); /* tx/rx enable */
// UCSRC = 1<<URSEL|1<<UCSZ0|1<<UCSZ1;
UCSR0C |= /*_BV(UMSEL0) |*/ _BV(UCSZ01) | _BV(UCSZ00);
//UCSRA = _BV(U2X);
}
void USART_TransmitByte( unsigned char data )
{
/* Wait for empty transmit buffer */
while ( !( UCSR0A & (1<<UDRE0)) );
/* Put data into buffer, sends the data */
UDR0 = data;
}
void USART_TransmitHex( unsigned char data )
{
unsigned char h = data>>4;
char ho = (h < 10) ? (h+'0') : (h+'A'-10);
unsigned char l = data & 0xF;
char lo = (l < 10) ? (l+'0') : (l+'A'-10);
while ( !( UCSR0A & (1<<UDRE0)) );
UDR0 = ho;
while ( !( UCSR0A & (1<<UDRE0)) );
UDR0 = lo;
}
void USART_TransmitText(char* data)
{
while (*data != 0)
{
/* Wait for empty transmit buffer */
while ( !( UCSR0A & (1<<UDRE0)) );
/* Put data into buffer, sends the data */
UDR0 = *data;
data++;
}
}
void USART_Transmit(void* p, unsigned long int len)
{
unsigned char* buff = (unsigned char*)p;
unsigned long int b;
for (b = 0; b < len; b++) USART_TransmitByte(buff[b]);
}

20
usart.h
View File

@ -1,10 +1,10 @@
#ifndef _USART_H
#define _USART_H
void USART_init(void);
void USART_TransmitByte( unsigned char data );
void USART_TransmitText(char* data);
void USART_Transmit(void* p, unsigned long int len);
void USART_TransmitHex(unsigned char data);
#endif
#ifndef _USART_H
#define _USART_H
void USART_init(void);
void USART_TransmitByte( unsigned char data );
void USART_TransmitText(char* data);
void USART_Transmit(void* p, unsigned long int len);
void USART_TransmitHex(unsigned char data);
#endif