cancel
Showing results for 
Search instead for 
Did you mean: 

Issue the command BRES and register ITC->ISPR

zheleznjakov
Associate II
Posted on January 31, 2011 at 05:04

why

reset command BRES

 

does not

work

one

bit of

the register ITC->ISPR

(

does not reset the

bit

)

in

the simulator

works

in

real

 mcu

does not work

.

-

However,

the command BSET

works

in

the simulator

and in

mcu

---

example (simulator STVD 4.2.0):

// ITC->ISPR6 &= ~(1UL << 6);

0x721D7F75      BRES  0x7f75,&sharp6 // before ITC->ISPR6=0xFF after ITC->ISPR6=0xBF

// ITC->ISPR6 &= ~((1UL << 6) | (1UL << 7));

0xC67F75        LD    A,0x7f75 // before ITC->ISPR6=0xBF

0xA43F          AND   A,&sharp0x3f

0xC77F75        LD    0x7f75,A // after ITC->ISPR6=0x3F

// ITC->ISPR6 |= (1UL << 6);

0x721C7F75      BSET  0x7f75,&sharp6 // before ITC->ISPR6=0x3F after ITC->ISPR6=0x7F

--

MCU STM8L151K6

---

example (real mcu):

// ITC->ISPR6 &= ~(1UL << 6);

0x721D7F75      BRES  0x7f75,&sharp6 // before ITC->ISPR6=0xFF after ITC->ISPR6=0xFF

// ITC->ISPR6 &= ~((1UL << 6) | (1UL << 7));

0xC67F75        LD    A,0x7f75 // before ITC->ISPR6=0xFF

0xA43F          AND   A,&sharp0x3f

0xC77F75        LD    0x7f75,A // after ITC->ISPR6=0x3F

// ITC->ISPR6 |= (1UL << 6);

0x721C7F75      BSET  0x7f75,&sharp6 // before ITC->ISPR6=0x3F after ITC->ISPR6=0x7F

#stm8l151k6
2 REPLIES 2
napoleoni.jacques
ST Employee
Posted on January 31, 2011 at 10:27

Hello,

It seems that by referring to STM8L15x reference manual, you're not allowed to write the 10 value in VECTxSPR[1:0] (priority level 0) that corresponds to the change of FFh value to BFh value (your comment ''before ITC->ISPR6=0xFF after ITC->ISPR6=0xBF'')

 

In that case, ''the previous value is kept and the interrupt priority remains unchanged''. See Software priority register x (ITC_SPRX) description of Ref Manual.

This feature is perhaps absent from simulator. This issue is then not linked to the behaviour of BRES command.

Regards.

zheleznjakov
Associate II
Posted on January 31, 2011 at 10:57

Thank you very much

.

I

have

realized my mistake.

P/S Sorry

for

my

english :)