Adding support for 16 channel PWM expansion to libraries

Related to the development libraries, released by Curt Binder

Posts: 149
Joined: Mon Oct 15, 2012 7:21 pm
Location: Albany, GA
PostPosted: Mon Jul 14, 2014 8:21 am
The default address is 0x40 for the Adafruit Servo Breakout board and 0x41 with A0 jumper soldered. So the board should work without any kind of modifications to it or the library then correct. Thanks for the input/help.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Thu Jul 24, 2014 10:47 am
Quick update on this. The code all compiles and is in my github repo. I've pulled down the upstream stuff from Roberto and merged it all in. I'm going to load it on my RA+ tonight and see what it does over the next couple of days. One thing I discovered is that C++ doesn't like defined names to start with numbers, so I had to replace "16" with "SIXTEEN" everywhere, heh.

Also, Roberto, if you read this, if I changed the RA_Net size from 26 to 42 to accommodate 16 channels of dimming expansion in Globals.h will that break stuff?

Posts: 12327
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Jul 24, 2014 10:55 am
If you are going to provide complete compatibility for all 16 channels, there is a lot more to it than just the RANet size.
Anything related to PWM will need to be updated, including a few that pops my mind: PWM channels, PWM override, wifi xml, wifi json, RANet array, LCD screens and internal memory locations.
Roberto.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Thu Jul 24, 2014 11:58 am
OK. Got PWM channels and PWM override already in. I added it in a few small spots of LCD screens variables and internal memory locations, but don't know exactly what I'm doing with those. Didn't do anything to RANet array or the wifi stuff. Will at least look at that.

Thanks.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Thu Jul 24, 2014 1:50 pm
What do you think would need to be stuck in the internal memory locations, by the way? I don't see much in there for the regular 6 channel PWM expansion.

Basically I'm finding places where the 6 channel one is referenced and defines for PWMEXPANSION and doing the same thing for the 16 channel one everywhere I can.

Posts: 12327
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Jul 24, 2014 2:44 pm
Yes, the internal memory has 3 locations for each channel.
Code: Select all
#define Mem_B_PWMSlopeStart0      VarsStart+58
#define Mem_B_PWMSlopeEnd0         VarsStart+59
#define Mem_B_PWMSlopeDuration0   VarsStart+60
#define Mem_B_PWMSlopeStart1      VarsStart+61
#define Mem_B_PWMSlopeEnd1         VarsStart+62
#define Mem_B_PWMSlopeDuration1   VarsStart+63
#define Mem_B_PWMSlopeStart2      VarsStart+64
#define Mem_B_PWMSlopeEnd2         VarsStart+65
#define Mem_B_PWMSlopeDuration2   VarsStart+66
#define Mem_B_PWMSlopeStart3      VarsStart+67
#define Mem_B_PWMSlopeEnd3         VarsStart+68
#define Mem_B_PWMSlopeDuration3   VarsStart+69
#define Mem_B_PWMSlopeStart4      VarsStart+70
#define Mem_B_PWMSlopeEnd4         VarsStart+71
#define Mem_B_PWMSlopeDuration4   VarsStart+72
#define Mem_B_PWMSlopeStart5      VarsStart+73
#define Mem_B_PWMSlopeEnd5         VarsStart+74
#define Mem_B_PWMSlopeDuration5   VarsStart+75
Roberto.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Thu Jul 24, 2014 4:20 pm
Ah, right. I didn't make the connection that there were three for each channel.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Mon Aug 11, 2014 4:26 pm
These are in and seem to be working well for my custom dimming module. I submitted a pull request against /dev tonight after a few months of work off and on on various things that I considered to be prerequisites to making these work how I wanted them to work. They work in DCPump, PWM, with all of the overrides, and also report over Wifi.

They are currently in https://github.com/amunter/Libraries/tree/issue161 if someone wanted to download the .zip and play, but it should be in the dev branch soon, I imagine.

I recommend that if someone is really interested in seeing what this little controller can do they should take a crack at adding something to the code. I "get it" way more than I would have if I hadn't set out to add a feature and feel pretty confident now that I'll like what I get it to do. 8)

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Mon Aug 11, 2014 4:28 pm
Oh, and the cool thing is that binder already has it pretty much working in the Android app beta! Talk about service!

Posts: 74
Joined: Mon Aug 05, 2013 3:16 am
PostPosted: Thu Sep 25, 2014 6:10 am
I would really love to have this. Is it completely up and running now? Can all 16 channels be addressed and be dimmed at 12 bit resolution? How can I purchase one and for how much?
THANKS!
PreviousNext

Return to Development Libraries

Who is online

Users browsing this forum: No registered users and 2 guests

cron