cancel
Showing results for 
Search instead for 
Did you mean: 

Read port value with EMU3 emulator

olivier239955_stm1
Associate
Posted on January 12, 2005 at 09:36

Read port value with EMU3 emulator

3 REPLIES 3
olivier239955_stm1
Associate
Posted on January 12, 2005 at 05:52

Hallo,

I write follwing value in the port A:

PADR = 0x50;

PADDR = 0xD0;

PAOR = 0x10;

When I read the value of the port A in the ST7 Peripheral Registers window in debug mode of the emulator, I get after execution of the code the following values:

PADR = 0x7F;

PADDR = 0xD0;

PAOR = 0x10;

But the assembly seems to be correct:

LD A,#0x50

LD 0x00,A

LD A,#0xd0

LD 0x01,A

LD A,#0x10

LD 0x02,A

Any ideas?

Cheers,

Olivier Baillard

wolfgang2399
Associate II
Posted on January 12, 2005 at 09:26

Hi Olivier,

as you see the real input values at the physical ports when you read in the data of the port (e.g with ld A,PADR), it seems to be all right with your application and the EMU3.

A0 .. A3, A5 input floating: can take any value - you got '1' --> o.k.

A4 output push/pull, data=1: can only take the value of '1' --> o.k.

A6 output open drain, data=1: any value at the port - you got '1'.

A7 output open drain, data=1: read value can become '0' --> o.k.

Hope it helps

WoRo

wolfgang2399
Associate II
Posted on January 12, 2005 at 09:36

Correction:

A7 output open drain, data = 0: read value can become '0' --> o.k.

Sorry WoRo