MSP430 Interrupts/Status Register

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

Reply to
chrisfrommunich
Loading thread data ...

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

Reply to
chrisfrommunich

please see my second topic....

I'm sorry.

Chris

Reply to
chrisfrommunich

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

Reply to
Gene S. Berkowitz

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

Reply to
chrisfrommunich

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

Reply to
Gene S. Berkowitz

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.