fan controller

Discussion of the PSoC Creator Integrated Development Environment for PSoC3 & PSoC5 devices.

Moderator: ericb

Re: fan controller

Postby bobmarlowe » Thu Feb 07, 2013 3:15 am

Look into Danas second link under "PWM" there is all the information you need.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby danadak » Thu Feb 07, 2013 3:53 am

In my last post, 2'ond link -

3.3 Fan Speed Response to PWM Control Input Signal
The PWM input shall be delivered to the fan through the control signal on Pin 4 (see Section 2.4).
Fan speed response to this signal shall be a continuous and monotonic function of the duty cycle
of the signal, from 100% to the minimum specified RPM. The fan RPM (as a percentage of
maximum RPM) should match the PWM duty cycle within ±10%. If no control signal is present
the fan shall operate at maximum RPM. See Figure 2.


Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: fan controller

Postby shofiaram » Wed Feb 13, 2013 9:13 pm

hai Bob,
now i am trying to control the fan using temperature sensor.i have choosen DS18S20 digital temperature sensor.It is a 1-wire interface.PSOC1 is having 1-wire user module.so we can configure that module to interface with PSOC.How can we do it with psoc5
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Thu Feb 14, 2013 2:59 am

That is not an easy thing to do, have a look at this thread and how that guy struggled. Would be easier /though complicated enough) to use an I2C-Sensor instead.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby danadak » Thu Feb 14, 2013 4:54 am

You might consider porting the module code from -

http://www.cypress.com/?rID=2793

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: fan controller

Postby Dagodevas » Thu Feb 14, 2013 8:03 am

I've been using the DS18B20 temp sensors for years with both the PSoC1 and, more recently, the PSoC3. First, I used a purely software interface to control the interface (bit-banging). I finally ended up making my own hardware interface component with verilog. The software interface can work, but you have to make sure that no interrupts are going to trigger and mess up you timing. You can basically use the interface C code that Maxim provides on their website.
User avatar
Dagodevas
Cheese Cube
Cheese Cube
 
Posts: 54
Joined: Fri Jul 18, 2008 11:47 am
Location: Peyton, CO

Re: fan controller

Postby shofiaram » Thu Feb 28, 2013 2:33 am

Hai Bob,
Please help me.i tried a lot with capsense and pwm programming.I want to modify the progam of capsense button and slider which i have attached below.modification i want to do is

1. while varying the slider position i need to vary the duty cycle and it should be viewed on lcd
2. eventhough when i remove the finger from the slider, lcd should display the corresponding duty cycle.



Regards
Shofia
Attachments
CapSense_CSD_Design01.cywrk.Archive01.zip
(409.55 KiB) Downloaded 121 times
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Thu Feb 28, 2013 8:43 am

I cannot see any PWM in your design, so you will have to drop one and get it set up for your desired frequency. Then you can vary the compare-value with the API PWM_WriteCompare() wit a value between 0 (0%) up to your period value (100%) in steps of (period value / Max Slider value) .

Happy coding
Bob

PS: to have the Percentage displayed contineously, calculate it into a global var and display it in main() within your main-loop.
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Fri Mar 01, 2013 1:24 am

Hai ,i made some modification in my program code.my scope is to obtain the output of pwm in an lcd display .the lcd should display varying duty cycle as i slide my finger in the slider and the duty cycle should be in a particular value even though i remove my hand.I am having much knowledge in coding.please help me in getting the output.how should i modify .i have attached the code..help me ...
Attachments
cap pwm1.cywrk.Archive01.zip
(434.51 KiB) Downloaded 104 times
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Fri Mar 01, 2013 5:08 am

I commented / changed some sections in your code. Have a look at.
I strongly suggest you to update to the latest component versions there have been changes made.

Bob
Attachments
cap pwm2.zip
(422.57 KiB) Downloaded 118 times
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Sat Mar 02, 2013 8:05 am

Thanks a lot

Regards
Shofia
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby shofiaram » Mon Mar 04, 2013 12:50 am

hai, in the code attached i didnt understand the lines


LCD_DrawHorizontalBG(0u, 9u, 6u, curPos>>2);
LedData = 1 << (curPos >>2);
Control_Reg_Write(LedData);


please tell me the logic behind this with a breif note


Regards
Shofia
Attachments
cap pwm1.cywrk.Archive01.zip
(434.51 KiB) Downloaded 109 times
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Mon Mar 04, 2013 1:55 am

Well, I don't know either. That part of the code was already within your provided piece, but we can try to analyze.

Code: Select all
LCD_DrawHorizontalBG(0u, 9u, 6u, curPos>>2);
this will draw a bargraph, look into the LCD-module's APIs in the datasheet to get it explained.
curPos >> 2 is a division by 4.

Code: Select all
LedData = 1 << (curPos >>2);
Control_Reg_Write(LedData);
A construct like this is usually taken to switch on one single bit within a byte or word. The names used make me think that this program might be for a development Kit (PSoC5 FirstTouch?) to show the slider position.curPos >> 2 should give a value between 0 and 7, 1 << n will switch on the nth bit, that value is then transfered to a control-register where LEDs may be connected to.

Probably the whole part is not necessary for your needs, because you use the LCD to display numerical values.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Sat Mar 09, 2013 9:09 am

Hai, i got the output ..Thanks a lot...



Regards,
Shofia Ram
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby shofiaram » Sat Mar 09, 2013 9:11 am

Hai,
I have a doubt ..whether we can save our program as vhdl or verilog file in psoc creator




Regards
Shofia
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Sat Mar 09, 2013 11:22 am

As I understand HDL stands for "Hardware Definition Language" which implies that you can describe "Hardware" with Verilog, not software. As a matter of fact there exists something named "DataPath" which is something complicated but programmable within a PSoC and not only one but up to 24. have a look here,

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby danadak » Sat Mar 09, 2013 12:09 pm

Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: fan controller

Postby lourencohen » Fri Jan 31, 2014 1:36 am

It is designed to evaluate and experiment with Cypress's PSoC 5 programmable system-on-chip design methodology and architecture. I am also planning to do my project in fan controller. Your discussion about this was very helpful. Thanks for sharing.






____________________
Louren
Windows 7 vs Windows 8
lourencohen
Newbie
Newbie
 
Posts: 2
Joined: Fri Jan 31, 2014 1:26 am


Return to “%s” PSoC Creator (PSoC3 & PSoC5 IDE)

Who is online

Users browsing this forum: No registered users and 2 guests