cancel
Showing results for 
Search instead for 
Did you mean: 

Using BSET BRES on IO-PORT

darkknight
Associate
Posted on February 10, 2010 at 05:44

Hi

Can BSET and BRES instructions be used on an IO-PORT like

BSET     PADR,&sharp1

to turn an output on

or do you have to do

LD         A,PADR

OR         A,&sharp1

LD         PADR,A

TIA

#ioport #ioport #ioport
4 REPLIES 4
yundm2
Associate II
Posted on February 11, 2010 at 12:21

Yes. BSET and BRES  are simplest.

wolfgang239955_stm1_st
Associate II
Posted on February 11, 2010 at 14:45

wolfgang239955_stm1_st
Associate II
Posted on February 11, 2010 at 14:49

Suppose you mean:

 

 

BSET     PADR,#0

 

-with-

LD         A,PADR

OR         A,#1

LD         PADR,A

Regards,

WoRo
jdf25252
Associate II
Posted on February 17, 2010 at 18:48

Be careful though.  At least on the F324, check the datasheet section 9.2.1 Note 3:  Do not use read/modify/write instructions (BSET or BRES) to modify the DR register as this might corrupt the DR content for I/Os configured as input.