Parts with mapped flash to data space

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

From AVR instruction set manual:

 

In some parts the Flash Memory has been mapped to the data space and can be read using this command (LD, ...)

This property is present for eeprom in XMEGA but I cannot find any part with mapped flash.

Ozhan KD
Knowledge is POWER

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

The comment there is actually talking about the "brain dead" Tiny chips (4,5,9,10,20,40).

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

A very special thanks to the great cliff clawson.

Ozhan KD
Knowledge is POWER

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

From AVR instruction set manual:

 

LDS (16-bit) – Load Direct from Data Space

...

In some parts the Flash memory has been mapped to the data space and can be read using this command.

...

Memory access is limited to the address range 0x40..0xbf.

Flash memory address begins from 0x4000 in tiny chips and 16 bit LDS/STS cannot access this range. So in what part(s), 16 bit LDS/STS can access flash memory?

Ozhan KD
Knowledge is POWER

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

0x4000 in tiny chips and 16 bit LDS/STS cannot access this range.

As 0x4000 fits nicely into 16 bits, why do you say "cannot"?

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.

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

Aahh, I see a bit of your confusion.  There are two forms of LDS, the short form and the long form.  You quoted from the short form.  The long form has a full 16-bit address.  And the long form description doesn't mention flash.

 

 

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.

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

Aahh, again--my toolchain (CodeVision) generated LD instructions to make the accesses in a test program with Tiny40 target.

 

Perhaps the short-form LDS is tailored for I/O memory--I'd have to look at the memory map.  And perhaps, indeed, the long-form LDS isn't used for flash access?  (I'd need a more elaborate test program; the compiler optimizes the heck out of a very simple one.)

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.