Skip to main content
darkknight
Visitor II
Feb 10, 2010 4:44 AM UTC
Question

Using BSET BRES on IO-PORT

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
This topic has been closed for replies.

4 replies

yundm2
Associate II
Feb 11, 2010 11:21 AM UTC
Posted on February 11, 2010 at 12:21

Yes. BSET and BRES  are simplest.

wolfgang239955_stm1_st
Associate III
Feb 11, 2010 1:45 PM UTC
Posted on February 11, 2010 at 14:45

wolfgang239955_stm1_st
Associate III
Feb 11, 2010 1:49 PM UTC
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
Feb 17, 2010 5:48 PM UTC
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.