Compiler/IDE for programming ATMega103 MCU using JTAG programmer - Page 1
Forum section: electronics / general

author: FlyingDutch
author_rank: Regular Contributor
timestamp: January 19, 2020, 11:24:24 am
content: Hello,I implemented AVR soft-core (ATMega103) based on project form opencores.org - here is link to this project:https://opencores.org/projects/avr_coreI implemented it for Artix7 FPGA, exactly for Digilent "Cmod A7" board:https://reference.digilentinc.com/reference/programmable-logic/cmod-a7/start?redirect=1id=cmod_a7/cmCurrently I haven't any implementastion issues. I am looking for Compiler/IDE in which I will be able to program this soft-cpu using JTAG programmer (this soft-proceessor has built-in JTAG programming intefrface). I am looking for example for board description for Arduino IDE allowing prograsmming ATMega103 AVR MCU. I tried also "Atmel Studio" (versins 7 and 6),b ut there are no programming target ATMega103.Could somebody give mi e hint when I can find compiler allowing programming of ATMeg103 AVR MCU?Thanks in advance and Regards

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: January 19, 2020, 12:33:16 pm
content: Quote from: FlyingDutch on January 19, 2020, 11:24:24 amThat chip is so obsolete... you will struggle to find anything to support it. You can probably still compile code for it with gcc, but forget about any IDE or JTAG support. Your only option there is to roll your own device support.

author: mikerj
author_rank: Super Contributor
timestamp: January 19, 2020, 12:53:13 pm
content: Atmel Studio is the manufacturers development tool which includes an IDE, debugging and programming support and (in the later versions) also the GCC compiler.However the Mega103 is a very old, discontinued part and I don't think it is supported by later versions of Studio. If not you can install an older version e.g. Studio 4 which does support this device, but does not include a compiler so you will need to download and installWinAVR. Despite being an ancient version of Studio I have had this running ok on 64bit Windows. Note that the code editor in this version is terrible by modern standards, but you are obviously free to use whatever editor you wish outside the IDE.Alternatively the Mega128 is a very similar device to the Mega103, and the 128 is definitely supported in later versions of Studio. The 128 includes configuration fuses to make it behave like the 103, so it may be possible to compile code as a 128 whilst paying careful attention to the differences between the parts.

author: FlyingDutch
author_rank: Regular Contributor
timestamp: January 19, 2020, 02:35:31 pm
content: Hello,I will first try Atmel Studio 4 with WinAVR compiler, then also try programming this soft-processor as ATMega128 in newer compiler.Thanks for all hintsRegards

author: rstofer
author_rank: Super Contributor
timestamp: January 19, 2020, 05:13:49 pm
content: Some years back, when I was playing with the ATmega128, I was using Linux. I had installed avr-gcc, avr-libc and avr-dude (the programmer) and all I used for the IDE was 'gedit'. A simple Makefile had targets for 'make all', 'make program' and 'make clean'. For larger projects, dependencies can also be automated with 'make depend'.All of those tools already exist in the Arduino directories. I haven't tried it but I suppose you could use the Arduino IDE and none of the Arduino specific libraries.Or, you can spend the time to install Eclipse. Microsoft Visual Studio will probably work and, as just an IDE, Visual Code works pretty nice. There may be a plug-in to allow programming, there are a lot of plug-ins for Visual Code and Eclipse. If not, keep a console open and just use avr-dude directly (probably through a batch file so you don't have to keep typing all the options).I have't used Visual Studio for ATmega projects in a long time but it used to work well. I was adding switches, knobs and dials to Microsoft Flight Simulator using the Windows SDK and the tools for an ATmega <something> all in the same session. I could compile and test the C++ code for the PC and compile/program the ATmega code all from the same IDE. No, I don't remember how I set that up but it worked well.

author: rstofer
author_rank: Super Contributor
timestamp: January 19, 2020, 05:15:26 pm
content: Quote from: mikerj on January 19, 2020, 12:53:13 pmThe 128 is a great chip! It has decent performance, plenty of memory and, more important, lots of pins. It is my favorite ATmega device.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: January 19, 2020, 05:34:16 pm
content: Quote from: FlyingDutch on January 19, 2020, 02:35:31 pmHow are you planning to program it, given the original Atmel103 had no support for JTAG? Does the soft core support SPI programming? If so you might be able dig out some ancient programmers like STK500.

author: Kilrah
author_rank: Unknown
timestamp: January 19, 2020, 05:37:10 pm
content: Would be interesting to upgrade the FPGA design to an atmega128

author: westfw
author_rank: Super Contributor
timestamp: January 20, 2020, 02:20:42 am
content: Atmega128a is theoretically backward-compatible with ATmega103 - it even has 103 compatibility mode (about which there are app-notes.)So you can probably fire up a current AS7 and tell it you're using the 128a, as far as getting the right code and peripherals (being careful to only use the peripherals present on a 103, of course.)The original 103 didn't have JTAG (nor any other debugging capabilities, that I can see.) With luck, your implementation might be compatible with the 128 JTAG. Or you can set up AS to use an "external tool" for the programming (perhaps some OpenOCD-based script.)

author: FlyingDutch
author_rank: Regular Contributor
timestamp: January 20, 2020, 09:23:05 am
content: Quote from: Kilrah on January 19, 2020, 05:37:10 pmHi, yes but it is beyond my skillsRegards

author: FlyingDutch
author_rank: Regular Contributor
timestamp: January 20, 2020, 09:26:02 am
content: Quote from: westfw on January 20, 2020, 02:20:42 amHI, thanks for clarification, I will try program this soft-cpu as ATMega128. If I have any results I write them in tis post.Regards