CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

About the Forum

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

About the Forum
PostPosted: Mon May 06, 2013 8:21 am     Reply with quote

Hey Forum,

I was thinking about the Code Library and how much collective work there is in that part of this forum.
This got me thinking about how disorganized *WE* are, and by that I mean PIC users in general.
I know that is a very big generalization, but consider the following:

I think one of the great successes of Arduino is the standardization of “drivers” or at least their community’s code library organization. Even more, is how much people simply trust the code to work, and in fact it DOES.

Now, back to the Code Library, we know that everybody that posts “drivers” there tested their code at least once… or we trust they did.

But in reality we do not have any guarantees or indication of “Confidence Level” on how good that code is… I know “good code” is like a pretty girl… it depends on the eye of the beholder.

So how about maybe creating a *Certificate* of sorts and a new Code Library, where only code that has been tested and “approved” by at least 5 different Forum members gets posted by a moderator for example, with a list of the testers. This library is not open for comments or questions… it is simply a repository of *Certified* code.

Instead of posting similar drivers for the same part (for example the DS1307), the single *Certified* driver would now include the new functionality that has been recently added…
Code revisions would just improve or add completeness to the driver, not fork into 6 slightly different drivers.

This is Utopian at best… I know, but I wonder what you guys think.
After all it would be ALL OF US who would benefit from this.
I know we all work, dont have time, etc...

I often wonder what would be the most complex thing I could build using drivers straight of the library.


G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Mon May 06, 2013 8:43 am     Reply with quote

Right of the bat i would suggest we ALL do an attempt to do this for a few parts like:

RTC's: DS1305 & DS1307
EEPROM's (IC2 and SPI - one driver for all sizes)
TEMP Sensors: LM35, DS18B20
ADC Sampling routines and other clever ones
LCD's


If this gets some kind of support, i will post my:

DS1305
25LC512

and we cant start on that...

LETS GET 5 CLEAN USEFULL DRIVERS, and see how it goes.

G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Mon May 06, 2013 9:09 am     Reply with quote

These are some examples of things i see on the forum that we could all work on, improve and get to a point where we can blindly TRUST:

by asmboy:
FAST F2C C2F temperature converts - no floats - no division
http://www.ccsinfo.com/forum/viewtopic.php?t=50354

by asmboy:
Radical olympic++ ADC averaging , de-noising routine
http://www.ccsinfo.com/forum/viewtopic.php?t=50320

by sshahryiar:
Arduino's "map" function in CCS
http://www.ccsinfo.com/forum/viewtopic.php?t=49501

by ckielstra:
Timer based Real Time Clock (RTC)
http://www.ccsinfo.com/forum/viewtopic.php?t=26177

by wangine
low pass and high pass filter
http://www.ccsinfo.com/forum/viewtopic.php?t=46829

by mbradley:
Pseudo Classes - Include two more copies of the same code.
http://www.ccsinfo.com/forum/viewtopic.php?t=46748

by SteveS:
Filters (long)
http://www.ccsinfo.com/forum/viewtopic.php?t=19509


Most of these are little code widgets.... but some are Brilliant!
and there are many others...

PCM Programmer has billions of suggestions and little code snippets that are lost in help threads...

for example the 4 SPI MODES Defines:

Code:
#define SPI_MODE_0 (SPI_L_TO_H |SPI_XMIT_L_TO_H)
#define SPI_MODE_1 (SPI_L_TO_H)
#define SPI_MODE_2 (SPI_H_TO_L)
#define SPI_MODE_3 (SPI_H_TO_L |SPI_XMIT_L_TO_H)


Finding that was one of the most helpfull things ive found on this forum...

this stuff should not be lost or simply posted and forgoten...

G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Mon May 06, 2013 9:12 am     Reply with quote

At least part of the problem is that a web forum is a place for discussion, not a place for a code library.

A wiki would be a more appropriate place for a code library. The problem there is that it really needs to be set up by CCS. I mean, I could set up a wiki on my web site, but I'm just a random CCS user.

Of course, a wiki is good for a lot more than a code library...
_________________
Andrew
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Mon May 06, 2013 9:28 am     Reply with quote

true.
however, we all hang around here... and to a point "know" each other,
we would not have to set up any infrastructure...or got to a diferent site.

the code can originate here, Selected here to be unified/cleaned here, and posted here...for use of people here...

This is our forum, our compiler, our code, and our collective job to keep it clean if one of us decides to open their code... is it not?

after all, your open code IS also MY code, no?


G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon May 06, 2013 10:59 am     Reply with quote

one obvious problem that i and other posters have with your concept is this:

many drivers that i have created are either new original work for hire or repairs/mods to other pre-existing code. covered by confidentiality agreements.
when i can, i post code that is a non critical component of work for hire.

one example
http://www.ccsinfo.com/forum/viewtopic.php?t=47110&highlight=ad9850%2A

is a VERY stripped down subset of a DUAL 9850 driver that produces phase locked quadrature signal sources for a synchronous demodulator, guaranteed accurate to one cycle of the master source clock for the pair of chips. works great, customer loves it.....

but i can not ethically or contractually give that code away .

most of my drivers are that way.

I think you will find many other code contributors with similar situations.

ALSO
i have found many examples in the library that are knee deep in sketchy
coding that i would not begin to consider using.
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Mon May 06, 2013 11:19 am     Reply with quote

totally valid point but my intention is NOT to make others breach their contracts.

I have "generic" drivers I reuse and try to improve on from time to time.
I am sure you do too.

it is those OPEN non-contract-bound code we could Collectively improve on.
or Write New ones for the forum

my intention is precisely to eliminate the "Sketchy" codes and to start creating a library of "drivers" that have a General approval of the forum.
A Filter.

a clear example of such type of driver would be PCM's Flex_LCD.
I'm am sure EVERYBODY including you agrees its a reliable driver.

I am sure PCM is not infallible, however his driver has passed the test of time and i think the general consensus of the forum is that its not Sketchy.
i use it, and it worked right out of the forum... compiled, BAM! LCD on all my proyects... that simple.

Ive posted a few drivers myself, and I am the first one to admit they are not perfect, but my drivers and others can benefit from a others testing and improving until there is a Non-sketchy Generic driver that works well.

Like i said earlier... lets get a few Generic parts and lets make drivers for those...
there is plenty to build on here... lets agree on a few sketchy drivers, and clean them up.

Most of us don't need the fast Fourier transforms some user made for NASA.
but we ALL use RTC's, EEPROMS, Sensors, etc... simple stuff that we should not be coding over and over again.

G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group