-
这是啥芯片?有用过的吗?
今天测一块板子,看丝印写的是IIC通信,但电压实测有6v,看了丝印被厂家磨标了,依稀看出来了一些,但反查失败,不晓得是片子太老了,还是看错了。请教一些各位大佬。 [color=#333333][backcolor=rgb(255, 255, 255)][font="]丝印貌似是0213、V106Y68[/font][/backcolor][/color][color=#333333][backcolor=rgb(255, 255, 255)][font="]8P,芯片挺高的。[/font][/backcolor][/color]
5125浏览量 8回复量 关注量 -
IIC接收I2C_INT_FLAG_STPDET中断后为什么要重新使能IIC sos
iic中断接收例程中,这个操作是干什么用的 观察寄存器实际还在使能状态,这个个代码看起来没有任何作用,但是不加还不行,为什么 [img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA2gAAACdCAIAAABOw8xdAAAgAElEQVR4Ae2dS7LDunGGtYTMU3E8TMV1N8B57GnsRagqu8gStIRsInKcuvZGOM3Au1CqAQJsAI0HzyF1ROk7daoEgo1G9wc+foEPXf6LPwhAAAIQgAAEIAABCAwQuPwHfxCAAAQgAAEIQAACEBggcPm/9O/BHwQgAAEIQAACEIAABCwCCEeLCnUQgAAEIAABCEAAAgUBhGOBhAoIQAACEIAABCAAAYsAwtGiQh0EIAABCEAAAhCAQEGgLxzn23S5XO9Fy6Jivl2ny/o3Te1G4ne6zYUbVzHQ6Xy/TqG/aboNBGh3tbl2ILbNPmmwnUBze7tf1y2xvplt7/SNWjR3wIE8d94Bxd0yZtO1dlwYCOsAk50zPSBCXELAJCDHwfZ52DUbNDO7aFa6k+VQCE03rHw1AnsJR7eBTLe5IgSLtDvqq7P64U4ysTt/zqmq0KLz71X0Yhv2fr9eptuw9ZkN9890eHsTw2dtGT81RF/Ba2/Fid5W0rvYUId3wFn0fVCEF5GE88MYEvkWGI4e8zPG7McyHdhIurG5wfPDs6oCVSmr3IqqJ994+44x5FCmGrI/80CXRXy5FJuZhuXke9yUpuvt/o3txG2WMcbper+7jTL0N5SmM7YtZdZEnQrLRKVrme5QRg/ZL+p/cazsHmPDaOdzcV1fk25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DheDRh/EMAAhA4ksBhwvGX3ybXpPTZgjIEIACBX3575JEN3xCAAAQgcAiBw4Tjn/6AcIQABCBQJfCnPxxySMMpBCAAAQgcSeAw4fjrn6snDOZaIAABCPztf488suEbAhCAAAQOIdAUjrO8HvkyffWVzr/++fHv//b4139CQUIAAhBYCPzyz48//eHx178ccjzDKQQgAAEIHEygKRxd3/zY2sFDgHsIQAACEIAABCBwDgJ94fjgV9nOMZRECQEIQAACEIAABI4lgHA8li/eIQABCEAAAhCAwNsQQDi+zVCSCAQgAAEIQAACEDiWAMLxWL54hwAEIAABCEAAAm9DAOH4NkNJIhCAAAQgAAEIQOBYAgPCcb5Nl+k2HxsH3iEAAQhAAAIQgAAEXpzAgHB8PO7X6XK5XK73F0+G8CAAAQhAAAIQgAAEjiMwIByZcTwOP54hAAEIQAACEIDAeQgMCEfe43ie4SRSCEAAAhCAAAQgcBwBhONxbPEMAQhAAAIQgAAE3ooAwvGthpNkIAABCEAAAhCAwHEEEI7HscUzBCAAAQhAAAIQeCsCo8KRt/G81bCTDAQgAAEIQAACENhOoC8ceTZmO1VaQAACEIAABCAAgTck0BSO8iKey2Xi/Y1vOPCkBAEIQAACEIAABLYSaArHrc6whwAEIAABCEAAAhB4XwIIx/cdWzKDAAQgAAEIQAACuxJAOO6KE2cQgAAEIAABCEDgfQkgHN93bMkMAhCAAAQgAAEI7EoA4bgrTpxBAAIQgAAEIACB9yWAcHzfsSUzCEAAAhCAAAQgsCsBhOOuOHEGAQhAAAIQgAAE3pcAwvF9x5bMIAABCEAAAhCAwK4EEI674sQZBCAAAQhAAAIQeF8C/w/DtzyFfL3ZtAAAAABJRU5ErkJggg==[/img]
2114浏览量 0回复量 关注量 -
gd32e230 IIC读数据问题
/* send the internal register address to */i2c_data_transmit(I2C0, read_address); /* wait until BTC bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_BTC); [b][color=#800080]一直卡在上面[/color][/b] [b][color=#800080]请问什么原因?[/color][/b]
4315浏览量 17回复量 关注量 -
gd32f350R 使用iic1 sos
使用GD32F350R系列的开发板,调试iic协议,使用iic0的时候两个开发板可以通信(都使用iic0接口,一个主,一个从),但是换成iic1就不可以了,不论iic1做主机还是从机都不行。iic1做主机时发现在i2c_master_addressing之后,抓出来的波形只有一个start信号,并没有从机地址的信号发出来[font=Consolas, Courier New, monospace]以下是主机程序:[/font] [backcolor=rgb(255, 255, 255)][font=Consolas, "][color=#808080]#include[/color][color=#0000ff] [/color][color=#a31515]
[/color] [color=#808080]#include[/color][color=#0000ff] [/color][color=#a31515]"gd32f3x0.h"[/color] [color=#808080]#include[/color][color=#0000ff] [/color][color=#a31515]"gd32f350r_eval.h"[/color] [color=#808080]#define[/color][color=#0000ff] [/color][color=#bd63c5]I2C1_OWN_ADDRESS7[/color][color=#0000ff] [/color][color=#09885a]0x[/color]72 [color=#808080]#define[/color][color=#0000ff] [/color][color=#bd63c5]I2C1_SLAVE_ADDRESS7[/color][color=#0000ff] [/color][color=#09885a]0x[/color]45 [color=#0000ff]uint8_t[/color] i2c_transmitter[16]; [color=#0000ff]void[/color] rcu_config([color=#0000ff]void[/color]); [color=#0000ff]void[/color] gpio_config([color=#0000ff]void[/color]); [color=#0000ff]void[/color] i2c_config([color=#0000ff]void[/color]); [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] main function[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]int[/color] main([color=#0000ff]void[/color]) { [color=#0000ff]int[/color] i; gd_eval_com_init([color=#bd63c5]EVAL_COM[/color]); [color=#008000] /* RCU configure */[/color] rcu_config(); [color=#008000] /* GPIO configure */[/color] gpio_config(); [color=#008000] /* I2C configure */[/color] i2c_config(); [color=#0000ff]for[/color](i = 0; i < 16; i++) { i2c_transmitter[i] = i + [color=#09885a]0x[/color]80; } [color=#008000] /* wait until I2C bus is idle */[/color] [color=#0000ff]while[/color](i2c_flag_get(I2C1, I2C_FLAG_I2CBSY)); [color=#008000] /* send a start condition to I2C bus */[/color] i2c_start_on_bus(I2C1); [color=#008000] /* wait until SBSEND bit is set */[/color] [color=#0000ff]while[/color](!i2c_flag_get(I2C1, I2C_FLAG_SBSEND)); [color=#008000] /* send slave address to I2C bus */[/color] i2c_master_addressing(I2C1, [color=#09885a]0x[/color]45, I2C_TRANSMITTER); [color=#008000] /* wait until ADDSEND bit is set */[/color] [color=#0000ff]while[/color](!i2c_flag_get(I2C1, I2C_FLAG_ADDSEND)); [color=#008000] /* clear ADDSEND bit */[/color] i2c_flag_clear(I2C1, I2C_FLAG_ADDSEND); [color=#008000] /* wait until the transmit data buffer is empty */[/color] [color=#0000ff]while[/color](!i2c_flag_get(I2C1, I2C_FLAG_TBE)); printf([color=#a31515]"start to transfer\r\n"[/color]); [color=#0000ff]for[/color](i = 0; i < 16; i++) { [color=#008000] /* data transmission */[/color] i2c_data_transmit(I2C1, i2c_transmitter[i]); [color=#008000] /* wait until the TBE bit is set */[/color] [color=#0000ff]while[/color](!i2c_flag_get(I2C1, I2C_FLAG_TBE)); } [color=#008000] /* send a stop condition to I2C bus */[/color] i2c_stop_on_bus(I2C1); [color=#008000] /* wait until stop condition generate */[/color] [color=#0000ff]while[/color](I2C_CTL0(I2C1) & [color=#09885a]0x[/color]0200); [color=#008000] /* infinite loop */[/color] [color=#0000ff]while[/color](1) { } } [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] enable the peripheral clock[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]void[/color] rcu_config([color=#0000ff]void[/color]) { [color=#008000] /* enable GPIOB clock */[/color] rcu_periph_clock_enable(RCU_GPIOB); [color=#008000] /* enable I2C1 clock */[/color] rcu_periph_clock_enable(RCU_I2C1); } [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] configure the GPIO ports[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]void[/color] gpio_config([color=#0000ff]void[/color]) { [color=#008000] /* connect PB6 to I2C1_SCL */[/color] gpio_af_set(GPIOB, GPIO_AF_1, GPIO_PIN_10); [color=#008000] /* connect PB7 to I2C1_SDA */[/color] gpio_af_set(GPIOB, GPIO_AF_1, GPIO_PIN_11); [color=#008000] /* configure GPIO pins of I2C1 */[/color] gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_10); gpio_output_options_set(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_10); gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_11); gpio_output_options_set(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_11); } [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] configure the I2C1 and I2C1 interfaces[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]void[/color] i2c_config([color=#0000ff]void[/color]) { [color=#008000] /* I2C clock configure */[/color] i2c_clock_config(I2C1, 100000, I2C_DTCY_2); [color=#008000] /* I2C address configure */[/color] i2c_mode_addr_config(I2C1, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, [color=#bd63c5]I2C1_SLAVE_ADDRESS7[/color]); [color=#008000] /* enable I2C1 */[/color] i2c_enable(I2C1); [color=#008000] /* enable acknowledge */[/color] i2c_ack_config(I2C1, I2C_ACK_ENABLE); } [color=#008000]/* retarget the C library printf function to the USART */[/color] [color=#0000ff]int[/color] fputc([color=#0000ff]int[/color] [color=#808080]ch[/color], FILE *[color=#808080]f[/color]) { usart_data_transmit([color=#bd63c5]EVAL_COM[/color], ([color=#0000ff]uint8_t[/color]) ch); [color=#0000ff]while[/color]([color=#2f4f4f]RESET[/color] == usart_flag_get([color=#bd63c5]EVAL_COM[/color], USART_FLAG_TBE)); [color=#0000ff]return[/color] [color=#808080]ch[/color]; } 以下是从机程序: [color=#808080]#include[/color][color=#0000ff] [/color][color=#a31515] [/color] [color=#808080]#include[/color][color=#0000ff] [/color][color=#a31515]"gd32f3x0.h"[/color] [color=#808080]#include[/color][color=#0000ff] [/color][color=#a31515]"gd32f350r_eval.h"[/color] [color=#808080]#define[/color][color=#0000ff] [/color][color=#bd63c5]I2C0_OWN_ADDRESS7[/color][color=#0000ff] [/color][color=#09885a]0x[/color]45 [color=#0000ff]uint8_t[/color] i2c_receiver[16]; [color=#0000ff]void[/color] rcu_config([color=#0000ff]void[/color]); [color=#0000ff]void[/color] gpio_config([color=#0000ff]void[/color]); [color=#0000ff]void[/color] i2c_config([color=#0000ff]void[/color]); [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] main function[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]int[/color] main([color=#0000ff]void[/color]) { [color=#0000ff]int[/color] i; gd_eval_com_init([color=#bd63c5]EVAL_COM[/color]); [color=#008000] /* RCU configure */[/color] rcu_config(); [color=#008000] /* GPIO configure */[/color] gpio_config(); [color=#008000] /* I2C configure */[/color] i2c_config(); i = 0; printf([color=#a31515]"start to wait\r\n"[/color]); [color=#008000] /* wait until ADDSEND bit is set */[/color] [color=#0000ff]while[/color](!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); [color=#008000] /* clear ADDSEND bit */[/color] printf([color=#a31515]"address match\r\n"[/color]); i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); printf([color=#a31515]"receive:\r\n"[/color]); [color=#0000ff]for[/color](i = 0; i < 16; i++) { [color=#008000] /* wait until the RBNE bit is set */[/color] [color=#0000ff]while[/color](!i2c_flag_get(I2C0, I2C_FLAG_RBNE)); [color=#008000] /* read a data byte from I2C_DATA */[/color] i2c_receiver[i] = i2c_data_receive(I2C0); printf([color=#a31515]"%x "[/color], i2c_receiver[i]); } [color=#008000] /* wait until the STPDET bit is set */[/color] [color=#0000ff]while[/color](!i2c_flag_get(I2C0, I2C_FLAG_STPDET)); [color=#008000] /* clear the STPDET bit */[/color] i2c_enable(I2C0); printf([color=#a31515]"\n"[/color]); [color=#0000ff]while[/color](1) { } } [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] enable the peripheral clock[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]void[/color] rcu_config([color=#0000ff]void[/color]) { [color=#008000] /* enable GPIOB clock */[/color] rcu_periph_clock_enable(RCU_GPIOB); [color=#008000] /* enable I2C0 clock */[/color] rcu_periph_clock_enable(RCU_I2C0); } [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] configure the GPIO ports[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]void[/color] gpio_config([color=#0000ff]void[/color]) { [color=#008000] /* connect PB6 to I2C0_SCL */[/color] gpio_af_set(GPIOB, GPIO_AF_1, GPIO_PIN_6); [color=#008000] /* connect PB7 to I2C0_SDA */[/color] gpio_af_set(GPIOB, GPIO_AF_1, GPIO_PIN_7); [color=#008000] /* configure GPIO pins of I2C0 */[/color] gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_6); gpio_output_options_set(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6); gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_7); gpio_output_options_set(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_7); } [color=#008000]/*![/color] [color=#008000] [/color][color=#0000ff]\brief[/color][color=#008000] configure the I2C0 interface[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]in[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\param[/color][color=#008000][[/color][color=#0000ff]out[/color][color=#008000]] [/color][color=#808080]none[/color] [color=#008000] [/color][color=#0000ff]\retval[/color][color=#008000] none[/color] [color=#008000]*/[/color] [color=#0000ff]void[/color] i2c_config([color=#0000ff]void[/color]) { [color=#008000] /* I2C clock configure */[/color] i2c_clock_config(I2C0, 100000, I2C_DTCY_2); [color=#008000] /* I2C address configure */[/color] i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, [color=#bd63c5]I2C0_OWN_ADDRESS7[/color]); [color=#008000] /* enable I2C0 */[/color] i2c_enable(I2C0); [color=#008000] /* enable acknowledge */[/color] i2c_ack_config(I2C0, I2C_ACK_ENABLE); } [color=#008000]/* retarget the C library printf function to the USART */[/color] [color=#0000ff]int[/color] fputc([color=#0000ff]int[/color] [color=#808080]ch[/color], FILE *[color=#808080]f[/color]) { usart_data_transmit([color=#bd63c5]EVAL_COM[/color], ([color=#0000ff]uint8_t[/color]) ch); [color=#0000ff]while[/color]([color=#2f4f4f]RESET[/color] == usart_flag_get([color=#bd63c5]EVAL_COM[/color], USART_FLAG_TBE)); [color=#0000ff]return[/color] [color=#808080]ch[/color]; } [/font][/backcolor] [font=Consolas, Courier New, monospace][backcolor=rgb(255, 255, 255)]按照我的理解,主机不论是否有从机存在,应该必定会有从机地址发出来的信号,有ACK回应那么说明从机识别成功。[/backcolor][/font] [font=Consolas, Courier New, monospace][backcolor=rgb(255, 255, 255)]我的iic1的SCL和SDA都外加了上拉电阻到3.3V。[/backcolor][/font] [font=Consolas, Courier New, monospace][backcolor=rgb(255, 255, 255)]iic1是否有什么需要特殊处理的地方?是否是管脚不对?我从例程里查看它使用iic1的时候也是使用的PB10和PB11[/backcolor][/font] 2058浏览量 0回复量 关注量 -
GD32F103CBT6 IIC写数据后IIC不能STOP的问题咨询 sos
[backcolor=rgb(255, 255, 255)][font=Consolas, "][size=13px][color=#0000ff]使用GD的硬件IIC通讯,代码用STM32的,能读但不能写,表现为写8个字节(一页)数据后时钟没办法恢复到高电平状态,咨询一下大家有没有比较通用的方法:[/color] [color=#0000ff] [/color] [color=#0000ff]定位到应该是以上代码中不能使GD的IIC正常STOP,STM32和HK32都正常:[/color] [color=#0000ff]void[/color] [color=#795e26]I2C_EE_WaitEepromStandbyState2[/color]([color=#0000ff]void[/color]) { [color=#795e26]I2C_GenerateSTOP[/color]([color=#0000ff]EEPROM_I2Cx[/color], [color=#0070c1]ENABLE[/color]); [color=#af00db]return[/color]; [color=#267f99]vu16[/color] [color=#001080]SR1_Tmp[/color] = [color=#098658]0[/color]; [color=#af00db]do[/color] { [color=#008000]/* 发送起始信号 */[/color] [color=#795e26]I2C_GenerateSTART[/color]([color=#0000ff]EEPROM_I2Cx[/color], [color=#0070c1]ENABLE[/color]); [color=#008000]/* 读 I2C1 SR1 寄存器 */[/color] [color=#001080]SR1_Tmp[/color] = [color=#795e26]I2C_ReadRegister[/color]([color=#0000ff]EEPROM_I2Cx[/color], I2C_Register_SR1); [color=#008000]/* 发送 EEPROM 地址 + 写方向 */[/color] [color=#795e26]I2C_Send7bitAddress[/color]([color=#0000ff]EEPROM_I2Cx[/color], [color=#001080]EEPROM_ADDRESS[/color], I2C_Direction_Transmitter); } [color=#008000]// SR1 位 1 ADDR:1 表示地址发送成功,0 表示地址发送没有结束[/color] [color=#008000]// 等待地址发送成功[/color] [color=#af00db]while[/color] (!([color=#795e26]I2C_ReadRegister[/color]([color=#0000ff]EEPROM_I2Cx[/color], I2C_Register_SR1) & [color=#098658]0x0002[/color])); [color=#008000]/* 清除 AF 位 */[/color] [color=#795e26]I2C_ClearFlag[/color]([color=#0000ff]EEPROM_I2Cx[/color], I2C_FLAG_AF); [color=#008000]/* 发送停止信号 */[/color] [color=#795e26]I2C_GenerateSTOP[/color]([color=#0000ff]EEPROM_I2Cx[/color], [color=#0070c1]ENABLE[/color]); } [/size][/font][/backcolor]
1529浏览量 0回复量 关注量 -
芯圣芯片PTM重映射寄存器如何配置?
各位好,第一次调试芯圣芯片,893650芯片,代码模块库例程里IIC重映射到P0.0、P0.1,SCL_MAP=0XC0,SDA_MAP=0XC1,这个C是怎么来的,哪里有说明文档,为何不是00,01?INT0例程里,INT0映射到P1.0,INT0_MAP=0X08,这个为何不是0x10?按芯片手册里串口映射配置寄存器的写法,不是应该高位是PORT口,低位是Pin口吗?这个赋值规则都不一样,搞不来,有芯圣原厂技术的吗?求支招,谢谢。
4339浏览量 5回复量 关注量 -
SC95F8517模拟 IIC无应答
#define IIC_SDA P16 #define IIC_SCL P15 #define READ_SDA P1CON &= 0xbf #define SDA_OUT() P1CON |= 0x40,P1PH |=0x40 #define SDA_IN() P1CON &= 0xbf,P1PH |=0x40 #define ADDR_PLF2105D 0x50 void delay_us( uint us) { uint x; for(x=us;x>0;x--); } void delay_ms(u16 nms) { u32 i; for(i=0;i
250) { IIC_Stop(); return 1; } } IIC_SCL=0;//时钟输出0 return 0; } //产生ACK应答 void IIC_Ack(void) { IIC_SCL=0; SDA_OUT(); IIC_SDA=0; delay_us(6); IIC_SCL=1; delay_us(6); IIC_SCL=0; } //不产生ACK应答 void IIC_NAck(void) { IIC_SCL=0; SDA_OUT(); IIC_SDA=1; delay_us(6); IIC_SCL=1; delay_us(6); IIC_SCL=0; } //IIC发送一个字节 //返回从机有无应答 //1,有应答 //0,无应答 void IIC_Send_Byte(uchar txd) { uchar t; SDA_OUT(); IIC_SCL=0;//拉低时钟开始数据传输 for(t=0;t<8;t++) { IIC_SDA=(txd&0x80)>>7; txd<<=1; delay_us(6); //对TEA5767这三个延时都是必须的 IIC_SCL=1; delay_us(6); IIC_SCL=0; delay_us(6); } } //读1个字节,ack=1时,发送ACK,ack=0,发送nACK uchar IIC_Read_Byte(uchar ack) { unsigned char i,receive=0; SDA_IN();//SDA设置为输入 for(i=0;i<8;i++ ) { IIC_SCL=0; delay_us(32); IIC_SCL=1; receive<<=1; if(READ_SDA)receive++; delay_us(16); } if (!ack) IIC_NAck();//发送nACK else IIC_Ack(); //发送ACK return receive; } //IIC连续写 //addr:器件地址 //reg:寄存器地址 //len:写入长度 //buf:数据区 //返回值:0,正常 // 其他,错误代码 uchar IIC_Write_Len(uchar addr,uchar len,uchar *buf) { uchar i; IIC_Start(); IIC_Send_Byte((addr<<1)|0);//发送器件地址+写命令 if(IIC_Wait_Ack()) //等待应答 { IIC_Stop(); return 1; } for(i=0;i 1843浏览量 2回复量 关注量 -
帮忙推荐一颗国产的32位MCU,一颗触摸IC,一颗8位MCU
[i=s] 本帖最后由 415755665 于 2021-1-22 00:15 编辑 [/i] 1、32位 价格在2块到3块,QFN32 8K + 32K ,FLASH,M0内核,起码3组可以独立工作的串口,参考HR8P506的MCU2、触摸IC: 价格要求在0.8-1.2左右 16引脚以及以上,4K FLASH以上,带从IIC 3、普通MCU:价格要求在0.5-1块左右,8K FLASH,带从IIC,带一组串口
2092浏览量 1回复量 关注量 -
GD32F的IIC模块读取是,读的字节数为2,将I2C_CTL0的POAP置为1?
GD32F103的IIC模块在进行eeprom读取的时候,当读取的字节数为2时,需要将I2C_CTL0的POAP置为1;POAP的定义如下: 0:ACKEN位决定对当前正在接收的字节发送ACK; 1: ACKEN位决定是否对下一个字节发送ACK. 我的理解时:当读取的字节数为2时,该位置1,表示接收第一个字节后,发送ACK;接收第二个字节后,不发送ACK。这样就能保证时序的正确性。 不知道各位大佬是如何理解的,请赐教。谢谢! 代码如下: void eeprom_buffer_read(uint8_t* p_buffer, uint8_t read_address, uint16_t number_of_byte) { /* wait until I2C bus is idle */ while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); if(2 == number_of_byte) { i2c_ackpos_config(I2C0,I2C_ACKPOS_NEXT); //如果接收的的字节数等于2,则将将I2C_CTL0的POAP置为1。 } /* send a start condition to I2C bus */ i2c_start_on_bus(I2C0); /* wait until SBSEND bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); /* send slave address to I2C bus */ i2c_master_addressing(I2C0, eeprom_address, I2C_TRANSMITTER); /* wait until ADDSEND bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); /* clear the ADDSEND bit */ i2c_flag_clear(I2C0,I2C_FLAG_ADDSEND); /* wait until the transmit data buffer is empty */ while(SET != i2c_flag_get( I2C0 , I2C_FLAG_TBE)); /* enable I2C0*/ i2c_enable(I2C0); /* send the EEPROM's internal address to write to */ i2c_data_transmit(I2C0, read_address); /* wait until BTC bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_BTC)); /* send a start condition to I2C bus */ i2c_start_on_bus(I2C0); /* wait until SBSEND bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); /* send slave address to I2C bus */ i2c_master_addressing(I2C0, eeprom_address, I2C_RECEIVER); if(number_of_byte < 3){ /* disable acknowledge */ i2c_ack_config(I2C0,I2C_ACK_DISABLE); } /* wait until ADDSEND bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); /* clear the ADDSEND bit */ i2c_flag_clear(I2C0,I2C_FLAG_ADDSEND); if(1 == number_of_byte){ /* send a stop condition to I2C bus */ i2c_stop_on_bus(I2C0); } /* while there is data to be read */ while(number_of_byte){ if(3 == number_of_byte){ /* wait until BTC bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_BTC)); /* disable acknowledge */ i2c_ack_config(I2C0,I2C_ACK_DISABLE); } if(2 == number_of_byte){ /* wait until BTC bit is set */ while(!i2c_flag_get(I2C0, I2C_FLAG_BTC)); /* send a stop condition to I2C bus */ i2c_stop_on_bus(I2C0); } /* wait until the RBNE bit is set and clear it */ if(i2c_flag_get(I2C0, I2C_FLAG_RBNE)){ /* read a byte from the EEPROM */ *p_buffer = i2c_data_receive(I2C0); /* point to the next location where the byte read will be saved */ p_buffer++; /* decrement the read bytes counter */ number_of_byte--; } } /* wait until the stop condition is finished */ while(I2C_CTL0(I2C0)&0x0200); /* enable acknowledge */ i2c_ack_config(I2C0,I2C_ACK_ENABLE); i2c_ackpos_config(I2C0,I2C_ACKPOS_CURRENT); }
3118浏览量 2回复量 关注量 -
基于HAL实现IIC主从通信的问题
主MCU发送多个字节从MCU可以通过中断的方式接收到,主机接收从MCU数据时前面会多一个字节,如2B 中间数据正确,最后几个字节也是错的,求帮忙分析一下,感谢
1097浏览量 1回复量 关注量 -
新手不会调试IIC
我是一个新手,我IIC程序都编译成功了,DSView捕获波形的时候SDA没有波形,应该是没有往里面写入寄存器地址和数据,如果往地址0x02写入0xaa,不知道怎么往里写入.[img][/img]
1638浏览量 13回复量 关注量 -
使用主控IIC模式读取MPU9250的磁力计数据,数据总是显示为0?
最近在用IIC方式读取磁力计数据,因为在单片机的一个IIC上需要连接两个MPU9250模块,所以其中一个磁力计直接使用单片机IIC读取,可以正常读取数据,并且更新;另外有一个磁力计使用主控IIC去读取磁力计,读取的数据都为零,并且更新速度特别慢,甚至是五六秒才更新一次,设置了延时,每一次读取数据读取一位,并判断了ST1和ST2标志位,没有判断标志位时,还能读取数据,但是有好几次数据读出来一样,感觉更新比较慢,网上说磁力计的更新速度最大为100hz,并没有在寄存器手册中找到说明;遇到的问题有点多,请大佬帮助解答一下,感激不尽{:handshake:}
2738浏览量 1回复量 关注量