Skip to main content
olivier239955_stm1
Associate
January 12, 2005
Question

Read port value with EMU3 emulator

  • January 12, 2005
  • 3 replies
  • 801 views
Posted on January 12, 2005 at 09:36

Read port value with EMU3 emulator

This topic has been closed for replies.

3 replies

olivier239955_stm1
Associate
January 12, 2005
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 III
January 12, 2005
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 III
January 12, 2005
Posted on January 12, 2005 at 09:36

Correction:

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

Sorry WoRo