Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

[Solved] ATmega32 firmware issues in SimulIDE

2 posters

Go down  Message [Page 1 of 1]

nymo



Greetings team,

Pardon the bother once again but I seem to be facing some problems with getting the AVR ATmega32 working in SimulIDE. My system specs are:
  • Arch Linux 6.0.7-arch1-1
  • Arduino 1.8.19 (from the official Arduino website)
  • Simulide 0.4.15_SR10-2


Additionally with the following optional dependencies:
  • simavr 1.7-3 (from the AUR)
  • avrdude 1:7.0-2 (from the official Arch repos)
  • avr-gcc 12.2.0-1 (from the official Arch repos)
  • avr-libc 2.1.0-1 (from the official Arch repos)


The problem is rather curious: so far I've been doing a lot of programming for the ATmega328 which works absolutely flawlessly, but when I try to run the simplest of codes for the ATmega32, nothing seems to run at all. None of the microcontroller's registers even change. I've tried getting an LED to remain powered with the following circuit:
[Solved] ATmega32 firmware issues in SimulIDE Screen10

And code being:
Code:
# include <avr/io.h>
int main(void)
{
    DDRD = (1 << PD7);
    PORTD = (1 << PD7);
}

But no dice. I can't seem to understand what's going wrong, and where. All code for the 328 can be compiled, uploaded and tested without a hitch, all examples for the 328 work fine, but I'm quite flummoxed at why don't any of the registers on the ATmega32 change. I believe my basic code to be correct, though I'm not completely convinced..

Any help would be greatly appreciated, and thank you very much in advance for your time!



Last edited by nymo on Fri Nov 11, 2022 9:25 am; edited 1 time in total

arcachofo

arcachofo

Hi.
how do you compile that code?

nymo



arcachofo wrote:Hi.
how do you compile that code?


Hi Arachofo, thank you so much for responding! Apologies for the delayed response; I compile and upload it by clicking on the "UpLoad" button that's on the top right of the SimulIDE window. For the Arduino toolchain, I untar'd the Arduino 1.8.19 archive and pointed the editor's compiler path to that extracted folder.

The compilation proceeds as normal with a "SUCCESS!!! Compilation Ok" message, as does the uploading to firmware with a "FirmWare Uploaded to atmega32" message.

This approach worked for the 328, is it incorrect for the ATmega32?

arcachofo

arcachofo

This approach worked for the 328, is it incorrect for the ATmega32?
No, you need to use avrgcc directly (not possible in SimulIDE 0.4.15).

In SimulIDE 1.0.0 you can compile using avrgcc, have a look here:
https://simulide.forumotion.com/t316-new-custom-compilers

nymo likes this post

nymo



arcachofo wrote:
No, you need to use avrgcc directly (not possible in SimulIDE 0.4.15).

In SimulIDE 1.0.0 you can compile using avrgcc[...]


That's actually pretty wicked! I'll give it a go a while later today, thanks a lot for your time and assistance Arcachofo!



Last edited by nymo on Fri Nov 11, 2022 9:26 am; edited 1 time in total (Reason for editing : Marked issue as solved)

arcachofo likes this post

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum