Dear Members,
I will use MC9S12P64 with the external Serial EEPROM of I2C or SPI mode.
MC9S12P Series doesn't have I2C Port. 1 port SPI will be connected to I.MX6 SPI Port.
So, I should use the serial EEPROM with I2C interface.
Although MC9S12P series doesn't have I2C Port, I think that I/O port can use I2C Interface to operate the I2C mode EEPROM.
Could you advice to me with reference schematic , Port Number..etc
Thanks
解決済! 解決策の投稿を見る。
Unfortunately we don’t have any example code for I2C emulation on S12 devices.
However I would like to recommend two application notes for RS08 MCUs:
There is application note AN3304 IIC Slave on RS08KA2
http://www.freescale.com/files/microcontrollers/doc/app_note/AN3304.pdf
and AN3317 IIC Master on the MC9RS08KA2
http://www.freescale.com/files/32bit/doc/app_note/AN3317.pdf
You can use these application notes as inspiration.
As GPIO, you can use almost any port from MCU.
If you will use port AD, please do not forget enable digital input buffer at appropriate digital pins (ATDDIEN register).
Unfortunately we don’t have any example code for I2C emulation on S12 devices.
However I would like to recommend two application notes for RS08 MCUs:
There is application note AN3304 IIC Slave on RS08KA2
http://www.freescale.com/files/microcontrollers/doc/app_note/AN3304.pdf
and AN3317 IIC Master on the MC9RS08KA2
http://www.freescale.com/files/32bit/doc/app_note/AN3317.pdf
You can use these application notes as inspiration.
As GPIO, you can use almost any port from MCU.
If you will use port AD, please do not forget enable digital input buffer at appropriate digital pins (ATDDIEN register).
Why not to store your data in S12P data flash?
Is it possible to operate i.MX6 port in slave mode? If possible, then you could use the same SPI port on S12P to talk to both, i.MX6 SPI and SPI EEPROM. One chip select (I/O) pin could be used to select i.MX6, another I/O pin to select SPI EEPROM.
It is quite easy to bitbang master I2C to talk to I2C slave devices. Google should help.
Dear Edward Karpicz,
Thank you for your reply.
Why not to store your data in S12P data flash?
--> Customer requirement.
Is it possible to operate i.MX6 port in slave mode?
-> No
t is quite easy to bitbang master I2C to talk to I2C slave devices
--> OK, I think that Port A[0:7] looks good for connecting to Serial EEPROM (I2C Mode).
What do you think the solution? If possible, Could you recommend Port of MC9S12P64?
Thanks
It doesn't matter what pins to choose for I2C emulation (unless you are going to do your own implementation with timer output compare driven I2C pins, which would limit pin selection to PTT pins). Simple implementation needs two spare I/O pins. I2C timing can be done using some timer or simply with delay loops.