megaAVR 0-series

Go To Last Post
185 posts / 0 new

Pages

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

Some things are not very logical.
- Why new 8/16/32er Tinys have the double amount of ADC's than brandnew Megas here?
- Mega0 Interrupt-Table looks very messy.
- The labeling on the housings is still Atmel...

Last Edited: Fri. Nov 23, 2018 - 07:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Von Neuman architecture compilers (including gcc) generally just put all "const" data (inc literal strings) into ROM/Flash, or have an option to do so.  Perhaps whatever hack avr-gcc uses to put const data in RAM can simply be turned off?

 

Edit:  Oh wait - perhaps not.   Addresses in .text are zero-based, but when accessed as data, they appear at a different offset...

 

Followup.  Apparently I was worried about an issues that has been solved for a long time.

Avr-gcc already has an "architecture" defined for AVRs like the ATmega4809

"const" data, including literal strings, goes off into the .rodata section, with symbols appropriately offset and accessible via "ld" instructions.

If you're using one of the chips with a unified 64k address space, you shouldn't need PROGMEM or __flash...

 

-mmcu=atxmega3

avrxmega3

“XMEGA” devices with up to 64 KiB of combined program memory and RAM, and with program memory visible in the RAM address space.

This does indeed appear to do the desirable thing with data that is merely "const" (including literal strings), and subsequent tools also behave as desired.

 

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <stdio.h>

const char s[] = "this is a const string";
const char PROGMEM p[] = "this is a progmem string";
const char __attribute__((section(".text"))) t[] = "this is a .text string";
const char __flash f[] = "this is a __flash string";

int main() {
    printf("%s\n", s);
    printf("%s\n", p);
    printf("%s\n", t);
    printf("this is a constant literal string.");
}

Compile with "avr-gcc -mmcu=atmega4809 -g -Os foo.c", copy to .hex with "avr-objcopy -O ihex -R .eeprom a.out a.hex"

 

(edited) "avr-nm -S -n" output:

000000a0 T __trampolines_end
000000a0 T __trampolines_start
  :
000000a0 00000019 T f          *** __flash string ***
000000b9 00000019 T p          *** progmem string ***
000000d2 T __ctors_end
000000d2 W __init
000000de 00000010 T __do_clear_bss
000000f6 T __bad_interrupt
000000f6 W __vector_1
  :
000000f6 W __vector_9
000000fa 00000017 T t
00000112 0000002e T main
  :
00000752 t __stop_program
00000754 T _etext
  :
00004000 A __RODATA_PM_OFFSET__
00004754 00000017 R s       *** const string *** (note == _etext!) ***

 

Edited Output from "avr-objdump -s a.out":

Contents of section .text:
   :
 0090 0c947b00 0c947b00 0c947b00 0c947b00  ..{...{...{...{.
 00a0 74686973 20697320 61205f5f 666c6173  this is a __flas
 00b0 68207374 72696e67 00746869 73206973  h string.this is
 00c0 20612070 726f676d 656d2073 7472696e   a progmem strin
 00d0 67001124 1fbecfef cdbfdfe3 debf28e2  g..$..........(.
 00e0 a0e0b8e2 01c01d92 a630b207 e1f70e94  .........0......
 00f0 89000c94 a8030c94 00007468 69732069  ..........this i
 0100 73206120 2e746578 74207374 72696e67  s a .text string
 0110 000084e5 97e40e94 b60089eb 90e00e94  ................
   :

Contents of section .rodata:
 4754 74686973 20697320 6120636f 6e737420  this is a const 
 4764 73747269 6e670074 68697320 69732061  string.this is a
 4774 20636f6e 7374616e 74206c69 74657261   constant litera
 4784 6c207374 72696e67 2e00               l string..        *** Where we want it! ***

 

edited output from "avr-objdump -s a.hex"

Contents of section .sec1:
 0000 0c946900 0c947b00 0c947b00 0c947b00  ..i...{...{...{.
   :
 00a0 74686973 20697320 61205f5f 666c6173  this is a __flas
 00b0 68207374 72696e67 00746869 73206973  h string.this is
 00c0 20612070 726f676d 656d2073 7472696e   a progmem strin
 00d0 67001124 1fbecfef cdbfdfe3 debf28e2  g..$..........(.
 00e0 a0e0b8e2 01c01d92 a630b207 e1f70e94  .........0......
 00f0 89000c94 a8030c94 00007468 69732069  ..........this i
 0100 73206120 2e746578 74207374 72696e67  s a .text string
   :
 0740 aa81b981 ce0fd11d cdbfdebf ed010895  ................
 0750 f894ffcf 74686973 20697320 6120636f  ....this is a co   *** Where we want
 0760 6e737420 73747269 6e670074 68697320  nst string.this    ***  this in flash
 0770 69732061 20636f6e 7374616e 74206c69  is a constant li
 0780 74657261 6c207374 72696e67 2e00      teral string..  

 

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

Service Pack 7.10.3

...

  • Support has been added for the following devices:
    ATA5787, ATA5835, ATmega3208, ATmega3209, ATmega4808, and ATmega4809.

...

That is not the question here.

That could be true with just with adding correct memory and IO model. (the chips still have LPM)

 

The question is if the compiler use that the flash also is memory mapped. So instead of only Z as a pointer also X and Y can be used.

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

Hey, just a theoretical question - in older AVRs Flash, EEPROM and RAM were separated but now they are "together" in one address space. So is it possible to run program from RAM or EEPROM?

extronic.pl

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

extronic wrote:

...but now they are "together" in one address space. So is it possible to run program from RAM or EEPROM?

 

They are not together, they are still two separate entities. All that has changed is that the code space is now visible within a region of the data space memory map. See figure 5-1 in the datasheet. Note that the inverse, with data visible within the code space, does not happen.

#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

one could hope that there would come a new version of AT94K chips, they are so far the only AVR's that run code from RAM

 

why would you run code from RAM in most cases a simple interpreter would do a fine job (about the speed of C code).

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

You're right. Thanks for your explanation.

extronic.pl

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

No. Take a look at the memory map for the Mega4809 for example, the program memory is placed at the top of the memory space. Since the program counter can only address the code space, it can't see the other memory types that are at lower addresses.

 

However, to address 48k of flash (24k words) the PC must be 15 bit. So we can place values addressing 48k-64k there. I wonder how that is handled...

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

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

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

It's actually surprise me that a 4809 is 14% faster than a XMEGA (at same clk speed)

 

add:

But since they use the IAR compiler it's not relevant for many of us.

Last Edited: Fri. Nov 30, 2018 - 03:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:

But since they use the IAR compiler it's not relevant for many of us.

 

You could always download Coremark and compile with your chosen GCC-AVR version.

#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

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

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

sparrow2 wrote:
It's actually surprise me that a 4809 is 14% faster than a XMEGA (at same clk speed)
From the megaAVR 0-series manual in notes for the instruction set summary :

2. One extra cycle must be added when accessing lower (64 bytes of) I/O space.

Likewise in the XMEGA AU manual :

2. One extra cycle must be added when accessing Internal SRAM.

BUS Matrix is apparently improved simpler for megaAVR 0-series versus XMEGA (XMEGA AU has a DMA controller as an additional bus master)

 

Edit: DMA

 

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

Last Edited: Sat. Dec 1, 2018 - 04:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://packs.download.atmel.com/#collapse-Atmel-ATmega-DFP-pdsc

1.3.300 (2018-11-27)

...

Corrected TCA0 event names for ATmega4809|4808|3209|3208|1609|1608|809|808. Added linker scripts for ATmega809. 

...

 

"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

Curiosity Nano boards are on sale through 3-Jan'19 :

https://plus.google.com/+MicrochipTech/posts/fCjvY9JaFWc

Have yourself a merry little….development board! Enjoy 25% off one of our Curiosity Nano boards from now through January 3, 2019. Offering full programming and debugging capabilities, the ATmega4809 and the PIC16F18446 Nano boards offer complete support for your next design. They're also small enough to keep in your pocket or hang on your tree. Click here to place your order and use code NANOHOLIDAY at checkout: https://mchp.us/2LdtHLc

...

the URL in that post :

Microchip Technology - Development Tools - Curiosity Nano Boards

 

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

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

Arduino Bluetooth Low Energy version 0.1.0 was released 13-Nov'18 :

GitHub - arduino-libraries/ArduinoBLE

...

Enables BLE connectivity on the Arduino MKR WiFi 1010 and Arduino UNO WiFi Rev.2.

This library currently supports creating a BLE peripheral.

...

 

"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

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

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

Cool, that guy figured out a way of combining my jtag2updi UPDI programmer with the Arduino Uno WiFi R2 software package, that supports Mega4809.

I suspected it could be done in theory, but never actually decided to do it, my knowledge of the intricacies of Arduino IDE configuration files is not that good.

 

I'll link to his method: https://hackaday.io/project/1348...

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

 

Courageous decision to ditch the offset connectors

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

angelu wrote:
Courageous decision to ditch the offset connectors

So not Arduino shield compatible.....

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

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

mega4809 Curiosity Nano is on sale at 40% off of 10USD.

ATmega4809 Curiosity Nano

via Dev Tool Deals | Microchip Technology

 

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

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

gchapman wrote:

mega4809 Curiosity Nano is on sale at 40% off of 10USD.

ATmega4809 Curiosity Nano

via Dev Tool Deals | Microchip Technology

 

Good to know. In my opinion this is one of the best devboards ever made. 

 

Early boards had a bug that caused built-in USB/UART converter to hang up after programming the ATmega4809. There's new firmware for programmer chip, but Atmel Studio doesn't load it automatically. You need to upload it as described here:

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

extronic.pl

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

What makes it best devboard ever? I see a button and a yellow LED but other than that what does it have to set it apart?

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

Simplicity is the ultimate sophistication :) 

 

What I like in this board

  • Simple connector which makes it convenient to plug into the breadboard and connect anything needed. I don't like any fancy shaped connectors for example Arduino or Xplained PRO. All IO pins are available for prototyping and they are not hard-wired to any stuff that I don't need.
  • Fully functional debugger
  • Voltage regulated from Atmel Studio
  • USB/UART
  • Simple logic analyzer
  • Low price

 

extronic.pl

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

extronic wrote:
Simple connector which makes it convenient to plug into the breadboard and connect anything needed.
Proof-of-concept that can be left with a customer and/or operator(s) for a while so they can evaluate; can lead to a design win-win.

Such eases one's ability to bootstrap an operation or project.

extronic wrote:
Voltage regulated from Atmel Studio
fyi, though MPLAB X has some megaAVR 0-series issues, it seems reasonably functional.

MCC has mega4808 and mega4809.

 

extronic wrote:
Low price
Schools and colleges can afford these, can be a part of course-ware that's supplied by instructors to trainees

 

 


Bench Talk | Make Your Own Job with Open Source Hardware: What Students Don't Know

by Lynnette Reese

August 27, 2014

(7th paragraph)

The truth is that semiconductor companies want engineers to know about, understand how to use, and get comfortable with their MCUs because it’s a low cost investment in adoption of these MCUs into larger sockets later on. 

...

https://www.avrfreaks.net/forum/come-join-us-mplab-now-supports-avrs?page=3#comment-2527161

https://www.avrfreaks.net/forum/come-join-us-mplab-now-supports-avrs?page=5#comment-2643626

MCC - MPLAB Code Configurator

Release Notes MCC v3.25

(page 10)

[AVR in Core v4.65]

http://ww1.microchip.com/downloads/en/DeviceDoc/release_notes_avr8bit_v1_1_1.pdf

Release Notes for MPLAB® Code Configurator 8-bit AVR MCUs library v1.1.1

(page 3)

10 Appendix: Supported Devices

[tinyAVR 1-series]

ATMega4808  ATMega4809  ATMega1609*

* These devices will be supported in future releases of MPLAB® X IDE.

via MPLAB Code Configurator | Microchip Technology (Current Download tab)

 

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

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

CodeVisionAVR V3 Revision History

V3.35 Commercial Release

  • Compiler
    • Added support for the ATmega3208/3209/4808 chips

...

edit: CodeVisionAVR V3.35 evaluation is dated 4-Mar'19

 

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

Last Edited: Mon. Mar 11, 2019 - 10:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IAR Information Center for Microchip AVR - Release notes

Release notes

for IAR Embedded Workbench for Microchip AVR version 7.20.1

...

 

Highlights

...

  • Support for new devices

Support for ATmega808, ATmega809, ATmega1608, ATmega1609, and AT90SCR400 has been added.

 

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

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

So what's the story with this "AT90SCR400"? This is an AVR, but not made by Microchip. It's from some small company called Wisekey.

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

That's why I couldn't find it smiley

 

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

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

Wisekey: https://cdn.wisekey.com/uploads/...

 

So, as the name might imply, an AVR with a "secure key" inside.

 

There seems to be a recent trend for putting keys in micros. Presumably this is all about stopping "foreign powers" taking over the world's network of Alexas or something ??

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

Wisekey: https://cdn.wisekey.com/uploads/...

...

• 208 KB EEPROM

...

... WISeKey AVR 8/16-Bit RISC secure microcontroller core;

...

Only XMEGA has 24b of data addressing; "8/16-Bit" appeared when Atmel XMEGA appeared.

...

• 352 KB of ROM

...

Secure Memory Swap allows infrequently used applets to be securely stored in available host memory and moved back into the secure element memory for execution as needed.

...

Guessing an XMEGA with a secure bootloader plus crypto functions.

 

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

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

They even have a dual-core AVR surprise

 

Pages