LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-25-2009, 02:18 PM   #1
hevymetal
LQ Newbie
 
Registered: Dec 2009
Location: middle of nowhere, PA, US
Distribution: Linux Mint, Fedora, Ubuntu Server
Posts: 3

Rep: Reputation: 0
Exclamation Serial, Parallel, Autorun, Languages? HELP!


The questions:
-serial or parallel for pc<->microcontroller communication? Cable length 15ft through CAT5E
-suggested programming languages for the computer side? (Linux)
-IS IT ALL NECESSARY?
-how do I have the programs that run on the pc autostart and listen to the com port on boot?

The situation:
My car has no thermal controls. this 2000 ford taurus has a 12 volt motor controlling temp, four 12 volt solenoids controlling vent selection, and a PWM amplifier board to control the blower. I have interfaces for all of these designed, and mostly built. The MCU is an ATMEGA664P 40 pin pdip. so far the most logical thing I can come up with is having the computer (pc) read the analog sensors in my system through the avr, then give orders back to the avr for starting the motor driver/solenoid switchboard, or PWM...

Me: I'm sort of a noob, I can design and assemble a linear circuit, put together a computer, create websites etc. I administer a linux home media/file server and I know the basics, but this is a huge project and its winter now! I would rather build this than pay 1400 for a new system, so please dont suggest that...
 
Old 12-25-2009, 03:50 PM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,902

Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
you could provide more information about how you are going about this. I'm guessing that you want to compile software on a host (Linux??) and load your compiled code onto some kind of embedded board, which houses the ATMEGA664P. The embedded board stands alone at run time and does not run an operating system.

This is all guesswork so please correct me where I have guessed wrong, as this will have the potential to change the answers.

Quote:
Originally Posted by hevymetal View Post
The questions:
-serial or parallel for pc<->microcontroller communication? Cable length 15ft through CAT5E
CAT5E is an ethernet cable. If you are actually using ethernet...well the answer is use ethernet. Possibly you are using this cable to connect interfaces that are not ethernet, in which case use those interfaces.

The problem is that you probably want some kind of driver for the interface at the microcontroller end. What software do you have at the microcontroller end?

Quote:
-suggested programming languages for the computer side? (Linux)
what are you trying to do on the host computer side?
Quote:
-IS IT ALL NECESSARY?
No.


Quote:
My car has no thermal controls.
Having no thermal controls is not helpful, but:

Quote:
this 2000 ford taurus has a 12 volt motor controlling temp,
I doubt it; the motor controls temperature and not a blower or a stepper motor controlling a the heat input?

Quote:
so far the most logical thing I can come up with is having the computer (pc) read the analog sensors in my system through the avr, then give orders back to the avr for starting the motor driver/solenoid switchboard, or PWM...
Sorry, not logical, if I have understood you. You seem to be building a computer into this system when the AVR could do everything that the computer could do for you.

So, what are you going to do when the ignition is switched off. You can't just turn off the power to the Linux computer, if it is a normal desktop type system. You could leave the power on, and flatten the battery. So, what are you going to do?

BTW, 'software' is probably not the right sub-forum for this question and Embedded might be a better choice. If you report the thread to a moderator, they might move it for you.
 
Old 12-25-2009, 04:54 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,903

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
Welcome to LinuxQuestions.
You might need to provide details for the complete project. I agree the computer is not necessary and you could use the microprocessor for human input too.

Serial communication would be the simplest since the microprocessor has built in USARTs and would be a plus for debugging and system status.

Sounds like a fun project.

Last edited by michaelk; 12-25-2009 at 04:58 PM.
 
Old 12-26-2009, 09:39 AM   #4
hevymetal
LQ Newbie
 
Registered: Dec 2009
Location: middle of nowhere, PA, US
Distribution: Linux Mint, Fedora, Ubuntu Server
Posts: 3

Original Poster
Rep: Reputation: 0
This looks more helpful than the avr forum!

Wow, okay, better explanation:
The 12 volt motor for temp, moves a "blend door actuator" which mixes hot and cold air for a desired temperature, the blower that moves the air is an amplifier board, that amplifies a TTL (5 volt) pulse width modulation signal (fake analog) and runs the blower motor at that frequency. The selenoids apply vacuum to valves changing which vents get air. I mentioned CAT5E because its resistance is lower than standard serial cable allowing serial communication for over 150 feet with no buffers or repeats. If using parallel I assume I would need more than one 8 conductor cable from trunk to dash... The computer would have a soft start circuit that turns on the inverter, and switches the power signal on ignition, as well as triggering a shutdown and powering off the inverter once the car is turned off (soft start circuit from mp3car.com forums) The PC is because of my shortcomings - I can't imagine completing this programmer without a system of labels and gotos in the program, and was explicitly warned against doing this in avr C... I'm including a basic overview of the system. Like I said before, I'm not an idiot, but microcontrollers are a new thing to me, and I've gotten this far, and am stuck...
Attached Images
File Type: jpg system.JPG (47.3 KB, 4 views)
 
Old 12-26-2009, 12:04 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,903

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
Not sure why you think you need gotos. I see just a main loop and a bunch of if statements. So basically you would acquire the temps and perform logic to switch vents and fan speed as necessary. Adding switches would be simple. When programing an I/O pin for input the voltage goes high so all you need to do is ground the pin using a push button switch. You will need to add some debounce code because switches are noisy.
 
Old 12-27-2009, 05:35 AM   #6
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,902

Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
To be able to do this, in any rate, to do this so that it is operational during this cold season, demands that you know what you are dealing with and think clearly about what is going on.

firstly let me go into this:
Quote:
Quote:-IS IT ALL NECESSARY?

No.
in more detail; you could make an analogue/switching circuit that achieved a useful level of functionality without using a microcontroller. Probably, if you don't understand this, your understanding will need a fair amount of enhancement before you get the microcontroller version working.


Quote:
Originally Posted by hevymetal View Post
Wow, okay, better explanation:
The 12 volt motor for temp, moves a "blend door actuator" which mixes hot and cold air for a desired temperature
Two (potential) issues:
  • you seemed to be regarding this as a temperature control; its not, its a heat input control (and it has a 'gain' that is massively different when the engine is cold from when it is hot and as gain is one of the two fundamental factors in stability and is the factor in accuracy, this is worth thinking about), and from a control theory point of view, those are about as similar as Windows and a decent computer system
  • second, the motor probably won't be a DC motor, but a stepper motor; do you have any idea of how to recognise the difference and what complication a stepper might cause you?
Quote:
the blower that moves the air is an amplifier board, that amplifies a TTL (5 volt) pulse width modulation signal (fake analog) and runs the blower motor at that frequency.
driving a dc motor with a pwm will control the motor's speed, and that will probably be the approach for most blowers, although there has been some work on using steppers here, too, so it could conceivably also be a stepper. Of course, you need to cope with the inductive spikes in this kind of circuit, but that isn't the end of your problems.


Quote:
I mentioned CAT5E because its resistance is lower than standard serial cable allowing serial communication for over 150 feet with no buffers or repeats.
...if you say so... if you mean RS-232 serial (you could mean all sorts of other serial interface standards) the distance and the baud rate are inversely related for a specific level of interference, so really although you could be right, that would only be meaningful at a specific baud rate.

Quote:
If using parallel I assume I would need more than one 8 conductor cable from trunk to dash...
true

Quote:
The PC is because of my shortcomings
but introduces problems that might not be easy to solve.

All in all, I would say that you would be have been better advised to get your microcontroller board with an embedded OS or other helpful development software.


-
Quote:
I can't imagine completing this programmer without a system of labels and gotos in the program, and was explicitly warned against doing this in avr C...
gotos are a bad sign, certainly, but I'm not convinced that if you can't avoid them in a system with one computer, you'll pull off the trick just because you've got added another computer.


Quote:
I'm including a basic overview of the system. Like I said before, I'm not an idiot, but microcontrollers are a new thing to me, and I've gotten this far, and am stuck...
It is unclear the extent to which you have taken into account the difficulty of designing reliable electronics for use in an automotive environment (and some of that is soft/firmware and an appreciation of the system aspects of what you areb doing and not just circuit design). Without that, you'll only design unreliable electronics...

You can ask specific questions and get specific answers. Nut there is a danger, if you haven't included enough system information, that you'll get a suboptimal outcome.

Quote:
I would rather build this than pay 1400 for a new system, so please dont suggest that...
And a secondhand one would be how much? Don't let me put you off this as a way to learn, but also be prepared to wrap up well this winter...
 
Old 12-27-2009, 12:11 PM   #7
hevymetal
LQ Newbie
 
Registered: Dec 2009
Location: middle of nowhere, PA, US
Distribution: Linux Mint, Fedora, Ubuntu Server
Posts: 3

Original Poster
Rep: Reputation: 0
I realize the option of a simple linear system (actually a bunch of resistors, a few relays, and an AND gate IC is all) Not an option for me... after 10 minutes of operation (thats in winter) the engine is at its peak operating temp under normal conditions and the blend door centered gives 75 degree air. The Blend door motor is a simple 12 volt hobby motor, thats it, and the hbridge is to let me run it bi-directional because the door travels a limited arc. the blower board already in the car is a mosfet audio amplifier! the pwm signal I feed it on pin 3, gets overlaid onto the supply pin of the blower itself and that waveform controls the speed of the blower motor. I meant rs-232 and its cabling restrictions, and how well Cat5 cable is suited to use for rs-232. The shortcomings in programming have stuck with me since the first time I learned to program-- It was z-basic for the z-80 mcu in my ti-83+ calculator, and gotos made the world go around. I have designed (successfully) electronics for a few years now, even fabricating my own circuit boards for them. The only difference in my car, is the power filtering is alot more extensive due to the electrical noise in cars electrical systems being so high. So, I'll narrow down my new questions now:

Using Codeblocks IDE on my KUbuntu system, I am in need of input or suggestions for the program aspect of my system. The circuits are designed, I WILL NOT be using a computer in my trunk, I need help with my firmware... again this is the atmega644P and I am using AVR LibC to write the program. Before any suggestions, wait, I will be uploading a flow diagram of the program and system later that I am using to write the program. I hope this is specific enough...

More than just a fun project for me, do a google search for "Ford EATC" (thats Electronic Automatic Thermal Controls) and the thousands of people who buy new cars or go without controls is astounding, a few people have done an extensive automatic-to-manual retrofit, but if I get this right, a lot of people could use my design! The simplicity of interface and option for aftermarket audio is a huge bonus for other ford owners who have experienced this system failing... Back later with that diagram...
 
  


Reply

Tags
boot, microcontroller, parallel, serial


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
serial v/s parallel port sagitalk Programming 7 02-26-2009 10:33 AM
Q: are pipelines processed in parallel/serial? jamesj629 Linux - General 9 01-19-2008 02:33 AM
serial/parallel loopback testing Serena Linux - Hardware 2 08-30-2007 04:17 AM
Parallel to serial adapter traybore19 Linux - Hardware 3 07-21-2005 10:34 PM
serial/parallel port marco_aq Linux - Networking 1 10-12-2001 02:44 PM


All times are GMT -5. The time now is 01:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration