PWM on a W83697HF
Quoting Uwe Andersen:
Quoted 5 lines
do you know how to work with the fan control capability (PWM) of a Winbond W83697HF?
I tried various values in the bank0-registers0x00,0x01,0x02,0x03,0x04with various fans(do PWM need special fans?) but the fan rotation never changed.
PWM doesn't need special fans AFAIK (unlike fan speed reporting).
The W83697HF has two PWM channels (registers 0x01 and 0x03) which are handled by our drivers (w83781d and w83627hf). You should not have to play with registers directly, simply use the the pwm1 and pwm2 files exported through procfs (2.4 kernels) or sysfs (2.6 kernels). The value to write to/read from the file is between 0 and 255 (these are the values of the registers, unchanged).
For gory details, see the W83697HF datasheet, but it should not be needed (unless you suspect there is some bug in our drivers).
You may want to take a look at the tools under prog/pwm and doc/fancontrol.txt in our package.
Note that for PWM to work, your motherboard manufacturer must have wired the chip and fans correctly. If you cannot get it to work, this may simply mean that this wasn't done. Which motherboard is it after all?
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
[Iiiirk, I misspelled Uwe's address, resending... Sorry for the noise.]
Quoting Uwe Andersen:
Quoted 5 lines
do you know how to work with the fan control capability (PWM) of a Winbond W83697HF?
I tried various values in the bank0-registers0x00,0x01,0x02,0x03,0x04with various fans(do PWM need special fans?) but the fan rotation never changed.
PWM doesn't need special fans AFAIK (unlike fan speed reporting).
The W83697HF has two PWM channels (registers 0x01 and 0x03) which are handled by our drivers (w83781d and w83627hf). You should not have to play with registers directly, simply use the the pwm1 and pwm2 files exported through procfs (2.4 kernels) or sysfs (2.6 kernels). The value to write to/read from the file is between 0 and 255 (these are the values of the registers, unchanged).
For gory details, see the W83697HF datasheet, but it should not be needed (unless you suspect there is some bug in our drivers).
You may want to take a look at the tools under prog/pwm and doc/fancontrol.txt in our package.
Note that for PWM to work, your motherboard manufacturer must have wired
the chip and fans correctly. If you cannot get it to work, this may simply mean that this wasn't done. Which motherboard is it after all?
--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
Quoting Uwe Andersen <[email protected]>:
Quoted 14 lines
I should have be more concrete:
I'm not using
lm_sensors...
I'm working on a real time OS called RTOS-32 and doing the hardware monitoring software on my own.
The last thing missing was PWM and I read thatlm_sensorsis using that feature on the W83697HF.
So I thought of an answer like "Did you enabled PWM in register xy with bit n?"
I have written several values into register0x01and register0x03but the fan speed didn't change.
If there is nothing else to do it looks like that my motherboard (Epox 8KMM3I) is the problem.
Quoted 1 line
Sorry for being so unprecise.
No problem. We don't do anything but read/write registers 0x01 and 0x03 in our drivers, and this is supposed to work, so there's nothing more I can tell you, sorry. There is no bit that is supposed to be set to enable it AFAIK.
Maybe you could contact Epox and ask them if PWM is supposed to be supported on this motherboard?
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoting Uwe Andersen <[email protected]>:
Quoted 2 lines
In the meantime I have an answer from Epox: "We didn't know if the mainboard has a fan control or not."
What I would have expected.
Quoted 2 lines
Seems to be that I contacted a person who might be better for answering questions like "My battery is low. What should I do?"
Unfortunately, experience shows that you hardly get any valuable information from hardware (or software) manufacturer's support service. I sometimes wonder why they pretend having such a service at all.
Quoted 3 lines
Thank you for the time you spent with my problem!
It was nice to have somebody to talk with who is (or has been) working on the same stuff!
No problem, and sorry for the number of broken info again.
BTW, why is it that you cannot use lm_sensors? It doesn't seem to be that big. The whole i2c stack shouldn't exceed 64k. Or maybe 64k *is* big for your embedded system?
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoting Uwe Andersen <[email protected]>:
Quoted 5 lines
More or less historical reasons.
I started five years ago with a W83781D and just integrated it with no probs.
As a Delphi unit. On a OS that's mor or less WinAPI compatible. So it made sense to integrate the following chip in the same manner.
Quoted 8 lines
And so on.
Now I have a collection of chipset drivers that are all based on Pascal code.
When I want to integratelm_sensorsI have to solve some problems:
a) Throw away running code ..*sigh*..
b) Makelm_sensorscompatible (e.g. the "out" command has its parameters "address" and "value" just the other way round.)
c) I have to make all the linux header files included compatible
Mhmmm, for which project is this?
IANAL, but if you use our code as a base, and even if in the end the code differs because it's not the same language, I think you must release your project as GPL, or you are infringing the GPL.
Thanks.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoting Uwe Andersen <[email protected]>:
Quoted 4 lines
I didn't use your code as a base.
(...)
If you like I can send you my source so that you can convince yourself that I don't sponge on your code.
This won't be necessary. I just misread your previous mail, sorry for the trouble:
Quoted 5 lines
When I want to integrate
lm_sensorsI have to solve some problems:
a) Throw away running code ..*sigh*..
b) Makelm_sensorscompatible (e.g. the "out" command has its parameters "address" and "value" just the other way round.)
c) I have to make all the linux header files included compatible
I guess this should have read "IF I WOULD want to", not "When I want". I thought you described what you did, while you were explaining why you precisely don't want to... Whatever, I read it wrong. Sorry again.
Quoted 1 line
BTW, what means "IANAL"?
"I'm not a lawyer"
http://www.catb.org/~esr/jargon/html/I/IANAL.html
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoting myself :
Quoted 4 lines
No problem. We don't do anything but read/write registers
0x01and0x03in our drivers, and this is supposed to work, so there's nothing more I can tell you, sorry. There is no bit that is supposed to be set to enable it AFAIK.
I'm plain wrong here. 0x01 and 0x03 are for the W83627HF, *not* the W83697HF. Try registers 0x5A and 0x5B instead (with bank=0, important). It could work :)
Sorry for the bad information.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 5 lines
But not your information is bad but the Winbond documentation itself is bad! On page 27 (Winbond W83697HF, Rel.Date: 04/2003, Rev. 1.2) you will find:"The duty cycle of PWM can be programmed by 8-bit registers which are defined in the Bank0 CR5A and CR5B" On page 56 you can read:
"FAN 1 Duty Cycle Select Register-- 01h(Bank0)"
Correct, the datasheet is ambiguous. Quite usual from Winbond anyway. They cut'n'paste most datasheets from each other and often forget to change what needs to be.
Quoted 1 line
I contacted Winbond already to ask which information is right.
Let us know if you have an answer, although you shouldn't hope too much.
Quoted 10 lines
It is fair to assume that the register
0x01and0x03are the right ones because the values of the registers0x01-0x04after power on are identical to the defaults printed in the datasheet. Are you really sure that you are workink with0x5Aand0x5Bon a W83697HF because in yourw83627hf.hI found:#define
W83697HF_REG_PWMCLK10x00
#defineW83627THF_REG_PWM10x01/* 697HF too */
#defineW83697HF_REG_PWMCLK20x02
#defineW83627THF_REG_PWM20x03/* 697HF too */
You're correct once again. I clearly need some rest or something. I can't pretend our code actually works, I just thought that we would have had complaints if it didn't. To make it clear, I don't own such a chip myself, or I would have tried.
The bad thing here is that this doesn't leave much hope that you'll be able to get PWM to work on your system. All I can think of is that you need register 0x04 to be correctly configured for it to work (0x00, which is the default value, is what you want according to the datasheet). If you already have tried that (and I guess you did) and it didn't help, there's nothing else I can think of, sorry.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/