cancel
Showing results for 
Search instead for 
Did you mean: 

i2c

daromart
Associate II
Posted on October 18, 2005 at 15:33

i2c

2 REPLIES 2
daromart
Associate II
Posted on October 18, 2005 at 14:46

Hi,

I have an STPC elite and I want to use the DDC lines as I2c. I tried:

Outb (16#22# + 16#97#, 16#01#);

but the lines are always high.

I use the PC without operating system and without MMU.

That is, I want to now the address I have to put in the outb function to access the DDC byte so I can use the corresponding bits to emulate by software the I2C protocol.

Thanks a lot

Daniel

daromart
Associate II
Posted on October 18, 2005 at 15:33

autoanswer again 😉

From the manual:

''The STPC implements a number of registers in IO address space. This is visible in the registers with

access = 0022h/0023h. These regsters use the index and data programming system where the index to

which the data is to be written to is programmed in register 0022h and the data is written to register 0023h.''

I used:

base_index : io_port := 16#22#;

base_data : io_port := 16#23#;

Outb_P (base_index, 16#97#);

Outb_P (base_data, 16#01#);

pause;

Outb_P (base_index, 16#97#);

Byte := Inb_P (base_data);

Put(Integer(Byte),base=>2);

and it works!