Ported GP8403 for Raspberry Pi Pico

userHead TORPI.NOUCHE 2023-03-31 10:07:45 1081 Views7 Replies

I am currently porting the library to MicroPython (for Raspberry Pi Pico). Here is the repo: https://github.com/couillonnade/DFRobot_GP8403/tree/master/python/RP2

 

I stripped down the waves generation because this is useless here to me.

 

Next step is to bit bang the “store” sequence because it does not respect i2c (the first chunk of data is only 3 bits and not a byte… and ACKS are NACKS in the 6 data bytes).

 

If anyone want to help or just test it with their hardware and give feedback, you are welcome.

 

2023-12-19 10:37:37

I'm really new to this and I wanted to use the Dfrobot I2C DAC 0-10v to simply manage a voltage out from an input through a dashboard on blynk, is there someone that can help as to how this can be done in micropython, I've run the code in the link and I seem to get a 5v out and a 10v out on both Vouts?  How do I just set a voltage say on channel 0, that could be anywhere between 0-10v.  Thanks

userHeadPic Steve.Kuester
2023-04-18 16:49:21

Tested well, I had no problems.

Thanks for all the work.

 

userHeadPic Guy.Bilodeau
2023-04-13 16:03:53

I was looking to test the code but I 404 error on that link?

 

userHeadPic Guy.Bilodeau
2023-04-04 18:31:24

If anyone interested, it has been tested on Raspberry Pi Pico. 

 

Range, Output and Store works properly.

userHeadPic TORPI.NOUCHE
2023-03-31 19:23:41

The “store”function needs to be implemented by software I2C, you can refer to python's software I2C writing method.https://github.com/DFRobot/DFRobot_GP8403/tree/master/python/raspberryPi

userHeadPic Miya.zhang
TORPI.NOUCHE wrote:

It's not entirely true because MicroPython SoftI2C (like any other I2C library) does not support sending 3 bits only, it sends bytes. In your code, the second line sends only 3 bits, it's handled in your code in _send_byte with a loop and after 3 bits it stops.

 

Also, the 8 data blocks wait for a NACK instead of an ACK. 

 

This has been confirmed in the Raspberry Pi interfacing forum here: https://forums.raspberrypi.com/viewtopic.php?t=349617

 

Or maybe by software I2C, you mean bit banging the the data and clock like I did?

 

Anyway, I have implemented the same _send_data method to support your custom I2C : 

https://github.com/couillonnade/DFRobot_GP8403/tree/master/micropython/RP2

 

After testing with the HW, I can send a PR if you are willing to accept it.

2023-04-01 03:24:45
TORPI.NOUCHE wrote:

I reorganized the repo to add a Micropython folder. Here is the repo now https://github.com/couillonnade/DFRobot_GP8403/tree/master/micropython/RP2

 

Also fixed your samples in Python.

2023-04-01 13:27:44
2 Replies