Shop our Airplanes Products Drone Products Sales
Thread Tools
Sep 28, 2006, 08:14 PM
Registered User
xtal's Avatar
Mini-HowTo

12f683 5 Channel Encoder.....


Here is a 5 channel Encoder.....using a 12F683
channels 0,1,2,3 are analog...
channel 4 is switch controlled 1ms or 2 ms

Here are the Project files for use with MIKROBASIC [demo]

maybe someone can enhance by using 16f88 or other and add
mixing, crystal stability , whatever......

use 5k ohm pots for analog channels...
Sign up now
to remove ads between posts
Sep 29, 2006, 03:20 AM
"MAYONNAISE"
Acetronics's Avatar
Hi, Xtal

Nice basis to realise accessoiries like liner pushers ( for a 4m twin jetcat 120 Airbus A320 model ...) or other ground vehicles.

Besides that ... may I get you advice about the MikroBasic compiler ??? as an info ... the dSpic Basic compiler is released ... and a demo version available !!!

Alain
Sep 29, 2006, 03:51 AM
Registered User
xtal's Avatar
Hi Ace

The basic compiler is ok, I had some issues with the ver 4+ compiler
ie you had to be carefull with the math[I believe ther were some issues there]
and debugger issues.....
, I don't know about ver 5 yet....

The debugger sucks....it can't handle interrupts.......so if you use interrupts
get that code working first....

I cannot justify getting a high priced [by my standards] license for a procuct
that I will use about 4 to 5 times a year.....when MPASM is free and has
a very good debugger.macros are easy to make. Once I get started I can use it eaiser than basic, mainly because it's easier to debug....

another note.. I was going to try PicBasic but decided it was to archaic...
Sep 29, 2006, 10:06 AM
Registered User
I assume the pots are 5K with 5 Volts Vcc on one end and GND at the other?

Also - the analog is switched between 5v and GND?


Thanks,

Pat Bunn
Sep 29, 2006, 10:27 AM
Registered User
xtal's Avatar
I assume the pots are 5K with 5 Volts Vcc on one end and GND at the other?

Also - the analog is switched between 5v and GND?
-------------------------------------------------------------------

yes thre pots are connected +5 and gnd,,,,for mechanical trim I will try
to use a 500 ohm in series with each control pot,,this hasn't been tested
and I see no reason why it won't work.....

The switch is connected to +5 and ground ....with a 3.9k resistor going to the pin.....

note. currently channel 4 see's 2 states...however the code can
be changed to detect 3 states.....0, +5, and open....
which would allow 1ms, 1.5ms and 2ms setting
Sep 29, 2006, 01:46 PM
Registered User
Thanks,


I will try it. I am looking for something simple to put into some old vintage transmitters. I use the Futaba 50 Mhz module for RF.


Pat Bunn
Sep 29, 2006, 05:49 PM
Registered User
xtal's Avatar
Forget abut the 3 state.......I forgot that GPIO.3 is input only

The 300US setting may be on the low side....I just had 1 chip programmed
with 300 and osctune = 0 and I did not check for 300 with scope
The osc was too fast
It would not work until I set OSCTUNE = 0x1D


Also you may want to use a larger sync time....
the present frame is about 2*5+2.8 = approx 13 ms.....
I just realize that abbot decoder is skipping a frame while outputting
channel's .....

Just change sync from 3000 to 10000 and now abbot isn't skipping
any frames.....

I guess ver 2 needs to add all desiredtimes and subtract from frame time
to get the sync time ,,,,,but that will be later......
Last edited by xtal; Sep 29, 2006 at 06:29 PM.
Sep 29, 2006, 08:12 PM
Registered User
xtal's Avatar

5-chanel Encoder


Added Fixed Frame Approx 20 Ms AND change 1 value for +/- pulse out
Dec 10, 2007, 11:44 AM
Registered User
xtal's Avatar
Heres a quick schematic,,,, note use a 12f683
pots a 5k ohm ....
Dec 19, 2007, 04:01 AM
Registered User
xtal's Avatar
ALERT! ALERT!

There should be a resistor ( 1k) between pic pin 4 and switch to
keep from possibly blowing pin 4 on pic...

This is the 3-state input and is set hi and low to determine state...

this doesn apply to 12f683!
Last edited by xtal; Jan 06, 2008 at 06:41 PM.
Jan 08, 2008, 04:18 AM
Registered User
xtal's Avatar
Here's simple schematic
Jan 02, 2010, 03:35 AM
Registered User
Is it possible to modify this code for use with 100k pots? I'm wanting to use a pc joystick with a gameport connector.

http://en.wikipedia.org/wiki/Game_port

Thanks
Jan 10, 2010, 12:30 PM
Registered User
xtal's Avatar
the pots are just voltage divider,,, code mods would probably not be needed
unless chip impedance affects the pot resistance too much, but doubt it,,,note though higher resistance are mor sensitive to electrical noise...
Jan 13, 2010, 05:53 AM
Registered User
Quote:
Originally Posted by xtal View Post
the pots are just voltage divider,,, code mods would probably not be needed
unless chip impedance affects the pot resistance too much, but doubt it,,,note though higher resistance are mor sensitive to electrical noise...
Does that mean the 5K pots can be replaced with 10K pots, without any code mods ??
Jan 19, 2010, 04:51 AM
Registered User
Unless you modify the joystick controller you will not be able to use it with this chip.
the reason is that as someone has pointed out in this design the pots are just voltage dividers. But the resistance at the centre of the stick travel has to be in the centre (to get 2.5V at centre)
Joystick controllers only use 2 wires (you would have to add the third), but more importantly the joystick controllers do not have the pot at centre when the stick is at centre.
So you would have to do some mechanics to centre the pots.


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Help! need help 5-channel decoder 12f683 xtal DIY Electronics 7 Oct 15, 2006 06:10 AM
Small, light 5 channel sport plane - Switchback Sport RG BEC Sport Planes 13 Mar 13, 2002 01:59 PM
WTB 5+Channel Transmitter Hitec Randy G Aircraft - Electric - Airplanes (FS/W) 0 Dec 14, 2001 02:20 PM
5 channel Tx and 4 channel Receiver Skysaurus Beginner Training Area (Aircraft-Electric) 5 Nov 29, 2001 09:08 AM
Best 4 - 5 channel transmitter? dbhenry1234 Electric Plane Talk 24 May 13, 2001 03:55 PM