Hi, Last 10days, i face the initialization problem in the P87c51MC2 based board.
Just written the program the switch ON and OFF two bits in Port1.
Attached the schematic.
The code is very simpla. the same is as below
#include <stdio.h> #include <absacc.h> #include <reg51m.h>
// program to test the external RAM interface
// P1.0 and P1.1 will be switched ON and OFF
void delay(unsigned int x);
//#define testXram FVAR (unsigned char, 0x2000) /* unsigned char at HDATA address 0x14FFE */ unsigned char far testXram _at_ 0x020800; unsigned char far LCDPORT _at_ 0x7E0030; // CS6 unsigned char far KEY8279CON _at_ 0x7E0000; // CS3 unsigned char far ADDCS5 _at_ 0x7E0020; // CS5
unsigned char far PPI8255CTRL _at_ 0x7E0013; // CS4 PPI Ctrl unsigned char far PPI8255PORTC _at_ 0x7E0012; // CS4 PPI portc unsigned char far PPI8255PORTA _at_ 0x7E0010; // CS4 PPI portc unsigned char far KEY8279DATA _at_ 0x7E0001; // CS3
void main (void) { unsigned char lcdtest=0x01,*x1; MXCON = MXCON|0x07; //EAM bit should be set before 0xFB address AUXR = 0x03; // external xram and ALE enable for MOVX or MOVC
delay(0x5ff); LCDPORT = 0x72; testXram = 0x11; while(1) { P1 = P1 & 0xFC; delay(0x6ff); x1 = &testXram; if(*x1== 0x11) P1 = P1 | 0x03; delay (0x6ff); } }
void delay(unsigned int x) { for(;x--;x>1) {;} }
Huge memory model is selected. COmpliation and linking no error.
Even I am able to view the square wave in the P1.0 But the same is not repeating.
I doubt, am I missing any power on initialization. please let me know.
venkat
Fantastic scheme! Brilliant work! Well done!