Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] CAN interrupt problem

2005-04-11 by artturi

I still haven't managed to get this working. Could someone give me 
little advice please?

//Artturi

artturi wrote:

> Hi
>
> I'm using LPC2194
> I have problem getting interrupt in CAN bus. Here is the parts of my
> code that has some problem don't know what.
> The Bus should be configured to 1 Mb. If someone could give me a tip
> whats wrong I would be glad.
>
> /////////////////////////
> // PLL setup values are computed within the LPC include file
> // It relies upon the following defines
> #define FOSC                (10000000)        // Master Oscillator Freq.
> #define PLL_MUL                (1)                // PLL Multiplier
>
> // Pheripheral Bus Speed Divider
> #define PBSD                1                // MUST BE 1, 2, or 4
> #define PCLK                (CCLK / PBSD)    // Pheripheal Bus Clock Freq.
> ///////////////////////
>
> // Interrupt Service Routines
> void CAN1IRQ (void) __attribute__ ((interrupt));
>
> //////////////////////
> void CAN1IRQ (void){
>         blink();
> C1CMR = 0x00000004;         // Release the receive buffer
> VICVectAddr = 0xFFFFFFFFL;     // Acknowledge interrupt
> }
>
> ////////////////////
> can1InitRx(){
> PINSEL1 |= 0x00040000;         // Enable Pin 0.25 as CAN1 RX
> AFMR = 0x00000002L;            // Switch off the acceptance filters
> C1MOD = 0x00000001;         // Set CAN controller into reset
> C1GSR = 0x00000000;            // Clear Status Register
> C1BTR = 0x430005;         // 1MHz CAN bus rate
> VICVectAddr0 = (unsigned int)CAN1IRQ; // Set And Enable receive interrupt
> VICVectCntl0 = 0x0000003A;             // select a priority slot for a
> given interrupt p92 3a=26
> VICIntEnable = 0x04000000L;         // CAN1 Rx enable interrupt
> C1IER = 0x00000001;         //Enable the Receive interrupt
> C1MOD = 0x00000000;         //Release CAN controller
> }
>
> //Artturi
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/lpc2000/
>        
>     * To unsubscribe from this group, send an email to:
>       lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.