Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

USB Time Delay Fan Control

Status
Not open for further replies.
Ok I think I understand how all this works now. correct me if I'm wrong. First I write Basic Operating Instructions that will run on the Z8 and control the ADT Chip then I flash it (or however I write to the chip) to the Z8, Then I write Windows Software that will connect to the Z8 throught the USB Interface to set user values for Min/Max temps, alarm temps, etc.
ok, and if i understand this right then even if this circut isnt connected to USB as long as I set defaults into the BOI this device will boot and run all by itself, without user intevention?
 
Oh, By the way.
DirtyLude said:
You really can't give up a USB port for this?
You have a computer? If so, then you should know that you can never have too many USB ports, mine currently has 12, and all but the front 2 are in constant use, and one of the rear 10 has a 4 port hub on it. I figure Hey, if I can add a 4 port hub on, then by using my device you would actually gain 2 ports instead of losing 1.
 
Karaethon said:
Ok I think I understand how all this works now. correct me if I'm wrong. First I write Basic Operating Instructions that will run on the Z8 and control the ADT Chip then I flash it (or however I write to the chip) to the Z8, Then I write Windows Software that will connect to the Z8 throught the USB Interface to set user values for Min/Max temps, alarm temps, etc.
ok, and if i understand this right then even if this circut isnt connected to USB as long as I set defaults into the BOI this device will boot and run all by itself, without user intevention?

There's no need to use a specific micro-controller, almost any would be fine - Dirtydude is probably the only person here though who would suggest the Z8?. Not that there's anything wrong with a Z8, just that it's not one of the most popular ones - the MicroChip PIC is the most popular one (to the extent that PIC has become used as a generic term for micro-controller), and has far more code and examples available to download.

Many PIC's (and possibly Z8?, I wouldn't know) have internal EEPROM data storage, so it can write the settings into non-volatile memory. It can then run independently of any instructions once the PC shuts down, while remembering what it's been told.
 
Ok, in your opinion, what would be a good Chip to use? (good for a beginner at the electronics stage, but well versed in programming languages) and could someone please explain all the options, I know what the words mean but not sure what the different Memory amounts are(obviously the largest is storage) I look at all these specs and i dont know how to compare a chip from manufacturer A to one from manufacturer B.
 
Karaethon said:
Ok, in your opinion, what would be a good Chip to use? (good for a beginner at the electronics stage, but well versed in programming languages) and could someone please explain all the options, I know what the words mean but not sure what the different Memory amounts are(obviously the largest is storage) I look at all these specs and i dont know how to compare a chip from manufacturer A to one from manufacturer B.

Essentially the 'best' micro-controller to use is one you're familiar with!, if you're not familiar with any - then the PIC is probably a good choice?, as it's a RISC chip and simple to learn (the 16F series only have 35 instructions, some of which are only rarely used!).

PIC's don't have much storage space, a micro-controller doesn't really need it! - as for suitable chips, try listing what requirements you need - such as:

Serial port? (to connect to FT232), although this can easily be done in software.

PWM? - if needed to drive the fan, but as already suggested some fans won't like PWM!.

Analogue inputs? - used to read the temperature.

Program wise, a few hundreds bytes should be all that's required?.
 
Nigel Goodwin said:
Serial port? (to connect to FT232), although this can easily be done in software.
Yes I guess since I'm using the FT232 Then serial Communication would be needed.
Nigel Goodwin said:
PWM? - if needed to drive the fan, but as already suggested some fans won't like PWM!.
No, not needed as the ADT7460 Chip will be used for reading the fan speeds and controling them.
Nigel Goodwin said:
Analogue inputs? - used to read the temperature.
Optional, the ADT chip has 3 on board temp inputs, but could use more to monitor other parts (like water pre and post cooling temps to calculate latent heat transfer)
Nigel Goodwin said:
Program wise, a few hundreds bytes should be all that's required?.
Well I have no Idea how much space I'd need here, if figure the more funtionality implimented then of course the more space I'll need, so I figure something in the mid-range would be good.

One thing I think might be some way to control an external device, like say the pump on a water cooling system, so that that could continue circulating after power down too, if such a system were present.
 
You can see some of my arguments for the Encore here:
https://electro-tech-online.com/viewtopic.php?t=11980

Being, apparently the only one who has used both PIC and the Z8Encore in this thread, I can say, the Encore is much easier to deal with, especially if you want to program the chip in C. The only advantage the PIC has is it's wide userbase, which is definitely a big bonus for it. Like Nigel said, though, it doesn't matter which one you go for as long as it does the job, and either of these will do the job.

I don't believe that all the control lines on the FT232 are needed for the connection to the uC. TX, RX should be enough, and maybe CTS/RTS could be used if you want. Otherwise, it looks like it has lines for all the rs-232 controls that nobody ever uses anymore.

As for what chip you would want, I think one of the 28 pin 8k chips would be fine. You don't need alot of memory on the controller for this. If you want to go overboard and use the 64k PLCC chip, that would be fine as well. The XP line is a specialized chip line and is considered seperate from the base Encores, though the programming cable and development environment still work with them.


...and no, I don't have a computer.
 
DirtyLude said:
You can see some of my arguments for the Encore here:
https://electro-tech-online.com/viewtopic.php?t=11980

Being, apparently the only one who has used both PIC and the Z8Encore in this thread, I can say, the Encore is much easier to deal with, especially if you want to program the chip in C.

Personally I consider that one of the minus points - I don't consider you can program a micro-controller effectively in C without at least a working knowledge of assembler - due to the low levels you're working with on a micro-controller.

The only advantage the PIC has is it's wide userbase, which is definitely a big bonus for it. Like Nigel said, though, it doesn't matter which one you go for as long as it does the job, and either of these will do the job.

Like anything else, it's really down to personal preference, but wide userbase, ease of use, low cost of devices, availability of tools and programmers and all advantages of PIC's. But, as you say, the BIG! advantage is the huge numbers of PIC's out there, and the vast experience you can draw on.

I don't believe that all the control lines on the FT232 are needed for the connection to the uC. TX, RX should be enough, and maybe CTS/RTS could be used if you want. Otherwise, it looks like it has lines for all the rs-232 controls that nobody ever uses anymore.

It really depends on what the FT232 does, and what the PC program does, you might need handshaking if the data comes too fast to process - but this shouldn't be a problem for the small amount of data required for this project, nor with the slow speed of an FT232.

As for what chip you would want, I think one of the 28 pin 8k chips would be fine. You don't need alot of memory on the controller for this. If you want to go overboard and use the 64k PLCC chip, that would be fine as well. The XP line is a specialized chip line and is considered seperate from the base Encores, though the programming cable and development environment still work with them.

Perhaps this stems from using a Z8?, or perhaps from using C?, but I was thinking more of an 8 pin PIC, with 1K or 2K of memory, or perhaps an 18 pin one?.

If it's a question of moving up to 28 pin devices, you may as well do it 'properly' and use an 18F series PIC with in-built USB.
 
Nigel Goodwin said:
Personally I consider that one of the minus points - I don't consider you can program a micro-controller effectively in C without at least a working knowledge of assembler - due to the low levels you're working with on a micro-controller.
Well, that's your opinion, but I've done quite well, and completed alot of nice projects using just C here when I see alot of people bogging down here trying to learn PIC assembler and working with crappy slow PIC programmers.

Like anything else, it's really down to personal preference, but wide userbase, ease of use, low cost of devices, availability of tools and programmers and all advantages of PIC's. But, as you say, the BIG! advantage is the huge numbers of PIC's out there, and the vast experience you can draw on.
Usually you are quite logical, but how can you claim ease of use, low cost, availability of tools and programmers on a uC you have never used, or apparently never even looked into?

There is one programmer available for the entire Z8 Encore line and it works with all of them. It's just a cable with a simple control box that programs the chip in circuit 1 wire, and does a 64k chip in less than 6 seconds. It costs $20.00 USD. If you insist on making your own serial programmer, you can make one with a simple rs-232 level shifter chip and a couple diodes. The cable also allows full incircuit debugging and program walk through.

The development environment is free and easily handles anything a hobbyist could ever want from it.

Perhaps this stems from using a Z8?, or perhaps from using C?, but I was thinking more of an 8 pin PIC, with 1K or 2K of memory, or perhaps an 18 pin one?.

If it's a question of moving up to 28 pin devices, you may as well do it 'properly' and use an 18F series PIC with in-built USB.
Perhaps this stems from the functionality that could be put into this project based on what the original poster is now feature creeping, but also it's from the Z8 packages itself. Actually, they have a 20 pin PDIP that I would recommend, now.

A simple piezo buzzer can be thrown on as an external temp warning, a relay for water pump control, led status lights... When we are talking about a uC that costs $2.00 I don't see the point in trying to be minimilastic.
 
DirtyLude said:
Nigel Goodwin said:
Personally I consider that one of the minus points - I don't consider you can program a micro-controller effectively in C without at least a working knowledge of assembler - due to the low levels you're working with on a micro-controller.
Well, that's your opinion, but I've done quite well, and completed alot of nice projects using just C here when I see alot of people bogging down here trying to learn PIC assembler and working with crappy slow PIC programmers.

Yes, it's my opinion, and that of a fair few other people - it becomes obvious when you look at how some things are badly programmed using C (or BASIC, or anything else high level). I've seen numerous examples where multiple lines of C are used to do what one instruction in assembler could do, simply because the writer didn't have any assembler knowledge at all - not that I'm saying that he should use the single assembler instruction, but knowing about it enables you to find a far more elegant solution in C.

Personally I've never found PIC programmers slow, I rarely take more than 2 or 3 seconds to program a PIC. The MicroChip PICStart+ is particularly slow though, as it insists on programming every byte every time.

When we are talking about a uC that costs $2.00 I don't see the point in trying to be minimilastic.

More a question of size?, why use a 28 pin when an 8 pin would do the job?

I've just checked the price of Z8's?, they certainly appear to have plummeted since I last looked, where I checked they are now cheaper than PIC's!.
 
Calm down guys, lol. I am well versed in both C and Assembler, so thats not an issue for me. (although prolly a bit rust on both as I havent used them since DOS was the Main OS for IBM Clones)
More a question of size?, why use a 28 pin when an 8 pin would do the job?
One question, does the 8 pin version have more mulit/use lines than the 28 pin? i find that extremely confusing when im reading the datasheets, and they list a pin as having 2/3/4 different functions. If I can get a chip with 1 pin per function i dont mind the excess in size. i know these multi function pins are understood by you, but for me as a beginner they worry me about am I hooking them up right.
 
Well, you can go crazy and get the 80 pin QFP package, if you can work with SMD, or the 64pin PLCC package if you want, but that would be way overkill. The pins usually will not overlap functionality that you need. Even then, on the larger chips you still have to initialize each pin you are using with a variety of parameters, like whether you are using it for GPIO, or it's hardware block, like UART, I2C, SPI, whatever...whether it is currently being used for input, or output, .whether it will sink or source power...

I have a few 8pin chips, but I don't find them that useful, and I only bought them for their 'oh wow' factor. The only thing I ever made with them is a tiny IR transmitter. I usually buy the SMD 20 or 28 pin 4k/8k chips cuz they cover the functionality of the bulk of my projects and I don't have to stock a bunch of different chips. Also, with a discount for buying a bunch of them at once from Mouser, it works out well.

There's a limitation to the chips over 8k that they can only use resonators up to 10Mhz, otherwise you have to use a proper crystal timer. 8k chips and lower can use 20Mhz resonators. For something with important communication timing, you should probably use a crystal anyway.

Just because you know assembler on some other platform, doesn't mean you'll take to PIC or z8E assembler well. It'll be easier, but it's no given. I know 6502 and 80x86 assembler and had a very confusing time with PICs and their crazy paging schemes. z8E I know well enough now to make some basic functions, but that's about it. The hardware archetecture is harvard as well, not the oxford archetecture of your regular computer.

I'm thinking you should just get started with whatever uC you plan to use and then move on from there after you get comfortable with it. It's obvious from your questions, you really should get familiar with the uC first. I've never worked with the PIC 18series that has built in USB, Nigel might be right and you might want to try that. I was under the impression that it was fairly complex, though. Not as simple as the FT232.
 
Nigel Goodwin said:
Yes, it's my opinion, and that of a fair few other people - it becomes obvious when you look at how some things are badly programmed using C (or BASIC, or anything else high level). I've seen numerous examples where multiple lines of C are used to do what one instruction in assembler could do, simply because the writer didn't have any assembler knowledge at all - not that I'm saying that he should use the single assembler instruction, but knowing about it enables you to find a far more elegant solution in C.
Well, then you're talking about optimal programming and not 'effective' programming which is your first quote. Whatever gets the job done is effective programming. I've learned the basics of z8e assembler, and I can say it helps in optimizing code, or even debugging, is it necessary to be an effective hobbyist, no, I don't think so.
 
To bring this back from the dead. I finally ordered some FT232R chips and after a few weeks of cross border shipping Mouser got them to my door, so I put this thing together.

**broken link removed**

So, it controls 3 fans with temperature feedback, and I can get fan rpm and temp reading from it over the USB, and set whatever speed parameters I like real time. I'm still working on completing the firmware. Right now it just controls and reports the basics. I have little to no windows programming skills, so everything on the PC side is over Hyperterminal using the virtual com port drivers from FTDI. It has some status LED's on it that just look pretty and I will probably never see, and it has a buzzer on it that can be used for overtemp warning, or fan failure warning.

This project is pretty simple, and the uC is only a middleman, taking commands from the PC and translating them for the fan controller chip over I2C. Just about any of the standard hobby PIC chips will do this easily.

Mini review on the FTDI FT232R serial->USB chip. This is a really nice chip. Very easy to work with. If anything it has too much additional functionality that I don't need or plan to ever use. I was surprised that there was no fiddling with it at all. I installed the virtual com port driver and was able to talk to my uC right away. It was that simple. The only negative I have with it, is that it seems like you can't have the regular DLL drivers and the com port drivers installed at the same time. Also, it seems like it wants to reinstall drivers everytime I plug it in. It has a clock signal output. I tried to use the clock signal to run my uC, but it just wasn't working, so I fell back on a regular ceramic oscilator.

It won't run the fans with the PC off, cuz, that's not a requirement of mine, and I still don't understand why you would want to, but if you had a constant 12v source it could certainly be modifed to do it.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top