cancel
Showing results for 
Search instead for 
Did you mean: 

IO ports

carnett1
Associate II
Posted on November 12, 2010 at 14:33

I intialize Port A3 as a push pull output but when I call writeHigh or writeLow nothing changes on that output.  I am using a multimeter to read the output on pin 9 of cn1

charles

5 REPLIES 5
infoinfo967
Associate II
Posted on November 22, 2010 at 19:19

Hi,

I'm not a crack but Brazov told me in a similar question:

before putting a data output on portA, you need to configure the port:

LD A, #255

LD $5002, A ;output push pull 

LD $5003, A ; see page 101

brazov2

In your case , you need:

LD A, #255

LD $5002, A ;output push pull 

LD $5003, A ; see page 101

ld a,#4

   ld $0x5000,a

I don't know if are properly this value ld a,#4, Porta3 is the third 1, 2, 4

carnett1
Associate II
Posted on November 22, 2010 at 20:33

Thank you - that was it.  I use 4 insted of 3

charles

infoinfo967
Associate II
Posted on November 23, 2010 at 19:51

What do you mean?

Its an example, I mean If you want to get a port voltage outputs  for example

cn1 pin4 is ground

cn1 pin9 is porta3

When you write a one in this bit, I thik you have a high output voltage

between 4 and 9 you have in the multimeter screen 3,4 vdc.

port a1 a2 a3 a4 a5 a6

       0   0   1   0  0   0

I think you can write ld a,#4   (porta3=1)

¡¡¡Please we need a comunity expert revision data!!!

spiovan9
Associate II
Posted on December 07, 2010 at 17:23

Hi all,

even if yours is not the case, I'd like just to pay attention when using PE.2 and PE.3 port E pins, either as in or out: they're ''TRUE OPEN DRAIN''. It means that the pins don't have built-in pull-up resistors. Therefore reading in or writing out active level signals don't have effect too.

In the STM8S105C datasheet page 22/127 the pin description have a small ''(T)'' aside that stands for ''True open drain''.

 

Good work

 

Stefano

 

 

 

 

From: Aturate

Posted: Tuesday, November 23, 2010 7:51 PM

Subject: IO ports

What do you mean?

Its an example, I mean If you want to get a port voltage outputs  for example

cn1 pin4 is ground

cn1 pin9 is porta3

When you write a one in this bit, I thik you have a high output voltage

between 4 and 9 you have in the multimeter screen 3,4 vdc.

port a1 a2 a3 a4 a5 a6

       0   0   1   0  0   0

I think you can write ld a,#4   (porta3=1)

¡¡¡Please we need a comunity expert revision data!!!

infoinfo967
Associate II
Posted on December 13, 2010 at 18:55

Dear Stefano,

To obtain in cn3 pin out ''portb'' a sample example:

steps of numbers from 0 to 1111111

1=3,4vcc 0=gnd

with configuration needs of ddr, cr1, cr2

i have explained well?

I program with asm.

thank you