DE10 Advance revC demo: Fan Speed Control

From Terasic Wiki

Jump to: navigation, search

This demo helps users quickly understand how to set the MAX6650 chip from the FPGA to control the fansink. The MAX6650 chip can set or retrieve the RPM of the fansink. It can also monitor if there is any unexpected error and determine which type of error it is. The following section will save lots of time for the development of user application.

Contents

System Block Diagram

Figure 2-1 shows the system block diagram of this demo. It is necessary to configure the MAX6650 chip prior upon the initialization of fansink control. The MAX6650 chip uses standard I2C protocol for communication. The functions I2C_Config and I2C_Bus_Controller set and monitor the RPM of the fansink, respectively. A pre-scaler is used as frequency divider for the clock frequency of I2C. Users need to calculate the frequency based on the equations from the datasheet to control the RPM of the fansink. There are three equations in the datasheet and this demo uses one of them. For other equations, please refer to the datasheet MAX6650-MAX6651.pdf in the system CD.

The Switch[1] controls the RPM in this demo. When the Switch[1] is set to 0, the speed is around 2000 RPM. The speed would reach about 5000 RPM if the Switch[1] is set to 1. It would take 10 ~ 30 secs as the buffer time for the conversion.


De10 advanced revc demo fan control block diagram.jpg

Figure 2-1 Block diagram of the Nios II Basic Demonstration

HEX and Switch States Assignments

When the fan is run, the HEX will display fan speed. And user can change the speed by SW.Users can refer to Table 5-4 and get a better understanding about the state of the fansink accordingly. Table 5-4 HEX and Switch States Assignments

Table 2-1 HEX and Switch States Assignments
NAME POR(DEFAULT) STATE FUNCTION
HEX0 8 Display Fan speed rpm
HEX1 8 Display Fan speed rpm (for example HEX0 is 0 and HEX1 is 2,the Fan speed is 2000

Rpm)

SW1 8 When it is 0 ,the Fan speed rpm is 2000;When it is 1 ,the Fan speed rpm will reach 5000 rpm

In 30 secends

Demonstration File Locations

  • Hardware project directory: Fan
  • Bitstream used: Fan.sof
  • Demo batch file :Fan\demo_batch\test.bat

Demonstration Setup and Instructions

  • Make sure Quartus Prime and Nios II are installed on your PC.
  • Use the USB Cable to connect your PC and the FPGA board and install USB Blaster II driver if necessary
  • Power on the FPGA board.
  • Execute the demo batch file “test.bat” under the batch file folder, Basic_Demo\demo_batch.
  • When SW[1] is set to 0, the RPM would slowly be adjusted to ~2000. When SW[1] is set to 1, the RPM would slowly be adjusted to ~5000.
  • HEX will display the Fan current speed RPM

Back

Personal tools