![]() | ![]() | ![]() |
| |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
![]() |
| | Tools |
| | #1 |
|
Hi, It's my first post here, I have an embedded system, a pcb which have an AT89C51SND which communicates with a CompactFlash by a latch 74573 (for P0 signals address and data) and I want to test this communication. I want to read a sector (register) in the Compact Flash so I try first to write on the external ram and read this values but it doesn't work ( I read FFh only). Howewher ALE is set it does'nt seems to work. For true ide mode for the CompactFlash, I must set the bit EXT16 and my AUXR register has this config : 0xCDh. My code is in Keil compilator: Code: Code: /* READ registers AT-interface */
#define atBASE 0xc000
unsigned char volatile xdata atrDATMSB _at_ 0xF000; /* MSB register op interface-kaart */
unsigned char volatile xdata atrALTERN _at_ 0xF006;
unsigned char volatile xdata atrDRIVAD _at_ 0xF007;
unsigned char volatile xdata atrDATLSB _at_ 0xF008;
unsigned char volatile xdata atrERROR _at_ 0xF009;
unsigned char volatile xdata atrSECCNT _at_ 0xF00A;
unsigned char volatile xdata atrSECNR _at_ 0xF00B;
unsigned char volatile xdata atrCYLLOW _at_ 0xF00C;
unsigned char volatile xdata atrCYLHIG _at_ 0xF00D;
unsigned char volatile xdata atrDRHEAD _at_ 0xF00E;
/* AT89 config & registers */
CS0 = 0x01; //CSO
CS1 = 0x00; //CS1
AUXR = 0x4D; // the bit 7 is set by default so AUXR = 0xCD
printf("test loop...\n\r");
for(j=0;j<256;j++)
{
atrSECNR = j;
for (z=0;z<1000;z++);
delayrout(50000);
printf("-[%X]\n",atrSECNR);
}
.. -[FF00] -[FF00] ... When I try to read or write it's not work. Is there a programming problem or addressing external registers? Can you help me please ? Is that the good way to test an external register of the compactflash ? Thank you. | |
| |
|
| Tags |
| addressing, compact, flash, problem, read, register, write |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| How to reset SCR used for triggering camera flash | shootfirst | Electronic Projects Design/Ideas/Reviews | 22 | 8th May 2009 09:22 PM |
| Newcomers, please read! (PIC regarded) Upd. 0xD | Jay.slovak | Micro Controllers | 0 | 17th April 2005 02:05 PM |
| I2C Master write problem using SSP (here's code) | Oznog | Micro Controllers | 1 | 16th October 2004 06:48 AM |
| MC 6802 with no read write | simoV8 | General Electronics Chat | 5 | 11th April 2004 06:00 PM |
| pc keyboard interfacing problem | econsyst | Micro Controllers | 0 | 8th November 2003 09:28 PM |