Herunterladen Inhalt Inhalt Diese Seite drucken

Texas Instruments MSP430 Anleitung Seite 44

Vorschau ausblenden Andere Handbücher für MSP430:
Inhaltsverzeichnis

Werbung

FH-Köln Campus Gummersbach
//----------------- Interrupt Service routines -----------------
//TimerA0 interrupt service routine
//=================================
#pragma vector=TIMERA0_VECTOR
__interrupt void TIMERA0_ISR(void)
{
if(fDisplayActive == 1) //Zeichenausgabe auf Port 1 nach Empfang aller Zeichen
{
fDisplayTimeReady = 1;
}
else if(fFrameActive == 1) //sonst Zeichenempfang bearbeiten
{
if(BitCount == 0)
{
CCR0 = 61;
// 1=6,8 µs bei diesem Clock ==> 416 µs
}
//................................
//Empfangenes Zeichen in bitValue ablegen
//=======================================
tmpBitValue = P1IN;
tmpBitValue &= 0x80;
if(BitCount <= 7)
{
ShiftIndex = 7 - BitCount;
tmpBitValue = tmpBitValue >> ShiftIndex;
bitValue |= tmpBitValue;
}
BitCount++;
if(BitCount > 7)
//Stop Bit
{
fFrameActive = 0;
BitCount = 0;
TACTL = MC_0;
CCR0 = 0;
CCTL1 = 0x00;
CCTL0 = 0x00;
// CCR0 interrupt disabled
}
Juni 2012
//Wenn 1. Zeichen, dann neue kurze Zeit laden
//Fertig
MSP430 Mikrocontroller
43 |
S e i t e

Quicklinks ausblenden:

Werbung

Inhaltsverzeichnis
loading

Verwandte Produkte für Texas Instruments MSP430

Inhaltsverzeichnis