[an error occurred while processing this directive]
Прерывания в LPC2214 & IAR
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено Ale3000 17 мая 2006 г. 08:29

Пытаюсь перелезть с AVR на ARM и никак не могу заставить работать прерывания в LPC2214.
Подскажите в чем дело.

#include
#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;

T0MR0=65536; // 14.7456E6*4/65536=900 Hz
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< __enable_interrupt();
while(1);
}
// IRQ exception handler. Calls the interrupt handlers.
#pragma vector=0x18
__irq __arm void irq_handler(void)
{
void (*interrupt_function)();
unsigned int vector;

vector = VICVectAddr; // Get interrupt vector.
interrupt_function = (void(*)())vector;
(*interrupt_function)(); // Call vectored interrupt function.

VICVectAddr = 0; // Clear interrupt in VIC.
}
static void Timer0Interrupt()
{
T0IR=1; // Reset MAT0.0 Int
a=~a;
if(a&1)IO0SET=0xFF0;else IO0CLR=0xFF0;
}

Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 
NoIX ключ Запомнить

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Rambler's Top100 Рейтинг@Mail.ru
Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание

E-mail: info@telesys.ru