You are on page 1of 2

//k=read_byte_1(0xE);

//HAL_Delay(10);
//mcp2515_normal_mode();
//HAL_Delay(10);
// write_byte_1(0x36,0xAA); // load data into tx_buffer0
// k=read_byte_1(0x36);
//HAL_Delay(10);

// write_byte_1(0x36,0x5); // load data into tx_buffer0


// HAL_Delay(10);
// k=read_byte_1(0x36);
// HAL_Delay(10);

////
//if(mcp2515_normal_mode())
// { k=read_byte_1(0xE);
// HAL_UART_Transmit(&huart1,(uint8_t*)"norm",4,100);

// }
//HAL_Delay(10);
//
////reset
//mcp2515_reset();
//HAL_Delay(100);
// HAL_UART_Transmit(&huart1,&k,1,100);

//
//
//
// k=read_byte_1(0xE);
//
//HAL_Delay(10);
//
// write_byte_1(0x36,0x2); // load data into tx_buffer0

// k=read_byte_1(0x36);

//CAN message initiate

write_byte_1(0x36,0x25); // load data into tx_buffer0


HAL_Delay(10);
k=read_byte_1(0x36);

bit_modify(0x30,0x0F,0x0B); //set priority ,msg req of tx0 buffer


HAL_Delay(10);
write_byte_1(0x31,0xAA); //config std. id
HAL_Delay(10);
write_byte_1(0x32,0x80); //config std.id and ext id
HAL_Delay(10);
write_byte_1(0x35,0x01); //set DLC and RTR
HAL_Delay(10);
write_byte_1(0x2B,0x84); //interupt on message sent and on error

//tx message
//
Transmit_reqest(0x81); //rts command to tranmit txbuf0
//
// do{
//
// k=read_byte_1(0x2C); // can int flag to moiniter tx
//
// }while((k&0x4)==0x04);
//

// mcp2515_reset();

You might also like