[an error occurred while processing this directive]
|
Пытаюсь перелезть с AVR на ARM и никак не могу заставить работать прерывания в LPC2214.
Подскажите в чем дело.
#include T0MR0=65536; // 14.7456E6*4/65536=900 Hz vector = VICVectAddr; // Get interrupt vector. VICVectAddr = 0; // Clear interrupt in VIC.
E-mail:
info@telesys.ru
#include
#include
typedef unsigned char BYTE;
typedef unsigned int WORD;
typedef unsigned long DWORD;
static void Timer0Interrupt();
void main()
{
//VPBDIV_bit.
VPBDIV=1;
MAMTIM=3; // MAM fetch = 3
MAMCR=2; // MAM functions fully enabled
PLLCFG=3; // M=4(multiplier), P=1(divider)
PLLCON=1; // PLL Enable
PLLFEED=0xAA;
PLLFEED=0x55;
while(!(PLLSTAT&0x400)); // Wait for PLL locking
PLLCON=3; // Use PLL clock as CPU clock
PLLFEED=0xAA;
PLLFEED=0x55;
T0MCR=2; // Reset Timer0 on Match0.0
T0EMR=0x30; // Toggle MAT0.0 pin on Match0.0
T0TCR=1; // Timer Enable
PINSEL1=0x3000; // Connect MAT0.0 to P0.22
PINSEL0=0;
IO0DIR=0xFF0;
MEMMAP=1;
VICVectAddr0=(DWORD)&Timer0Interrupt;
VICVectCntl0=0x2|VIC_TIMER0; // Enable Timer0 Int in Slot0
VICIntEnable=1<
while(1);
}
// IRQ exception handler. Calls the interrupt handlers.
#pragma vector=0x18
__irq __arm void irq_handler(void)
{
void (*interrupt_function)();
unsigned int vector;
interrupt_function = (void(*)())vector;
(*interrupt_function)(); // Call vectored interrupt function.
}
static void Timer0Interrupt()
{
T0IR=1; // Reset MAT0.0 Int
a=~a;
if(a&1)IO0SET=0xFF0;else IO0CLR=0xFF0;
}
Ответы
Перейти к списку ответов
|||
Конференция
|||
Архив
|||
Главная страница
|||
Содержание