Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | CAN: only recieves first message - lpc2129

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

CAN: only recieves first message - lpc2129 - brac...@yahoo.com - Aug 13 17:07:33 2008

I am trying to be able to use CAN but having some problems with the basic. Hoping some one can help.
I have two MCB2100 board from keil with lpc2129 on them.
I am using the LPC_FullCAN from the file section. I am just trying to send a message from one board to the next, it works fine the first time, after that the board doesn't recieve them. The sending board does actualy send the message. The problem is on the recievers side. I don't know if there is a flag that i need to clear or something.

Here is my Code:

#include /* LPC21xx definitions */
#include "LPC_FullCAN_SW.h"

int main (void) {
int i;
unsigned int kt;
unsigned char qt;
unsigned int LEDvalue = 0x10000000L;
FULLCAN_MSG MsgBuf;
VPBDIV = 1;

// Init Vector Interrupt Controller
VICIntEnClr = 0xFFFFFFFFL; // Disable all Ints
VICIntSelect = 0x00000000L;

// Initialisation of CAN interfaces
// CAN interface 1, use IRQVec0, at 125kbit
FullCAN_Init(1,0,CANBitrate125k_12MHz);

IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */
ADCR = 0x002E0401; /* Setup A/D: 10-bit AIN0 @ 3MHz */
init_serial(); /* Initialize Serial Interface */

for(i = 0; i < 10000000; i++);

// Receive message with ID 102h on CAN 1
FullCAN_SetFilter(1,0x102);

while (1) { /* Loop forever */

// Check if message received on CAN 1
if (FullCAN_PullMessage(1,&MsgBuf))
{
LEDvalue = MsgBuf.DatA;// = 0x00000000L; // all zeros
}
IOSET1 = LEDvalue;
for(i = 0; i < 1000000; i++);
IOCLR1 = LEDvalue;

}
}

thanks

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )