Analog joystick to PWM output

newby01

New Member
Hi All, I am new to programming PIC's and was wondering if I could get a hand. I need to produce an 8 channel PWM stream output. The inputs are analog joysticks wired as voltage dividers. These give me 4 channels with each also having a trim pot for finer adjustment of channel width.

The remaining 4 channels need to be blanked for the time being to give me total stream length of 20ms.

I am using a 40x1 and a 08m to give me enought analog inputs for the 4 axis and the 4 trim pots.

Using ADC commands and pulsout commands and can't seem to get an out put even vaguely doing what i want :( . Also not sure on how to get 08m output into the 40x1 and then into the output stream. Help please??
 

BeanieBots

Moderator
Your requirements are a bit vague.
Could you please explain in more detail what exactly you mean by "pulse stream"?
update rate, precision, duty, etc. etc.

As for getting the 08M value into the 40X1, there are many methods but the most suitable would depend on what characteristics your pulse stream needs.
 

moxhamj

New Member
What are the 08Ms for?

I'm a bit confused by the problem, but to start, which bit isn't working? The reading the ADC, or the pulsout? Or both, but not sure which?

Try testing each by itself. Use readadc and then debug straight after, and see if you can read the correct analog value.

Then try pulsout on a pin with a fixed value. Are you driving servos or producing a pwmout with a variable voltage? The title of the thread says pwm but in the text it says pulsout. These are different instructions and do different things.
 

BeanieBots

Moderator
Good point Doc. The 40X1 has eight analogue inputs, so what IS the 08M for?
This sounds like it could be an RC Tx encoder ??
 

MPep

Senior Member
Sounds like he wants to do Radio Control, in which the Servo command would be more appropriate.
 
Top