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.
工具/软件:Code Composer Studio
高出口、
现在我正在处理 I2C 驱动程序、但我没有要编写的任何示例代码。
我 只有基于 EEPROM 的代码,所以任何人都可以帮助我处理驱动程序控制器代码。
谢谢
哈里
您好 Hari、
此帖子包含一些您可以参考的软件:
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/773846
您还可以通过以下文件路径在 c2000ware 中引用 i2c 示例:
C:\ti\c2000Ware_3_02_00_00\device_support\F2833x\examples\i2c_eeprom
谢谢
感谢您的重播。
在这里,我正在使用驱动程序 TM1640,我认为该驱动程序的基址是0x40 (此基址是否正确?)。
仍无法获取输出、请按照我的代码操作。 并检查是否需要进行任何更正。
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
在 main()中,我正在发送
{
TM1640_init (0x8F); 延迟(0x55);
TM1640_SEND_COMMAND (0x88 | 0x07); 延迟(0x55);
TM1640_SEND_DATA (1、0x32); 延迟(0x55);
TM1640_SEND_DATA (2、0x33); 延迟(0x55);
}
//***** 为从设备设置1MHz 时钟***** //
空 I2CA_Init (空)
{
I2caRegs.I2CSAR = 0x0040; //从基址
I2caRegs.I2CPSC.all = 3; //(150Mhz /(3+1)= 37.5MHz)
I2caRegs.I2CCLKL = 10;
I2caRegs.I2CCLKH=5;
I2caRegs.I2CIER.ALL = 0xC4;
I2caRegs.I2CMDR.ALL = 0x0020;
I2caRegs.I2CFFTX.ALL = 0x6000;
I2caRegs.I2CFFRX.ALL = 0x2040;
返回;
}
//******** 数据发送程序****** ///
void TM1640_write(无符号字符字节)
{
I2caRegs.I2CSAR = 0x40;
I2caRegs.I2CCNT = 1;
I2caRegs.I2CDXR =字节;
I2caRegs.I2CMDR.ALL = 0x6E20;
延迟(0xFFF);//延迟(0xFFF);
}
中断空 i2c_int1a_ISR (空)//I2C_Int1
{
uint16 IntSource;
IntSource = I2caRegs.I2CISRC.ALL;
if (IntSource = 0x0003)
{
if (I2caRegs.I2CSTR.bit.nack = 1)
{
I2caRegs.I2CMDR.bit.STP= 1;
I2caRegs.I2CSTR.ALL = 0x0002;
}
}
否则{}
PieCtrlRegs.PIEACX.ALL = PIEACK_group8;
}
//////////////////////////// 数据发送程序的结束////////////////////////////////////////////////////
void TM1640_init (无符号 char brightnely_level)
{
TM1640_send_command (auto_address);
TM1640_SEND_COMMAND (brightnation_level);
TM1640_CLEAR_DISPLAY ();
}
void TM1640_send_command (无符号字符值)
{
TM1640_WRITE (值);
}
void TM1640_send_data (无符号字符地址、无符号字符值)
{
TM1640_send_command (fixed_address);
TM1640_WRITE ((0xC0 |(0x0F 和地址)));
TM1640_WRITE (值);
}
void TM1640_clear_display ()
{
unsigned char s = 0x00;
TM1640_WRITE (START_ADDRESS);
对于(s = 0x00;s < NO_OW_SESments;s += 0x01)
{
TM1640_write (font[0]);
}
}
您好 Hari、
您能否找到文档并了解如何与 TM1640进行通信、因为我们不支持该器件。
如果您有关于 TMS320F28335的特定问题 、我们可以在这里提供帮助。
谢谢
感谢您的重播、
正如您所说、我正在关注您建议的文档、并感谢您的重播
我认为这可以解决问题。
谢谢你
Hari Haran