Can I access variables (in C code) defined in an external memory device

Document created by analog-archivist Employee on Feb 23, 2016
Version 1Show Document
  • View in full screen mode

Can I access variables (in C code) defined in an external memory device (or an
8-bit wide CPLD). Let's say I know that one 16-bit CPLDregister has the address
0x8000000. Can I define this register (REG1) as:

#define REG1 ((volatile unsigned int *)0x8000000)

Can I then assign some content to it, let's say a value of 0x8040 as

*REG1 = 0x8040;

 

Yes, that is correct. The above code snippets will assign a 32-bit variable at
address 0x8000000, and then write 0x00008040 to it. (This example is valid for
an ADSP-21369 SHARC processor, where 0x8000000 is an external SDRAM address.
The principal is the same for all SHARC processors but be sure to use a valid
address.)

Attachments

    Outcomes