7 years ago.

I have some program (LPC1114FBD48/302)

I have some program to use CAN. i want to use CAN for LPC1114/302. Last year, I post this question. https://developer.mbed.org/questions/68586/How-to-use-MCP2515-for-LPC1114FN28/ so i got a hack header(can_suppor.h). and i can use the mcp2515 library for LPC1114FN28. Then, i want to adapt the library for LPC1114/302. It have 48 pin. Now i get xpresso LPC1114. I write a code on mbed online. then, sent a hex file with Flash magic. i use ft231 to communictate to LPC1114/302. The code is below. it did not work. If true, LED is flash every second. but this code is flashed very quickly(about 0.2s). and spi signal is not appear. i use rezonator for Mcp2515(16MHz) and LPC1114(12MHz). i show you a schematic. i do not know the my mistake. i think that my electronic circuit hardware have not program. because i make same circuit with LPC1114FN28. and i am sorry, my English is terrible every question.

include the mbed library with this snippet

#include "mbed.h"
#include "CAN3.h"
#include "mcp2515.h"//<- i added the header

SPI spi(xp5,xp6,xp7);// mosi, miso, sclk
CAN3 can3(spi,xp12,xp8);//cs,int
DigitalOut led(xLED1);

char counter = 0;
int main() {
    CANMessage msg(1550,&counter,1);
    can3.frequency(500000);
    while(1){
        can3.write(&msg);
        led =! led;
        wait(1);
        counter ++;
    }
}

/media/uploads/namo/ele.png

Be the first to answer this question.