Problem with DAC MCP41x6

Any bugs you encounter with Flowcode should be discussed here.
DirkB
Posts: 59
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 3:55 pm
Been thanked: 4 times

Re: Problem with DAC MCP41x6

Post by DirkB »

Hello,

of course I have inserted pull up resistors. You must always use these with i2c.
The bug is also understandable in the simulation, by using alternately once pwm
or once dac as output.

regards

Dirk

BenR
Matrix Staff
Posts: 1742
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 443 times
Been thanked: 604 times

Re: Problem with DAC MCP41x6

Post by BenR »

Hi Dirk,

I'm having a look now, I assume you mean the MCP47x6 DAC component.

Have you checked the user address bits property matches the address of the device?
AddressConfir.jpg
AddressConfir.jpg (69.86 KiB) Viewed 3854 times
Might be worth trying the I2C scanner program and seeing if that can see the device and confirm its address.
https://www.flowcode.co.uk/wiki/index.p ... ss_Scanner

DirkB
Posts: 59
Joined: Thu Dec 10, 2020 3:55 pm
Been thanked: 4 times

Re: Problem with DAC MCP41x6

Post by DirkB »

Hi Ben,

Of course I have always installed pullup resistors. Other I2C devices work properly. It still does not work. Because program becomes extremely slow and I get no output on the DAC. With pwm the speed is about 10 times or more as fast. You can see this very well in my program once PWM and then DAC is used as output.

regrds
Dirk

DirkB
Posts: 59
Joined: Thu Dec 10, 2020 3:55 pm
Been thanked: 4 times

Re: Problem with DAC MCP41x6

Post by DirkB »

Of course I have installed pullup resistors.
Other I2C devices work properly. The drastic drop in the speed of the program can be seen very well in my small program by using the DAC and then the PWM as output. The speed with dac is 10 - 20 times slower than with pwm.
Please get one of these dac's and you will see that there is also no output on the DAC.

Dirk

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Problem with DAC MCP41x6

Post by WingNut »

You can say that again!

DirkB
Posts: 59
Joined: Thu Dec 10, 2020 3:55 pm
Been thanked: 4 times

Re: Problem with DAC MCP41x6

Post by DirkB »

Of course I have installed pullup resistors.
Other I2C devices work properly. The drastic drop in the speed of the program can be seen very well in my small program by using the DAC and then the PWM as output. The speed with dac is 10 - 20 times slower than with pwm.
Please get one of these dac's and you will see that there is also no output on the DAC.

Dirk

DirkB
Posts: 59
Joined: Thu Dec 10, 2020 3:55 pm
Been thanked: 4 times

Re: Problem with DAC MCP41x6

Post by DirkB »

ahmmm, i can't see my answers!!!!????

medelec35
Matrix Staff
Posts: 1452
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Problem with DAC MCP41x6

Post by medelec35 »

Hi Dirk.
It sounds like you could have got the address wrong with the properties, which is causing blocking timing issues with PWM.
Yes, you do set the address within properties, but they have to match the address preset within the hardware.
The MCP47x6 datasheet states:
Note: Address Bits (A2:A0) specified at time of device
order

So the address can be any 1 of the 8 addresses.
So you might be selecting a different address that the chip is set to.
What you will need to do is find out what the actual address is.
If you have a logic analyser, scope, or USB to UART converter then the I2C address finder/sniffer[/url] will show you what the correct address is.
Without using one, I don't think you will get any further.
This is what Ben has also suggested.
My guess is you are using FC9 so this should work.
As you have not used a 9 or 10 post icon I can't post a link to the sniffer on the Wiki as that is for FC10.
I will be deleting your duplicated posts to tidy up this topic.
Martin

DirkB
Posts: 59
Joined: Thu Dec 10, 2020 3:55 pm
Been thanked: 4 times

Re: Problem with DAC MCP41x6

Post by DirkB »

Hello,

I have replied many times but my answers are not showing. No idea why that is. Of course have installed pullup resistors, otherwise the i2c devices do not work. The speed of the program is 10 times slower with i2c DAC than with PWM. You can see this very well with my small program. Please get a MPC4716 and connect it. Also there is no output on the DAC. In the simulation there is an output. In the simulation the program is also 10 times slower. I have absolutely no idea what this can be.

Dirk

DirkB
Posts: 59
Joined: Thu Dec 10, 2020 3:55 pm
Been thanked: 4 times

Re: Problem with DAC MCP41x6

Post by DirkB »

Of course I have installed pullup resistors.

Post Reply