Flying-Hobby Lucky Draw @ FACEBOOK Blog Facebook @ FLYING-HOBBY
Reply
Thread Tools
Old May 13, 2013, 02:44 AM
Registered User
Joined May 2013
10 Posts
rc swtich 12f675, need help changing program

Hi everyone, my name is John

I'm having difficulties about to change the program for 12f675
I found on the internet project RC switch use 12f675 here:

http://myweb.tiscali.co.uk/kendo/rc_...tml/start.html

I use TX 9 channel ,In this project 12f675 work only a single channel
Now, I want to add a channel signal, I want to RC switch 2 chanel separate
  Can someone help me change the program ?

thank a lot
happy rc is offline Find More Posts by happy rc
Reply With Quote
Sign up now
to remove ads between posts
Old May 13, 2013, 08:23 AM
Registered User
Joined May 2013
10 Posts
help me please
happy rc is offline Find More Posts by happy rc
Reply With Quote
Old May 13, 2013, 07:01 PM
Registered User
Joined May 2013
10 Posts
use 12f675 or atiny13 , i can buy it
happy rc is offline Find More Posts by happy rc
Reply With Quote
Old May 13, 2013, 07:54 PM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
4,760 Posts
Quote:
Originally Posted by happy rc View Post
Now, I want to add a channel signal, I want to RC switch 2 chanel separate
Just build 2 switches.

To do 2 inputs and outputs on a single 12F675 would require extensive modifications to the program, and you need to duplicate all the other circuitry anyway. Much easier to just use 2 chips.
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old May 13, 2013, 08:23 PM
Registered User
Joined May 2013
10 Posts
Quote:
Originally Posted by Bruce Abbott View Post
Just build 2 switches.

To do 2 inputs and outputs on a single 12F675 would require extensive modifications to the program, and you need to duplicate all the other circuitry anyway. Much easier to just use 2 chips.
thanks for the answer

I see 12f675 also some unused pins

So I think the program change is better than using two 12f675. (sorry for my greedy)

changing program for 12f675 seem complexity ? how to 12f675 can operate each channel separately ?
happy rc is offline Find More Posts by happy rc
Reply With Quote
Old May 14, 2013, 12:35 AM
Stuart
UK, Cardiff
Joined Dec 2008
2,157 Posts
Quote:
Originally Posted by happy rc View Post
I see 12f675 also some unused pins

So I think the program change is better than using two 12f675. (sorry for my greedy)

changing program for 12f675 seem complexity ? how to 12f675 can operate each channel separately ?
Unused pins does not mean they are available for use for what you think they can be used for, have you even looked at the 12F675 data sheet ?

Maybe someone does have the time to write the program for you to do what you want, especially if the pay rate is reasonable, but as Bruce suggests the changes do not look straightforward.

Use two 12F675s.
srnet is offline Find More Posts by srnet
Reply With Quote
Old May 14, 2013, 12:38 AM
Stuart
UK, Cardiff
Joined Dec 2008
2,157 Posts
Quote:
Originally Posted by Bruce Abbott View Post
Just build 2 switches.

Much easier to just use 2 chips.
Absolutly, the cost of a $2 chip versus a pile of programming and testing, no contest.
srnet is offline Find More Posts by srnet
Reply With Quote
Old May 14, 2013, 02:08 AM
Registered User
Joined May 2013
10 Posts
Quote:
Originally Posted by srnet View Post
Unused pins does not mean they are available for use for what you think they can be used for, have you even looked at the 12F675 data sheet ?

Maybe someone does have the time to write the program for you to do what you want, especially if the pay rate is reasonable, but as Bruce suggests the changes do not look straightforward.

Use two 12F675s.
hic hic , two chanel for two 12f675 and three chanel for three 12f675 and n chanel for n 12f675 ?

seems it is not optimal, but have to accept
happy rc is offline Find More Posts by happy rc
Reply With Quote
Old May 14, 2013, 03:37 AM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
4,760 Posts
Quote:
Originally Posted by happy rc View Post
hic hic , two chanel for two 12f675 and three chanel for three 12f675 and n chanel for n 12f675 ?

seems it is not optimal, but have to accept
Theoretically you could squeeze a maximum of 3 switches into one 12F675, so you could save 2 chips. However you still need 3 cables, 3 opto-couplers etc. Using one chip per channel allows you to have a simpler pcb layout and a circuit which is easier to build. Alternatively you could put 3 PICs on one pcb and call it a 'triple-core' processor.

But if you insist on trying to wring the most out of that 8 pin PIC, here's the gist of what you need to change in the program:-

1. Assign an input pin for each servo channel (eg. GP5, GP4, and GP3) and an output pin for each switch (GP0, GP1, GP2).

2. Duplicate the pulse measurement routine for each channel. Store the results in 3 separate variables.

3. Count the number of consecutive on or off pulses for each channel separately, and turn the associated switch on/off as required.

When measuring the second and third channels there an added complication - if the pulse is high, do not wait for it to go low first, but start timing immediately. The reason for doing this is that most receivers send out channel pulses consecutively with no gap in between.

Depending on which order the channels are received, you may miss every second set of pulses (because the next 'first' channel pulse started while you were processing the switch states). This is not fatal, but it means the switches will take a little longer to react. If this is a problem then just swap the inputs around until the channels are measured in the same order as they are received.

Some receivers output multiple channels at the same time. For that case you need to measure the timing of each pulse simultaneously, and the software starts to get complicated!
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old May 14, 2013, 08:25 AM
Registered User
Joined May 2013
10 Posts
Quote:
Originally Posted by Bruce Abbott View Post

But if you insist on trying to wring the most out of that 8 pin PIC, here's the gist of what you need to change in the program:-

1. Assign an input pin for each servo channel (eg. GP5, GP4, and GP3) and an output pin for each switch (GP0, GP1, GP2).

2. Duplicate the pulse measurement routine for each channel. Store the results in 3 separate variables.

3. Count the number of consecutive on or off pulses for each channel separately, and turn the associated switch on/off as required.

When measuring the second and third channels there an added complication - if the pulse is high, do not wait for it to go low first, but start timing immediately. The reason for doing this is that most receivers send out channel pulses consecutively with no gap in between.

Depending on which order the channels are received, you may miss every second set of pulses (because the next 'first' channel pulse started while you were processing the switch states). This is not fatal, but it means the switches will take a little longer to react. If this is a problem then just swap the inputs around until the channels are measured in the same order as they are received.

Some receivers output multiple channels at the same time. For that case you need to measure the timing of each pulse simultaneously, and the software starts to get complicated!
I can not, it's beyond my understanding

I'm sad because I could not do what I want , have accepted add 12f675 for each chanel
My application only to on / off LED. i think it will be a big size motherboard if using 10 separate channels
happy rc is offline Find More Posts by happy rc
Reply With Quote
Old May 14, 2013, 09:23 AM
Dave the Rave
dmccormick001's Avatar
Joined Jun 2007
781 Posts
Quote:
Originally Posted by happy rc View Post
I can not, it's beyond my understanding
This is the gist of the problem, you don't understand enough about programming a PIC for someone to be able to help you. The only thing anyone could do it to just write the entire program for you, debug it, and draw you a new schematic for the circuit. That's more than anyone is going to be willing or able to do, and is an unreasonable request.
dmccormick001 is offline Find More Posts by dmccormick001
Reply With Quote
Old May 14, 2013, 09:58 AM
Registered User
Joined May 2013
10 Posts
Quote:
Originally Posted by dmccormick001 View Post
This is the gist of the problem, you don't understand enough about programming a PIC for someone to be able to help you. The only thing anyone could do it to just write the entire program for you, debug it, and draw you a new schematic for the circuit. That's more than anyone is going to be willing or able to do, and is an unreasonable request.

thanks for your answer

I found this article in need of help, it is your

http://www.rcgroups.com/forums/showt...1824599&page=2

I saw Bruce has helped you write the program, of course you will absorb faster than me because I do not know how to write program C or asm

Why did you get the help, now I need help but you said " it is an unreasonable request" ?
happy rc is offline Find More Posts by happy rc
Reply With Quote
Old May 14, 2013, 11:53 AM
Stuart
UK, Cardiff
Joined Dec 2008
2,157 Posts
Quote:
Originally Posted by happy rc View Post
Why did you get the help, now I need help but you said " it is an unreasonable request" ?
There is a difference between asking for help, and asking in your first post on RC Groups for someone else to do a pile of work for you, and for free.
srnet is offline Find More Posts by srnet
Reply With Quote
Old May 14, 2013, 01:45 PM
Stuart
UK, Cardiff
Joined Dec 2008
2,157 Posts
Quote:
Originally Posted by happy rc View Post
My application only to on / off LED. i think it will be a big size motherboard if using 10 separate channels
If your application was 'only' to turn LEDs, on/off, you might have got a different answer if you had provided that information and that you knew little (nothing ?) about PIC processors in your first post on RC Groups.
srnet is offline Find More Posts by srnet
Reply With Quote
Old May 14, 2013, 05:51 PM
Registered User
Joined May 2013
10 Posts
Quote:
Originally Posted by srnet View Post
There is a difference between asking for help, and asking in your first post on RC Groups for someone else to do a pile of work for you, and for free.

thank for answer

in addition to this application, I do not add any other project. Having to start the microcontroller program is too difficult for me.
because I'm old, I was 68 years old
happy rc is offline Find More Posts by happy rc
Reply With Quote
Reply

Castle Creations      DRIVE / FLY / SUPPORT  

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question Need Help Programming EZRUN-150-PRO Chatenever Electric Power Cars 6 May 19, 2013 11:31 PM
Discussion help write programs for 12f675 control signal Esc sensored Jame David DIY Electronics 5 Apr 13, 2013 07:52 AM
Discussion Need help finding an RC switch for RC signal. milo12 Radios 3 Apr 11, 2013 03:45 PM
Discussion Need help programming throttle on switch. Futaba 10C TheTick Electric Sailplanes 1 Apr 04, 2013 03:57 PM
Discussion Need help programming Hacker X-7 ESC Cougar347 Power Systems 3 Jan 08, 2013 08:19 PM