I use the external bus interface of the MC9S12XDP512 Microcontroller to connect an external Flash. The flash is a 32Mbit, organized as 2Mx16, memory (SST39VF3201B). The following pins are connected with the controller pins (Show attachment).
Following settings are made in software:
MMCCTL0 = 0x02; // Enable \CS1
MMCCTL1 = 0x01 // Enable the Flash or ROM in the memory map
MODE = 0xA0; // Normal expanded mode - bus enabled
EBICTL0 = 0x36; // High byte enable and ADDR21:1
EBICTL1 = 0x02; // Stretch = 3cycles
When I read from memory, following happens:
Unsigned int data = *((unsigned int *far)0x200001);
-> ADDR1 is set to 1 -> OK
Unsigned int data = *((unsigned int *far)0x200002);
-> ADDR1 is set to 0 -> OK
-> ADDR2 is set to 0 -> Why not 1?
Unsigned int data = *((unsigned int *far)0x200003);
-> ADDR1 is set to 0 -> Why not 1?
-> ADDR2 is set to 1 -> OK
Is there something wrong?