MSP430 Software Interrupt auslösen?

Gast #2014480
Lesenswert?

Hi Leute,

ich hab gerade ein kleines Problem. Ich möchte ein IO Interrupt auslösen 
und zwar in Software, weil ich noch keine Pereferie angeschlossen habe.
Kann mir einer kurz sagen wie ich das mache.

Einfach PxIFG |= 0x01; ?? oder den Pin einfach toggeln?
Steh bischen auf dem Schlauch.

Danke.
Gast #2014504
Lesenswert?

steht im UserGuide...

z.B. für den MSP430F449

Interrupt Flag Registers P1IFG, P2IFG
Each PxIFGx bit is the interrupt flag for its corresponding I/O pin and 
is set
when the selected input signal edge occurs at the pin. All PxIFGx 
interrupt
flags request an interrupt when their corresponding PxIE bit and the GIE 
bit
are set. Each PxIFG flag must be reset with software. Software can also 
set
each PxIFG flag, providing a way to generate a software-initiated 
interrupt.
Bit = 0: No interrupt is pending
Bit = 1: An interrupt is pending
Only transitions, not static levels, cause interrupts. If any PxIFGx 
flag becomes
set during a Px interrupt service routine or is set after the RETI 
instruction of
a Px interrupt service routine is executed, the set PxIFGx flag 
generates
another interrupt. This ensures that each transition is acknowledged.
1
 
2
Software can also set each PxIFG flag, providing a way to generate a software-initiated interrupt.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren