This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Senseless send CAN frame

Hi everyone, 

I want to develop my CAN driver for the UT32M0R500 micrcontroller. I send a CAN frame on the principal bus. I should get the the send frame signal on the Tx pin.

However, when I tested it, it produced the the following result.

The green signal is the generated signal on the Tx pin.

I tried to modify my code and I tried to add a transciever to look at the CAN HIGH, but nothing has changed (the transciever return a 0 signal... It seems that it does not understand the Tx input)

So I decided to inspire my code from the example provided by CAES : it produces the same thing.

I directly tested the exemple provided by CAES :  it produces the same thing.

Then, I wrote the simpliest test as possible that follows : 

MAIN.C

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "typesGeneral.h"
#include "canRegisterTypes.h"
#define C_CAN_MODE_RESET 0x01
#define C_CAN_ACCEPTANCE_CODE_RESET_VALUE 0x00
#define C_CAN_ACCEPTANCE_MASK_RESET_VALUE 0x00
#define C_CAN_COMMAND_START_TRANSMIT 0x01
#define C_CAN_SJW_SHIFT_LEFT (6)
#define C_CAN_SAM_SHIFT_LEFT (7)
#define C_CAN_TSEG2_SHIFT_LEFT (4)
#define C_CAN_TXID_1_ID_SHIFT_RIGHT (3)
#define C_CAN_TXID_2_ID_SHIFT_LEFT (5)
#define C_CAN_SFF_ID_1_TX_SHIFT_RIGHT (3)
#define C_CAN_SFF_ID_2_TX_SHIFT_LEFT (5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

TYPESGENERAL.H

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* @file typesGeneral.h
*
* @brief Native types and main constants redefinition
*
* @details This file redefines the CPU architecture native types and the main constants
* (True / False / Null pointer) to be used in the whole project.
*
* @addtogroup generalities
* @{
*/
#ifndef INC_TYPES_GENERAL_H
#define INC_TYPES_GENERAL_H
/* ------------------------------------------------------------------------- */
// CONSTANTS DEFINITION
/* ------------------------------------------------------------------------- */
/**
* @brief Definition of the TRUE value
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

CANREGISTERTYPES.H

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* @file canRegisterTypes.h
*
* @brief Define all the registers used by the CAN peripheral.
*
* @addtogroup can
* @{
*/
#ifndef INC_CAN_TYPES_DEF_H
#define INC_CAN_TYPES_DEF_H
/* ------------------------------------------------------------------------- */
// FILE INCLUSION
/* ------------------------------------------------------------------------- */
#include "typesGeneral.h"
/* ------------------------------------------------------------------------- */
// PRIVATE CONSTANTS DEFINITION
/* ------------------------------------------------------------------------- */
#define C_CAN_BUF_SIZE 8
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

....... And the result whas exactly the same !!!

Do you see any clear error that could generate this strange behaviour ?

According to tou, what could be the origin of the problem ?

I thank you for your help by advance.

Best regards.

Rémi G

0