Atmega128L programming by codevision

Go To Last Post
31 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi,

I have a programmer, which pinouts are like below, this programmer connect to PC`s serial port.

I use this programmer to program an ATMEGA128L with external crystal oscillator 7.3728MHz

  1. In Codevisionàprogrammer setting, which part I have to choose?

2. In chip programmer part, what`s the right values and check boxes?

                                                                            

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This topic has a solution.
Last Edited: Tue. Dec 17, 2019 - 07:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The picture is a bit fuzzy, but it appears that you have a JTAGICE-1 clone?  Yes, your target chip is supported, but I'm unsure of CV support for that.  Perhaps check the rev history, and the ChipBlaster documents.

https://www.avrfreaks.net/commen...

 

I'd guess no support.  What version of CV?

The following programmers are supported:

Atmel STK500 (serial connection)

Atmel STK600 (USB connection)

Atmel AVRISP (serial connection)

Atmel AVRISP MkII (USB connection)

Atmel AVR Dragon (USB connection)

Atmel JTAGICE MkII (USB connection)

Atmel JTAGICE 3 (USB connection)

Atmel-ICE (USB connection)

Atmel EDBG (USB connection) - requires Atmel Studio 7 to be installed

Atmel mEDBG (USB connection) - requires Atmel Studio 7 to be installed

Atmel AVR910 Application Note (serial connection)

USBASP (USB connection)

Kanda Systems STK200 and STK300 (LPT parallel port connection)

Vogel Elektronic VTEC ISP (LPT parallel port connection)

Dontronics DT006 (LPT parallel port connection)

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Sun. Dec 8, 2019 - 02:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi,

In the below picture can you help me to define clock value and set the checkboxes? (As I wrote above the frequency of the external crystal is 7.3728MHz and I use JTAG)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Codevision does not support JTAGICE-1 programmers.

AS7.0 does not support JTAGICE-1 programmers.

 

You need AS4.xx to debug with JTAGICE-1.

Several PC programs will program with JTAG e.g. AS4.xx, avrdude.exe,  jtagice.exe, ...

 

If you want to use JTAG properly,   it would be wise to buy SNAP, Pickit4, ATMEL-ICE, ... that all work with AS7.0 and also can be used with Tiny, Mega, Xmega, ARM, ...

SNAP is very cheap but you must make your own ribbon cables and case.

 

David.

Last Edited: Mon. Dec 9, 2019 - 09:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear David,

 

I used to program my boards by this programmer and Codevision (about five years ago), but I have forgotten the settings of Codevision.

 

Majid 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Current CV does not support JTAGICE-1

What version are you using?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The version is 3.12 advanced. Which version should I use?
What about settings, how can I set them?

Last Edited: Mon. Dec 9, 2019 - 10:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CV Revision history for V3 and V2 does not mention JTAGICE-1 (the original RS232 JTAGICE)

I can't remember using JTAGICE-1 with native Codevision.    I would have used CV COFF file to debug with JTAGICE-1 and AS4.19

 

Nowadays CV v3.xx works with AS7.0 and you can build and debug seamlessly (with JTAGICE-2, Dragon, ATMEL-ICE, ..., Pickit4, SNAP)

 

AS5.xx,  AS6.xx and AS7.0 have never supported the RS232-style debugger.

 

If you want to debug:   buy a SNAP,  Pickit4,  Dragon, ...

If you only want to program your mega128 via JTAG,   use avrdude.exe or jtagice.exe as an External Tool in Codevision.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you dear David,
I can find CodeVision AVR 1.25.8, but how can I set the frequency value and other chechboxes?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I appear to have an ancient CV v1.xx program on my PC.   But it will not run under Win10.    I can't remember whether it accepts JTAGICE-1

It seems unlikely.   

 

Does your v1.25.8 offer JTAGICE-1 under Tools->Settings->Programmer  ?

 

Since you have CV v3.12 licence it seems sensible to just add avrdude.exe or jtagice.exe as an External Tool.   Job done.

 

Do you want to debug ?

Your only choice is AS4.1x

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, I want just to program it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found jtagice.exe on my PC

C:\Program Files (x86)\Atmel\AVR Tools\JTAGICE\jtagice.exe

 

I think that this came with Avr Studio 4 installation.

 

You have probably already got avrdude.exe on your PC.

 

Do you know how to configure an "External Tool" ?

The CV Help files explain.   Ask if you don't understand

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you David, I will try it and tell you the result.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi again,

After last discussion, I decide to do these two solution, that you can see in below

 

First solution:

At first I installed AS7.0 and tried to program ATMEGA128 with this software, but it couldn`t find my programmer by AS7.0 and I just saw simulator on Tool part (as you can see in below)

 

 

Second solution:

For using CodeVisionAVR 1.25.8 I had to use VMware Workstation and Windows XP, because this version didn`t install on windows 10. (I checked physical COM port in WMware, it worked properly)

Then I chose programmer type. finally, it couldn`t connect to ATMEGA128 for programming.

 

                                                                                                         

In the end my question still has remained, what`s the right setting for below picture?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are using JTAG then the SCK setting is irrelevant, but then you aren't using |JTAG are you? In which case SCK should be one-quarter of your CPU clock.

 

As for the fuses, see here...

 

http://www.engbedded.com/fusecalc/

 

but make sure you understand the difference between an external clock and an external crystal/

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

majid.conf wrote:
At first I installed AS7.0 and tried to program ATMEGA128 with this software, but it couldn`t find my programmer by AS7.0 and I just saw simulator on Tool part (as you can see in below)

https://www.microchip.com/webdoc...

 

Unfortunately the link in that page is a dead 404 link (naughty Microchip!).

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

As you told me JTAG doesn`t work. I use your link to define fuse bits but still I can`t connect to ATMEGA128.

 

Regards,

Majid

Last Edited: Tue. Dec 10, 2019 - 09:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

Codevision does not support JTAGICE-1 programmers.

AS7.0 does not support JTAGICE-1 programmers.

 

It is fairly easy to add an "External Tool" to Codevision IDE e.g.

Tool Name: JTAGICE-1

Tool Directory and Filename: avrdude.exe

Command Line Parameters: -cjtag1 -pATmega128 -Pcom2 -U flash:w:"%h":i

Working Directory:

 

Browse for your avrdude.exe

Use the correct COM# to suit your programmer

 

I tried to use jtagice.exe on my Win10 PC but it did not seem to work.

 

You can add the External Tool to AS7.0 if you prefer using AS7.0

The AS7.0 macros have a different syntax

 

David.

Last Edited: Tue. Dec 10, 2019 - 09:57 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi,

I downloaded Avrdude.exe  and set the parameters as you said (COM# and Toll name(I checked all tools)) but it didn`t work again. As you can see in below all time the message of "AVRDUDE is running" was appeared but it couldn`t find the programmer. When we use this software is it necessary to install driver for programmer?

In my opinion the problem is related to driver. If so, how can I find proper driver for that?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I downloaded Windows installer from https://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/

 

Then selected the following options:

1. Programmer: Atmel JTAG ICE (mk1)

2. MCU: ATmega128

3. Port:  COM55

4. Baud rate: 115200

5. Flash: C:\Users\David Prentice\Documents\Codevision Projects\timer_m16\Debug\Exe\timer_m128.hex

 

Then clicked Program!

 

Select your appropriate COM# and Flash address e.g. from drop-down or Browsing for file

 

I strongly advise using a command line avrdude.exe

Hey-Ho.   If you like avrdudess,   just use it.

 

If you have a problem,  take notes on paper.

Then you can provide the information in your message.    We can only help when we know your actual problem.

 

Your screenshot showed that you did not select the correct Programmer.  

So it was easy to download the same "avrdudess version" and try for myself.

Note that the [Detect] button does not work.   After all,  this is a GUI.

 

David.

 

 

Last Edited: Thu. Dec 12, 2019 - 02:24 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

majid.conf wrote:
For using CodeVisionAVR 1.25.8 I had to use VMware Workstation and Windows XP, because this version didn`t install on windows 10.
Windows 10 may have a compatibility mode for XP; otherwise, there's a Windows XP Service Pack 3 virtual hard disk that may run on Hyper-V (Windows 10 Pro and subsequent)

How to Make Old Programs Work on Windows 10

by Chris Hoffman

September 10, 2017

[mid-page]

For example, if an application doesn’t run properly on Windows 10 but did run properly on Windows XP, select the “Run this program in compatibility mode for” option, and then select “Windows XP (Service Pack 3)” from the dropdown menu.

...

Download Windows XP Mode from Official Microsoft Download Center

Make older apps or programs compatible with Windows 10 - Windows Help

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would assume that the OP has a valid licence for CV v3.12

So it should work with AS7.0 and Win10 even if his "support period" has run out.

 

Searching through obsolete CV v1.xx or v2.xx was to to see if CV supported JTAGICE-1 in the distant past.

 

Since the OP only wants to program via JTAGICE-1 any reference to STK500 or ISP is not relevant.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
So it should work with AS7.0 and Win10 ...
One update for Windows 10 :

CodeVisionAVR V3 Revision History

...

 

V3.23a Commercial Release

  • IDE
    • Improved compatibility with Windows 10.

 

...

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Despite I was sure about fuctional of COM port number 2, AS 7.0 couldn`t conncet to ATMEGA128. You can see the result in below.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi dear David,

I did your instruction step by step, but unfortunately I couldn`t 'Program' the ATMEGA1128 by this way.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What different COM#s are offered by the drop-down ?
If COM2 is the correct port but another program is using it, you will be denied. Close the other program e.g. Serial Terminal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had known about the right functionality of this port in advance and when I worked with AVRDUDE no program was using this port.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Reset the PC and start again.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


Hi dear David,

Thank you for advice. As you can see in below finally I could connect to Atmega128 by Avrdude and program it. I use this command for this purpose:

>>>: avrdude -u -c jtag1 -p m128 -P COM2 -b 115200 -U flash:w:"C:\Users\TELECOM\Desktop\a.hex":i -U lfuse:w:0xFF:m -U hfuse:w:0x81:m -U efuse:w:0xFF:m >>>: avrdude -u -c jtag1 -p m128 -P COM2 -b 115200 -U flash:w:"C:\Users\TELECOM\Desktop\a.hex":i -U lfuse:w:0xFF:m -U hfuse:w:0x81:m -U efuse:w:0xFF:m

 

Regards,

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you ended up using the regular command line avrdude.exe

 

I would expect AVRDUDESS to work too.

 

Pleased that you have been successful.

 

David.