We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi... i am using ECS1 as external data n the port i haf connected it to is D0 - D7... how do i set bit for D0 -D7???
Presumably, it's some part that comes in a 40-pin package. "ECS1" sounds like some sort of programmable chip select to me. If someone referred to D0-D7, normally I'd think they were talking about the data bus. Those pins are also port 0, if you're not actually accessing external databut using the I/O port. But it sounds more like this device is memory-mapped into the external address space at address 0x4000. In that case, you should configure the chip to allow external data access, and just read or write to that address. The ports should already be defined in the header file Keil supplies for your particular 8051 variant. (Which chip are you using, by the way?) Port 0 is usually called "P0" and is SFR 0x80. I suppose it's also possible someone decided to call the ports A, B, C, and D, instead of P0, P1, P2, and P3. In that case, P3 would be 0xB0. As Andy said, the data sheet for your particular 8051 variant should tell you for sure.