WHERE IS "MY" CODE ?? ATmel Studio 7

HI

I have downloaded ATMEL studio 7 (AT S 7) and installed it. (takes approx. 2 1/2 hour!) .

First I connect my Ard UNO (with a running LCD-display program), then I start AT ST 7. I go to TOOLS --> DEVICE PROGRAMMING . The TOOL says SIMULATOR and I pick the ATMega 328P from the drop-down list and presses APPLY.

To check that it works I press READ in DEVICE SIGNATURE.

No problem about this:

I then press MEMORIES in the right LIST and get a kind of menu on the right side.

Flash (32Kb)

EEPROM (1 Kb).

When I Press READ for FLASH-memory a pop-up ask for a filename. I enter a filename (eg. doc_222.HEX) and presses OK. A few seconds later I open DOC_222.hex and scan it.

Nothing but FF's in the data field in the hex-file.

According to my knowledge (and what I have read recently), the LCD-display program should be in FLASH-memory, but apparently IT is not !

I Just wonder :

Where IS my code ("LCD-program") or is the AT S 7 program not able to READ the flash memory without a programming unit (eg. AVR ISPmk II or equivalent) or have I got It all wrong ????

But where is "my" code ?? and How do I read/get it ?

KRIS aka snestrup2016

You can use the bootloader to read the flash.

The command is something like

avrdude -p atmega328p -c arduino -P (SERIL_PORT_ARDUINO_IS_AT) -b 115200 -U flash:r:ldc_display.hex

You can even set up AS7 to use avrdude as an ISP tool, but frankly why bother. I will let someone else explain how to use the avrdude tool from the Arduino IDE on Windows, for myself I setup WSL with Ubuntu

https://docs.microsoft.com/en-us/windows/wsl/install-win10

then add the following packages to the Ubuntu install after the updates.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git gcc-avr binutils-avr gdb-avr avr-libc avrdude

That is all you need to build AVR programs. I have doubts that Microchip is going to keep Atmel Studio going if what I read is true (e.g. AVR is being added to MPLAB). AS7 is huge as you have seen, which is its undoing. You might want to look at VSC, which is quite wonderful. You will have to link it to the AVR library's to make intellisense and completion work, but it is a treat to use.

https://code.visualstudio.com/docs/editor/intellisense

What do you think AS7 is going to provide that the Arduino IDE does not?

HI,

Thanks for the answer.

avr_fred: Yes, I know that the ARD. C/C compiler is strong, and it works fine (even for me).

But in a pending project (on a 2650 AT mega) I need speed as it will control 4 interacting stepmotors, 2 2-ways brushless motors (L293D) also interacting on 2 stepmotors (not directly, but electronically) and some supporting electronics and my pre-calculations about the program (routines) shows time-critical (@ 16 MHz) considerations. And the only way to obtain speed in these routines is to use ASSEMBLER.

I will use a 328-P's as "guinea pigs" to test this.

Kris

avr_fred:
What do you think AS7 is going to provide that the Arduino IDE does not?

Cred.

The TOOL says SIMULATOR and I pick the ATMega 328P from the drop-down list and presses APPLY. … I then press MEMORIES in the right LIST and get a kind of menu on the right side.
… Nothing but FF’s in the data field in the hex-file.

That’s because you’re reading the “flash memory” of the simulator. Your code is actually on the chip. To read it with Atmel Studio, you will need a device programmer or debugger that is recognized by Studio as a valid tool, like an Atmel ICE. (If you had one connected to your computer, it would show up in the drop-down list.) AFAIK, Studio can not read code via the Arduino bootloader.

Yes, I know that the ARD. C/C compiler is strong, and it works fine (even for me).

It’s not just “strong”, it is the same compiler as the one used by Atmel Studio (relatively minor version differences not included.)

westfw:

Thanks, you have just "confirmed" my thoughts. (Missing AVR IspMK II programming unit).

Having just ordered a new one from Sparkfun, as the old one seems to be blown (damn).

Thanks again.

Kris