How to use WinUsb to communicate with USB device:
https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B6cTyGu_5y4aZDczNWVkZWEtZDUwZi00YTJlLTlmY2YtMDUxZTlhZGZiN2Vi&hl=en_US
2011-05-31
2011-05-27
2011-05-20
2011-05-19
Temperature sensors characteristics
Sensor | Temperature range,°C | Accuracy in °C | Cost | Robustness |
Thermocouple | -270 to +2600 | 1 | Low | Very high |
RTD | -200 to +600 | 0.2 | Medium | High |
Thermistor | -50to +200 | 0.2 | Low | Medium |
Integrated circuit | -40 to +125 | 1 | Low | Low |
2011-05-12
HD44780 LCD: Pin Configuration of the HD44780 LCD Module
HD44780 is one of the most popular LCD controllers used in many LCD modules in industrial
and commercial applications and also by hobbyists. The module is monochrome and
comes in different shapes and sizes. Modules with character lengths of 8, 16, 20, 24, 32, and
40 can be selected. Depending on the model chosen, the display provides a 14-pin or a 16-pin
connector to interface to the external world. Table 4.15 shows the pin configuration and pin
functions of a typical 14-pin LCD.
and commercial applications and also by hobbyists. The module is monochrome and
comes in different shapes and sizes. Modules with character lengths of 8, 16, 20, 24, 32, and
40 can be selected. Depending on the model chosen, the display provides a 14-pin or a 16-pin
connector to interface to the external world. Table 4.15 shows the pin configuration and pin
functions of a typical 14-pin LCD.
VSS is the 0 V supply or ground. VDD pin should be connected to the positive supply. Although
the manufacturers specify a 5-V DC supply, the modules will usually work with as low as 3 V
or as high as 6 V.
the manufacturers specify a 5-V DC supply, the modules will usually work with as low as 3 V
or as high as 6 V.
Pin 3 is named as VEE, and this is the contrast control pin. This pin is used to adjust the contrast
of the display and it should be connected to a DC supply. A potentiometer is usually
connected to the power supply with its wiper arm connected to this pin and the other leg of
the potentiometer connected to the ground. This way, the voltage at the VEE pin and hence the
contrast of the display can be adjusted as desired.
of the display and it should be connected to a DC supply. A potentiometer is usually
connected to the power supply with its wiper arm connected to this pin and the other leg of
the potentiometer connected to the ground. This way, the voltage at the VEE pin and hence the
contrast of the display can be adjusted as desired.
Pin 4 is the Register Select (RS), and when this pin is LOW, data transferred to the LCD is treated
as commands. When RS is HIGH, character data can be transferred to and from the module.
as commands. When RS is HIGH, character data can be transferred to and from the module.
Pin 5 is the Read/Write (R/W) pin. This pin is pulled LOW to write commands or character
data to the LCD module. When this pin is HIGH, character data or status information can be
read from the module.
data to the LCD module. When this pin is HIGH, character data or status information can be
read from the module.
Pin 6 is the Enable (EN) pin that is used to initiate the transfer of commands or data between
the module and the microcontroller. When writing to the display, data is transferred only on
the HIGH to LOW transition of this pin. When reading from the display, data becomes available
after the LOW to HIGH transition of the enable pin, and this data remains valid as long
as the enable pin is at logic HIGH.
Pins 7–14 are the eight data bus lines (D0–D7). Data can be transferred between the microcontroller
and the LCD module either using a single, 8-bit byte or as two, 4-bit nibbles. In the
latter case, only the upper four data lines (D4–D7) are used. The 4-bit mode has the advantage
that fewer I/O lines are required to communicate with the LCD.
1 VSS Ground
2 VDD +ve supply
3 VEE Contrast
4 RS Register select
5 R/W Read/write
6 EN Enable
7 D0 Data bit 0
8 D1 Data bit 1
9 D2 Data bit 2
10 D3 Data bit 3
11 D4 Data bit 4
12 D5 Data bit 5
13 D6 Data bit 6
14 D7 Data bit 7
2 VDD +ve supply
3 VEE Contrast
4 RS Register select
5 R/W Read/write
6 EN Enable
7 D0 Data bit 0
8 D1 Data bit 1
9 D2 Data bit 2
10 D3 Data bit 3
11 D4 Data bit 4
12 D5 Data bit 5
13 D6 Data bit 6
14 D7 Data bit 7
2011-05-10
SDCard: Standard SD Card Pin Configuration
SD Mode
1 CD/DAT3 Card detect/Data line
2 CMD Command response
3 Vss/Ground
4 Vdd Supply voltage
5 CLK
6 Vss/Ground
7 DAT0 Data line
8 DAT1 Data line
9 DAT2 Data line
SPI Mode
1 Chip select2 Data in
3 Vss
4 Vd
5 CLK
6 Vss
7 Data out
8 Reserved
9 Reserved
2011-05-05
Microchip PIC: Usting Timer 1 in Capture Mode
The hardware and software in this memo comprise an engine control monitor and alarm. The purpose is to monitor the tachometer signals from an engine. If the period pf the pulses drop below 1ms, the engine is running too fast and a red LED lights up for alarm.
We relies on the capture interrupt event to do all of the work. Following are the steps its is executing:
- Read capture signal and store the result as end_time. CCP_I is a CCS PIC compiler variable that is provided as way to read the 16-bits capture register;
- Using end_time a a previously stored beginning Timer 1 count (start_time), the actual period of was is calculated in timer ticks. The Timer 1 overflow interrupt value is used to account for any counter overflow that may have taken place during the measurement period. The calculation for the number of tick is:
Pulse_ticks = overflow_count*0x10000-start_time+end_time
- Comparing the actual pulse_ticks to 2500 to see if the engine is running too fast. The limit is when actual time of the waveform's periode is less than 1ms, inditcating a high engine spped problem. The 2500 limit was calculated this way:
1ms/(1/(4 MHz/4)) = 2500
- Adjusting the output LED according to the current reading;
- Finally, saving end_time for the current pulse as start_time for the newt pulse and clearing the overflow_count for the next pulse calculation.
Source code example:
Subscribe to:
Posts (Atom)