Page 1 of 2
Problem with DAC MCP41x6
Posted: Mon Jun 19, 2023 9:43 am
by DirkB
Hello,
the family DAC MCP41x6 does not work with the hardware. In simulation it works very well.
However the speed of the program is decreased by about half in simulation and hardware, if
you include a DAC. If a PWM is used as output, the speed increases again by about twice.
regards
Dirk
Re: Problem with DAC MCP41x6
Posted: Mon Jun 19, 2023 10:00 am
by BenR
Hello Dirk,
Please can you attach your program and I'll investigate the issue for you, would be interesting to see the speed difference.
Re: Problem with DAC MCP41x6
Posted: Tue Jun 20, 2023 5:59 pm
by DirkB
Hello Ben,
here it is. A small wave generator. if you activate either the pwm or the dac, you can see the
difference in speed very well. However, the DAC does not work with the hardware chip.
Is it possible that PWM as well as of course the DAC reduce the speed less? Without output the
speed is really dramatically faster.
regards
Dirk
Re: Problem with DAC MCP41x6
Posted: Wed Jun 28, 2023 12:58 pm
by DirkB
sorry, it should of course be mpc47x6 ;O)
regards
Dirk
Re: Problem with DAC MCP41x6
Posted: Sun Jul 02, 2023 4:39 pm
by DirkB
Hi Ben, any news?
Dirk
Re: Problem with DAC MCP41x6
Posted: Mon Jul 03, 2023 9:41 am
by BenR
Hi Dirk,
Is the User Address Bits property correct for your MCP47x6 device? It wont work without this being correct.
Assuming that' correct you have enabled the DAC before intialising it and so the enable call will likely never make it to the DAC.
Re: Problem with DAC MCP41x6
Posted: Mon Jul 03, 2023 2:57 pm
by medelec35
Hi Dirk.
Following on from Ben's post about the address.
You might already know this, but if so this will be useful for other people with a similar device.
The User Address Bits is of course determined by the Logic state of Pins A0 to A2.
If I was you I would the voltage of the pins and then set the User Address Bits according to the table below:

- MCP47x6 DAC I2C Address.png (6.75 KiB) Viewed 7377 times
If you are still having issues, then I will order a DAC and see if I can work out what the issue is.
The Address in Hex column is just in case you are using a logic analyser that shows address.
If not it can be ignored as it's not required for your project file.
Re: Problem with DAC MCP41x6
Posted: Mon Jul 17, 2023 2:26 pm
by DirkB
Hello,
I do not understand. It is an I2C device and the channel and address are set in the properties. In my case channel 1 (Hardware) and address 0 or 1,
it does not matter. And yes, I enabled the DAC first and then initialized. But there is still the problem that the actual program is extremely
slowed down when the DAC is used, unlike a PWM.
Dirk
Re: Problem with DAC MCP41x6
Posted: Mon Jul 17, 2023 2:43 pm
by DirkB
Me again. You can understand the problem with the speed very well in my small program attached above by activating once the PWM and then instead of the PWM the DAC. The speed appears 10 times slower with the DAC. My DAC also gives no output voltage, it does not work.
Dirk
Re: Problem with DAC MCP41x6
Posted: Tue Jul 18, 2023 10:04 pm
by BenR
Hi Dirk,
Do you have pull up resistors fitted on the SCL and SDA traces? The I2C will be slower then the PWM which is based on internal register writes but shouldn't be really slow as each write only sets a couple of registers on the device.
If it's still not working and you've confirmed the pull up resistors are in place then I'll have another look through the component code and make sure this all looks ok.