views:

159

answers:

7

I'm wondering if anyone knows of a place on the web that I can purchase or download software modules, written in C or C++, for the interaction between microprocessors and other components, like DACs, ADCs, or UARTs. Sort of like a git-hub for embedded C software. Does this place exist?

+1  A: 

Normally the device manufacturer will supply you with a libc that you can use for all the low-level stuff.

Ignacio Vazquez-Abrams
A: 

first, decide which chip manufacturer to go for... next, go to their official site or contact them, you would get the libs for the supported IO's and other communication stuffs.

wrapperm
There's a lot to be said for doing this the other way around.
Hans Passant
@nobugz: sorry but, I couldnot understand your comment... could you please elaborate a little?
wrapperm
@wrapperm: find out what chip is well supported with lots of available libraries first, then make the buying decision.
Hans Passant
@nobugz: you are correct...
wrapperm
+2  A: 

You might also want to take a look at Jean Labrosse's "Embedded Systems Building Blocks" book. It has some straight C libraries for dealing with UARTs, Analog I/O, timers, etc.

Of course, you do still need to wire them up to the actual chip's hardware implementation (as other answers have indicated, you can usually get libs to help with that from the chip vendors), but they can be a convenient wrapper to let you more easily move your higher level software from one device to another. There's no earth-shattering stuff that would be particularly difficult to do on your own, but it's there for the taking, so why not? Even if it's not exactly what you might want, it's a leg up.

Michael Burr
+3  A: 

You're possibly looking for something called a 'board support package' or BSP. For a given operating system it will have a collection of drivers / libraries to help you communicate with the hardware component.

Saying that, some standard hardware interfaces for e.g. 16550 Uart might have drivers that come with the OS.

tonylo
A: 

Ok what about for TI? BSPs are something I'm aware of, but they dont' really exist for software that exists below the O/S level.

2nd, lets say I wanted to wanted software to make the TI MSP430 Microcontroller talk to DAC7565. I realy can't find software that relates those two in any reliable way.

I'm talking about a complete software package, something equivalent to a gem in Ruby, where I could call functions like "OutputVoltage(unsigned int voltage, unsinged int channel)" and be oblivious to the hardware implementation.

@nobugz Yes, I agree, but that is awfully restraining. C should be like Ruby where you can only focus on what you want to do, not having to spend time restricting yourself because of the availability of software...

Joseph DelCioppio
You're putting comments in the box that answers go in. That's not how SO is meant to work.
Craig McQueen
A: 

@Shaihi

I'm not, I am a software engineer with an engineering firm who custom design their own boards. I just can't believe that across the entire world and the entire history of software engineering that I am the first person who needs to interface this microcontroller and this DAC. SO therefore it must exist someplace. Maybe I can't get my hands on it but someone, somewhere has done it before.

I'm a very young engineer, but it just seems like there are hundreds or thousands of guys who end up writing the same software again and again. And on top of that, since there are plenty of software engineers who are terribly good at abstraction and reuse, I'm willing to bet there are plenty of engineers who end up re-writing the same software time and time again because the software they write is way too tightly coupled to that specific application.

Just seems like a giant waste of engineering hours.

Joseph DelCioppio
That's the way closed source code is working (at least the way I know it). You can look the drivers in the Embedded Linux repository and if you have someone using it that has the BSP in the main line, you can contact him to buy the HW from him or just take the implementation. I know, for example, that with Windows CE you end up writing a lot of code from a new. We have internal project that reduce the amount of work, but since it is not our main business we don't sell it. I am not familiar with someone who does.
Shaihi
I guess you posted this question for someone who might know a company that does this, so disregard my comment :)
Shaihi
A: 

Did you check the application notes on the A/D vendor's web site? They very often have C code. The problem with assembly language code is that there are so many different ADC and microprocessor vendors and so many different ways to wire up the chip that they can't provide a general purpose library. Also, a programmer may want to poll the end-of-conversion flag or allow the chip to interrupt when the conversion is complete. It is very application specific. Your best hope is that the vendor has some example code that will serve as a guide for how to use the chip. The good news is that user's manuals for these peripherals are a lot better than they were 20 years ago.

Also, the vendor probably has application engineers who will help you with your design.

Bruce