Hello experts,
I need to change the Address Bits of the MCP4728, but I am not experienced enough to write a program.
My program is as follows and it does not work:
// Write Command: Write I2C Address Bits to the DAC Registers and EEPROM - page 42
sbit LDAC at LATB.B2; // Pin RB2
LDAC = 1;
I2C1_Start();
I2C1_Wr(0b11000000);
I2C1_Wr(0b01100001);
LDAC = 0;
I2C1_Wr(0b01101010);
I2C1_Wr(0b01101011);
I2C1_Stop();
Could someone fix it.
Thank you very much.
Jan Jakubec
MCP4728 (page 42) - change Address Bits 000 to 010.
-
- Posts: 4
- Joined: 15 Apr 2017 15:57
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: MCP4728 (page 42) - change Address Bits 000 to 010.
Hi,
If you want to use I2C1_wr you need to initialize the I2C first.
https://download.mikroe.com/documents/c ... tm#i2c1_wr
Regards,
Ivan.
If you want to use I2C1_wr you need to initialize the I2C first.
https://download.mikroe.com/documents/c ... tm#i2c1_wr
Regards,
Ivan.
-
- Posts: 4
- Joined: 15 Apr 2017 15:57
Re: MCP4728 (page 42) - change Address Bits 000 to 010.
Dear Ivan Jeremic.
I can initialize I2C devices.
I need advice on how to go from 1 to 0 before bit 8.
I2C1_Wr(0b0110000 /LDAC = 1; => LDAC = 0;/ 1);
Thank you very much.
Jan Jakubec
I can initialize I2C devices.
I need advice on how to go from 1 to 0 before bit 8.
I2C1_Wr(0b0110000 /LDAC = 1; => LDAC = 0;/ 1);
Thank you very much.
Jan Jakubec
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: MCP4728 (page 42) - change Address Bits 000 to 010.
Hi,
Try going through our example for DAC 4 click, it also uses MCP4728.
https://libstock.mikroe.com/projects/vi ... ac-4-click
You can also see in the links below how to use I2C with MCP4728:
https://download.mikroe.com/documents/d ... 100,106,92
https://download.mikroe.com/documents/d ... 100,442,92
Regards,
Ivan.
Try going through our example for DAC 4 click, it also uses MCP4728.
https://libstock.mikroe.com/projects/vi ... ac-4-click
You can also see in the links below how to use I2C with MCP4728:
https://download.mikroe.com/documents/d ... 100,106,92
https://download.mikroe.com/documents/d ... 100,442,92
Regards,
Ivan.