ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 12.06.2025
Просмотров: 8343
Скачиваний: 1
© MCS Electronics, 1995-2007 |
||
Other |
||
Use HEX |
Select when a HEX file must be sent instead of the bin file. |
|
Program |
The program to execute. This is your programmer software. |
|
Parameter |
The optional parameter that the program might need. |
|
Use {FILE} to insert the binary filename(file.bin) and {EEPROM} to |
||
insert the filename of the generated EEP file. |
||
When ‘Use Hex’ is checked the filename (file.hex) will be inserted for |
||
{FILE}. In all cases a binary file will be inserted for {EEPROM} with the |
||
extension .EEP |
||
See Also
Supported programmers
Supported Programmers
BASCOM supports the following programmers
AVR ICP910 based on the AVR910.ASM application note
STK200 ISP programmer from Atmel
The PG302 programmer from Iguana Labs
The simple cable programmer from Sample Electronics.
KITSRUS KIT122 Programmer
MCS Universal Interface Programmer
The MCS Universal Interface supports a number of programmers as well. In fact it is possible to support most parallel printer port programmers.
STK500 programmer and Extended STK500 programmer.
Lawicel BootLoader
USB-ISP Programmer
MCS Bootloader
ISP programmer
BASCOM supports the STK200 and STK200+ and STK300 ISP programmer from Atmel.
This is a very reliable parallel printer port programmer.
The STK200 ISP programmer is included in the STK200 starter kit.
Most programs were tested with the STK200.
For those who don't have this kit and the programmer the following schematic shows how to make your own programmer:
page -76-
© MCS Electronics, 1995-2007
The dongle has a chip with no identification but since the schematic is all over the web, it is included. MCS also sells a STK200 compatible programmer.
Here is a tip received from a user :
If the parallel port is disconnected from the interface and left floating, the '244 latch outputs will waver, causing your microcontroller to randomly reset during operation. The simple addition of a 100K pull-up resisistor between pin 1 and 20 of the latch, and another between pin 19 and 20, will eliminate this problem. You'll then have HIGH-Z on the latch outputs when the cable is disconnected (as well as when it's connected and you aren't programming), so you can use the MOSI etc. pins for I/O.
PG302 programmer
The PG302 is a serial programmer. It works and looks exactly as the original PG302 software.
page -77-
© MCS Electronics, 1995-2007
Select the programmer from The Option Programmer menu or right click on the button to show the Option Programmer menu
Sample Electronics cable programmer
Sample Electronics submitted the simple cable programmer.
They produce professional programmers too. This simple programmer you can make yourself within 10 minutes.
What you need is a DB25 centronics male connector, a flat cable and a connector that can be connected to the target MCU board.
The connections to make are as following:
DB25 pin |
Target MCU |
Target MCU |
Target MCU pin 8515 |
DT104 |
pin(AT90S8535) |
M103/M128 |
|||
2, D0 |
MOSI, pin 6 |
PE.0, 2 |
MOSI, 6 |
J5, pin 4 |
4, D2 |
RESET, pin 9 |
RESET, 20 |
RESET, 9 |
J5, pin 8 |
5, D3 |
CLOCK, pin 8 |
PB.1,11 |
CLOCK, 8 |
J5, pin 6 |
11, BUSY |
MISO, pin 7 |
PE.1, 3 |
MISO, 7 |
J5, pin 5 |
18-25,GND |
GROUND |
GROUND |
GND,20 |
J5, pin 1 |
The MCU pin numbers are shown for an 8535! And 8515
Note that 18-25 means pins 18,19,20,21,22,23,24 and 25
You can use a small resistor of 100-220 ohm in series with the D0, D2 and D3 line in order not to short circuit your LPT port in the event the MCU pins are high.
It was tested without these resistors and no problems occured.
Tip : when testing programmers etc. on the LPT it is best to buy an I/O card for your PC that has a LPT port. This way you don’t destroy your LPT port that is on the motherboard in the event you make a mistake!
page -78-
© MCS Electronics, 1995-2007
The following picture shows the connections to make. Both a setup for the DT104 and stand-alone PCB are shown.
I received the following useful information:
I have been having spurious success with the simple cable programmer from Sample Electronics for the AVR series.
After resorting to hooking up the CRO I have figured it out (I think). When trying to identify the chip, no response on the MISO pin indicates that the Programming Enable command has not been correctly received by the target.
The SCK line Mark/Space times were okay but it looked a bit sad with a slow rise time but a rapid fall time. So I initially tried to improve the rise
time with a pull-up. No change ie still could not identify chip. I was about to add some buffers when I came across an Atmel app note for their serial programmer "During this first phase of the programming cycle, keeping the SCK line free from pulses is critical, as pulses will cause the target AVR to loose synchronization with the programmer. When synchronization is lost, the only means of regaining synchronization is to release the RESET line for more than 100ms."
I have added a 100pF cap from SCK to GND and works first time every time now. The SCK rise time is still sad but there must have been enough noise to corrupt the initial command despite using a 600mm shielded cable.
KITSRUS Programmer
The K122 is a KIT from KITSRUS. (www.kitsrus.com)
The programmer supports the most popular 20 and 40 pins AVR chips.
On the Programmer Options tab you must select this programmer and the COM port it is
page -79-
© MCS Electronics, 1995-2007
connected to.
On the Monitor Options tab you must specify the upload speed of 9600, Monitor delay of 1 and Prefix delay 1.
When you press the Program button the Terminal Emulator screen will pop up:
A special toolbar is now visible.
You must press the Program enable button to enable the programmer. When you enable the programmer the right baud rate will be set.
When you are finished you must press the Enable button again to disable it.
This way you can have a micro connected to your COM port that works with a different BAUD rate.
There is an option to select between FLASH and EEPROM.
The prompt will show the current mode which is set to FLASH by default.
The buttons on the toolbar allow you to :
ERASE, PROGRAM, VERIFY, DUMP and set the LOCKBITS. When DUMP is selected you will be asked for a file name.
When the DUMP is ready you must CLOSE the LOGFILE where the data is stored. This can be done to select the CLOSE LOGFILE option form the menu.
MCS Universal Interface Programmer
The MCS Universal Interface programmer allows you to customize the pins that are used for the ISP interface. The file prog.settings stores the various interfaces.
The content :
;how to use this file to add support for other programmers
;first create a section like [newprog]
; then enter the entries:
page -80-
© MCS Electronics, 1995-2007
;BASE= $hexaddress
;MOSI= address in form of BASE[+offset] , bit [,inverted]
;CLOCK= same as MOSI
;RESET=same as MOSI
;MISO=same as MOSI
;The bit is a numer that must be written to set the bit
;for example 128 to set bit 7
;Optional is ,INVERTED to specify that inverse logic is used
;When 128 is specified for the bit, NOT 128 will be written(127)
[FUTURELEC]
;tested and ok BASE=$378 MOSI=BASE+2,1,inverted CLOCK=BASE,1 RESET=BASE,2 MISO=BASE+1,64
[sample] ;tested and ok BASE=$378 MOSI=BASE,1 CLOCK=BASE,8 RESET=BASE,4
MISO=BASE+1,128,INVERTED
[stk200] ;tested and ok BASE=$378 MOSI=BASE,32 CLOCK=BASE,16
RESET=BASE,128
MISO=BASE+1,64
Four programmers are supported : Futurelec, Sample and STK200/STK300 and WinAVR/ SP12.
To add your own programmer open the file with notepad and add a new section name. For the example I will use stk200 that is already in the file.
[stk200]
The LPT base address must be specified. For LPT1 this is in most cases $378. $ means hexadecimal.
The pins that are needed are MOSI, CLOCK, RESET and MISO.
Add the pin name MOSI =
page -81-
© MCS Electronics, 1995-2007
After the pin name add the address of the register. For the STK200 the data lines are used so BASE must be specified. After the address of the register, specify the bit number value to set the pin high. Pin 0 will be 1, pin 1 would be 2, pin 2 would be 4 etc. D5 is used for the stk so we specify 32.
When the value is set by writing a logic 0, also specify, INVERTED. After you have specified all pins, save the file and restart BASCOM.
Select the Universal Programmer Interface and select the entry you created.
After you have selected an entry save your settings and exit BASCOM. At the next startup of BASCOM, the settings will be used.
The following picture shows the LPT connector and the relation of the pins to the LPT registers.
Always add your entry to the bottom of the file and email the settings to support@mcselec.com so it can be added to BASCOM.
STK500 Programmer
When you select the STK500 programmer, BASCOM will run the files named stk500.exe that is installed with AVR Studio.
That is why you have to specify the file location of the stk500.exe The normal STK500 support will erase, and program the flash.
The STK500.EXE supports a number of Atmel programmers which all use the STK500 V1 or V2 protocol.
For the AVR ISP mkII, you need to supply the serial number of the USB programmer. The USB port will be used then instead of the serial port.
The extended STK500 support will show the following window:
page -82-
© MCS Electronics, 1995-2007
Option |
Description |
Programming mode |
Serial or parallel. Some options require the parallel mode. |
Input Flash File |
The program HEX file. It is loaded automatic |
Input EEPROM File |
The program EEP file. It is loaded automatic when it exists |
Output Flash File |
The name of the output flash file. Only needed when you want to |
read a device. |
|
Output EEPROM File |
The name of the output EEPROM file. Only needed when you want to |
read the EEPROM from a device |
|
Mode |
Both will work on the FLASH and EEPROM, Flash will only work on |
the FLASH ROM and EEPROM will only work on the EEPROM. |
|
Use both when you want to program both a programand an EEPROM |
|
(EEP) file. |
|
Erase |
Erase chip. Must be done before programming the chip. |
Program |
Program the chip |
Read device |
Read the flash and or EEPROM content and store in the specified |
files. |
|
Verify device |
Verify the chip content with the files. |
Read signature |
Read the signature bytes that identify the chip. |
Read/Write Lock Byte |
Read and write the lock byte. Hex notation! |
Read/Write Fuse Bytes |
Read and write the fuse bytes. Hex notation! |
Read/Write Vtarget |
Read or set the Vtarget voltage |
Read/Write Aref |
Read or set the Aref voltage |
page -83-