16 Channel ADC + 16 RC Servo Motor + 1 RS232 + PIC microcontroller

Hello Everyone,

I am a beginner hobbiest in embedded systems. I want to build a system which will have i. 16 channel, 16 bits ADC with SPI interface (it could be two 8 channel ADC) ii. 16 RC Servo motor driver (capablity of generating 1-2ms RC servo pulses with 10 bits resolution, for 16 RC servo motors) iii. 1 RS232 port to communicate with a PC iv. PIC microcontroller (all the above devices will be operated by a PIC Microcontroller)

PIC will run the following algorithm;

A. Initialise devices B. Create a timer interrupt service routine which will read the 16 analog signals via ADC at 500 times per second and calculate a running averagefor each channel C. Read ADC channels (16 channel, 16 bits resolution) and calculate running averages for each channel D. Transmit the calculated averages (16 channel, 16 bits resolution) to a PC via RS232 channel E. Every 20ms. the RC servo motor positions (10 bits resolution) data will be updated with the calculated averages F. Goto step C

I will borrow an ICD-2 and MPLAB for the project and I will use Microchip's PIC C compiler.

Can someone out there with PIC and MPLAB experience help me on PIC-C code segments for I. How to create an interrrupt service routine which will be called

500 times per second? II. How to read data from SPI devices? III. How to generate 16 RC servo pulses with 10 bit resolution (this seems to be the most difficult)? IV. How to send data via RS232?

I do appreciate if you can share your PIC C code snips.

Thank you

Roberto Hawkowski

Reply to
Roberto
Loading thread data ...

Thanks for being upfront and honest. You might get some good results.

Now, I read your description. But, I think it'd be better if you tell us what you're trying to build. What's the purpose?

Why must it have 16 bit AD converters? Do you know how very unlikely it is that you will get that much resolution?

If you REALLY need 16 bits, you will need very precise analog circuitry...

Again, where does 10 bits come from? What's it actually doing? Does it need to be one CPU, or can you have more than one?

Why does it have to be a PIC? :)

500 times per second * 16 channels * 2 bytes / channel = 16000 bytes/second. Now, RS232 can do that, but that's a pretty heavy load on your PIC.... (I'm assuming you are transmitting them as binary values. If you convert the numbers to ASCII, you could be sending much more data)

How much time do you have? This is a non-trivial task. Find someone near you with some experience in this field.

Give us some more detail on your project and you'll probably get more feedback.

Hint: If you've never used microcontrollers before, start with a blinking LED....

ttyl,

--buddy

Reply to
Buddy Smith

Hello,

I assumed that data over RS323 to be serial asynchronous format which typically includes 1 start bit and 1 stop bit (no parity). Therefore every 8 bit data (1 byte) are represented by 10 bits on the wire. At 16000 bytes/second, the wire rate would be 16000 * 10 = 160000 bits per second. This is faster than typical RS323 line rate of 115200.

Regards,

-Pandit

Reply to
ppanbura

Have you seen this?

formatting link
Might go some way to sorting you problem. A storming good chip I think! and you can use more of the serial channels to get your data out.

Mark

snipped-for-privacy@yahoo.com wrote:

Reply to
markwod

Hi Mark,

THANK YOU for the URL. Do you know if there is a small, low-cost developmet board for it?

Roberto

formatting link

Reply to
<Roberto Hawkowski>

Roberto,

Have a look here, not used these ones so don't know what they're like, but look promising.

formatting link
Mark

RobertoHawkowski wrote:

formatting link
>

Reply to
markwod

'SSC'

serial to 16 servo's with windows control software. this is one implementation of a common thing, pretty sure they all use the same poto.

formatting link

Roberto wrote:

Reply to
rue_mohr

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.