This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320F28027:tms320f28027

Guru**** 2042920 points
Other Parts Discussed in Thread: TMS320F28027
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1220242/tms320f28027-tms320f28027

器件型号:TMS320F28027

大家好!

我正在尝试将 VL53L0x 测距传感器与 tms320f28027连接。在调试模式下运行后、我们应该在表达式窗口中看到结果为(x)=device_id、值应该为"\xee"。但我得到的结果是"\x00"。

代码:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "DSP28x_Project.h" // Device Headerfile and Examples Include File
//
// Note: I2C Macros used in this example can be found in the
// f2802x_I2C_defines.h file
//
#define VL53L0X_EXPECTED_DEVICE_ID (0xEE)
#define REG_IDENTIFICATION_MODEL_ID (0xC0)
//
// Function Prototypes
//
void I2CA_Init(void);
bool i2c_write_byte(uint8_t byte);
bool i2c_read_byte(uint8_t *received_byte);
bool i2c_read_byte(uint8_t *received_byte);
bool i2c_read_addr16_data8(uint8_t addr, uint8_t *data);
static bool device_is_booted();
// Main
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Nilesh:

    (请注意、请勿将代码转储为帖子中的文本、使用"Insert -> Code (插入->代码)"选项使其更容易阅读帖子)

    您能否向传感器提供 I2C 的波形输出? 在 初始化和读取数据函数的每一步配置寄存器时、它们在寄存器窗口中是否按预期进行配置? 项目属性中是否启用了任何优化?

    此致、

    Omer Amir