October 9, 2004, 11:12 am
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
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
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
<3b771918a4641563fe3606c72aa6a4de@localhost.talkaboutelectronicequipment
.com>, christian@nospam says...
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
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
@localhost.talkaboutelectronicequipment.com>, christian@nospam says...
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
Site Timeline
- » New MSP430 Family from Texas Instruments runs at 12 RISC MIPS & standby of 1uA
- — Next thread in » Embedded Programming
-

- » ELF file: linking in large binary data
- — Previous thread in » Embedded Programming
-

- » EuroForth 2012 dates and location
- — Newest thread in » Embedded Programming
-

- » C preprocessor magic to put a define in a string
- — Last Updated thread in » Embedded Programming
-

- » Demuxing, what am I doing wrong?
- — The site's Newest Thread. Posted in » Hobby Electronics Basics
-


Subject






