Artturi,
did you use the CAN examples programs that can be found in the files
section? THose do work.
http://groups.yahoo.com/group/lpc2000/files/LPC2_CAN_Examples/
Do you really use a 10 MHz crystal and no PLL multiplier as it seems
in the code? If so, that can not work. You would need somethink like
16/32/48 MHz to run CAN at 1 Mbit.
hth, Bob
--- In lpc2000@yahoogroups.com, artturi <artturi@s...> wrote:
> 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/>.
> >
> >Message
Re: CAN interrupt problem
2005-04-12 by lpc2100_fan
Attachments
- No local attachments were found for this message.