MSP430 Interrupts/Status Register

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello to all,

I have to program a TI MSP430 in Forth. My problem is that I'm not able
write in the SR and in the IE1 register. I can write in other
controlregisters like ADC12CTL1... etc.
The following is teh code I'm using for the "DINT" command:

code /DisInt
 


MSP430 / Interrupts / Status Register
try twice...

Hello to all,

I have to programm a TI MSP430 in Forth. My problem is, that I'm not able
to write in the status register or in IE1. I can write in other control
registers like the ADC12CTL1 e.g. but i can't handle the interrupts.

I'm using the following forth code to call the command "DINT":

code /DisableInt
DINT
RET
end-code

It also dosn't work when I'm using

code /DisableInt
8 # SR & bic.b
RET
end-code

And there is no fault or problem when I want to write anything to IE1.
There's just no change in IE1 after writing.

Does anybody knows what's my mistake? What do I have to attend before
writing to IE1 or before using the DINT-Command?

Thank you,

Chris



Re: MSP430 / Interrupts / Status Register
In article
< snipped-for-privacy@localhost.talkaboutelectronicequipment
.com>, christian@nospam says...
Quoted text here. Click to load it

My Forth assembly is a little rusty,
but it appears you are ANDing the immediate value 8 with the ADDRESS of
SR. Thus, there is an argument missing for BIC.B, which requires a bit
number and a register address.

Regardless, are you trying to use this word inside an interrupt handler?
SR might be being restored to whatever its contents were before the
interrupt was taken when RETI is called, overwriting your change...

--Gene

Re: MSP430 / Interrupts / Status Register
Hi,

Thank you. The problem is that GIE is set to "0" only in the code
structure. After "END-CODE" it is reset to "1". It's set to "1" if there's
no "RET", too. Do you know a solution for my problem?
Is there any other possibility for writing to SR without Assembler?

kind regards,

Chris


Re: MSP430 / Interrupts / Status Register
In article <01c9f13a9af87356ac2005dfef1d0fc3
@localhost.talkaboutelectronicequipment.com>, christian@nospam says...
Quoted text here. Click to load it

There's a couple of possibilities:
There may be a variant form of END-CODE, that does not attempt to
restore the status register.  If not, you could write your own.
Disassemble END-CODE, remove the code that is restoring SR, and
create END-CODE-NO-SR, or whatever.
There is likely a word for register access that can be called to
modify SR without using CODE.

--Gene


Re: MSP430 Interrupts/Status Register
please see my second topic....

I'm sorry.

Chris



Site Timeline