4.4.5 Interfacing Program and Data Memory Spaces

The dsPIC33CK512MPT608 family architecture uses a 24-bit wide Program Space (PS) and a 16-bit wide Data Space (DS). The architecture is also a modified Harvard scheme, meaning that data can also be present in the Program Space. To use these data successfully, they must be accessed in a way that preserves the alignment of information in both spaces.

Aside from normal execution, the architecture of the dsPIC33CK512MPT608 family devices provides two methods by which Program Space can be accessed during operation:

  • Using table instructions to access individual bytes or words anywhere in the Program Space
  • Remapping a portion of the Program Space into the Data Space (Program Space Visibility)

Table instructions allow an application to read or write to small areas of the program memory. This capability makes the method ideal for accessing data tables that need to be updated periodically. It also allows access to all bytes of the program word. The remapping method allows an application to access a large block of data on a read-only basis, which is ideal for look-ups from a large table of static data. The application can only access the least significant word of the program word.

Table 4-5. Program Space Address Construction
Access TypeAccess

Space

Program Space Address
[23][22:16][15][14:1][0]
Instruction Access

(Code Execution)

User0PC[22:1]0
0xxx xxxx xxxx xxxx xxxx xxx0
TBLRD/TBLWT

(Byte/Word Read/Write)

UserTBLPAG[7:0]Data EA[15:0]
0xxx xxxx xxxx xxxx xxxx xxxx
ConfigurationTBLPAG[7:0]Data EA[15:0]
1xxx xxxx xxxx xxxx xxxx xxxx

Figure 4-12. Data Access from Program Space Address Generation