I2C in C language qith QY4A

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I2C in C language qith QY4A

2,706件の閲覧回数
admin
Specialist II

Hi!

 

     Could anyone send me an example how to communicate QY4A with EEprom (24LC00) using I2C and C language?

 

Thanks a lot

 

 

Edson

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

810件の閲覧回数
bigmac
Specialist III

Hello Edson,

 

The QY4A device does not contain an IIC hardware module, so your code will need to use "bit-banging" to obtain IIC communication with the serial EEPROM device.

 

A very old Application Note AN1820 does provide an assembly code example for IIC master communications with a DAC device, but for an old HC05 device (the code should be backward compatible with HC908).

 

AN2509 provides assembly code for the QT/QY device, but for an IIC slave, which is not what you require.

 

Since the C language is not particularly efficient at providing shift and rotate operations involving the carry flag, I would suspect that any C function would likely require some inline assembly code to handle the serial data stream.

 

Do you really require to use an IIC type serial EEPROM?  If you were able to use a device with SPI interface (25Cxxx), the coding should be a little simpler. You might also consider the HC908QB8, which is pin compatible with the QY4, and contains a SPI hardware module.

 

Alternatively, you might choose a device that includes an IIC hardware module. The 9S08QG8 comes to mind.

 

Regards,

Mac

0 件の賞賛
返信

810件の閲覧回数
eckhard
Contributor V

Hello.

 

 

here is an example that I used with an I2C port expander.

 

Eckhard 

0 件の賞賛
返信

810件の閲覧回数
J2MEJediMaster
Specialist I

The topic of using the I2C surfaces from time to time here. Try doing a search of these forums using the string "I2C programming".

 

---Tom

0 件の賞賛
返信