Xmega using pgm_read_float_far

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

Hi,

I am using an Xmega256D3. I have large table in program memory (> 64K) that I need to read from. I am using the pgm_read_float_far() but for some reason, the value read are not correct. Any thought on what might be wrong?

 

The table is defined by:

struct float_X_Y PROGMEM const cor_table_Nonane[300] = ...

 

 

Access to the data is :

 

 point_x =  pgm_read_float_far((unsigned long)(&cor_table_nonane[0]));

 

Thank You.

 

Charles

 

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

&cor_table_noname is a 16 bit pointer in the AVR world. You need to employ get_far_address
.
But why using old style pgm_ access?
.
Also no avr-gcc array (or any single data object) can be greater than 32K

Last Edited: Thu. Apr 13, 2017 - 03:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Clawson,

 

In your comment "Why using old style pgm_" access. What should I be using?

 

Thank You.

Charles

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

__flash and perhaps more importantly __memx