2011-01-30 08:04 PM
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
mcudoes 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 #stm8l151k62011-01-31 01:27 AM
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.2011-01-31 01:57 AM
Thank you very much
.
I
have
realized my mistake.
P/S Sorryfor
my
english :)