??? 01/27/05 07:01 Read: times Msg Score: -1 -1 Answer is Wrong |
#85894 - Prepaid Energymeter: need help Responding to: ???'s previous message |
Hi,
I believe it is very easy to implement SPI and I2C using any of the 8051 MCS51 standard based micro-controller. Regarding with your Hardware, i assumed that, you are going to use External RAM, ROM and E2PROM etc. Better Go for 80C32 micro-controller. You can connect the 27C256 and 62C256 IC's in the Address bus. Use PSEN, RD, WR in combination with selecting the Chip Select. For A0 to A14 u can use it for Addressing and A15 can be used as extending the Memory or Memory mapped IO. Your P1 port will be free in this scheme. You can use P1.0 and P1.1 as the SDA and SCL line of I2C bus. This 80C32 will work as a master. You can write the Code for Checking the Device Availability and Bus status, Read, write. Also this can be written as a fucntion. use it where ever it is required. Use timer0 as a constant clock generator. Use timer0 and generate 1ms/100us based on your requirement and this will act as a SCL. use other timer1 for SPI and timer2 for general purpose. The above configuration was already implemented and tested successfully. Please let me know you need any further info. With Best Regards, GK |