Ads

Get STM32 tutorial using HAL at $10 for a limited time!

Showing posts with label Electronics. Show all posts
Showing posts with label Electronics. Show all posts

Friday, January 29, 2016

Basic of Stepper Motors

A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft of this motor is rotates in discrete step increment when electrical pulses are applied in a proper sequence. Every discrete step of a stepper motor is measured in degree (it can be 1.8° or even smaller depends on the stepper motor type and stepping technique).


This kind of movement is different from DC motors. DC motors is rotates continuously when there is a voltage applied to it and stops when the voltage removed. When the voltage applied to DC motors reversed, the rotation is also reversed. For the stepper motor, we can change the direction of the shaft rotation by reverse the sequence of the applied pulses. The speed of stepper motor shaft rotation is directly related to the frequency input of the pulses. The length of rotation of the stepper motor is directly related to the number of pulses applied.

Friday, December 25, 2015

Altium Designer Tutorial 4 - PCB Layout

In the previous tutorial, we have finished the circuit schematic. In this tutorial, I will continue to make the PCB layout. First, select menu Design → Update PCB Document to create PCB document from the schematic that has been made.

This dialog will be show, then click Execute Changes button.


You can move the component and place them on the right position. This is example of the component location.


Sunday, December 20, 2015

LCD 16x2 HD44780 Tutorial 6 - 4-bit Data Transfer

In this tutorial, I will share hoe to use 4-bit data transfer between to the LCD 16x2. This technique is useful when we want to control LCD from microcontroller, because it use less GPIO pins. 4-bit interface is only used 4 wire from D7 to D4, D3 to D0 is not used. The transfer method is high nibble first, then followed by low nibble.

This is the procedure how to use 4-bit data transfer to display 'A' character:
  1. Send command: 0b0010 xxxx (Set 4-bit data transfer).
  2. Send command: 0b0010 xxxx (high nibble function set).
  3. Send command: 0b1000 xxxx (low nibble function set).
  4. Send command: 0b0000 xxxx (high nibble display on, underline on, blinking on).
  5. Send command: 0b1111 xxxx (low nibble display on, underline on, blinking on).
  6. Send data: 0b0100 xxxx (high nibble 'A').
  7. Send data: 0b0001 xxxx (low nibble 'A').

Saturday, December 19, 2015

LCD 16x2 HD44780 Tutorial 5 - Create Custom Character

In this tutorial, I will share how to create and display custom characters on LCD 16x2. First thing you must know is that on the LCD 16x2 there are two memories that storing defined characters, CGROM and CGRAM.

CGROM is used for storing all permanent font that can be displayed by using their ASCII code. For example, if we write 0x41 then on the display will show 'A' character. CGROM memory is non-volatile and can't be modified.

CGRAM is another memory that can be used for storing user defined characters. This memory is volatile and can be modified any time. This memory can store up to 8 user defined characters. Characters that stored in CGRAM can be accessed from code 0x00 to 0x07.

This table below show character codes and character patterns for CGRAM and CGROM:


Sunday, November 1, 2015

Altium Designer Tutorial 3 - Circuit Schematic

In the previous tutorial, we have made the schematic symbol and component footprint. Now in this tutorial, I will continue to make circuit schematic. You can go to schematic file by double click on the project explorer.

The final schematic of the circuit is looks like this:


Monday, October 26, 2015

Altium Designer Tutorial 2 - Footprint Library

In the previous tutorial, we have created schematic component symbol. Now in this tutorial I will share how to make footprint for that component symbols.

First, go to the PCB library project. In this tutorial, I will make component footprint with wizard tools, but it is also possible to create component footprint without wizard. The advantage of wizard tools is you can make the component footprint more easy and fast. There are two type of component wizards, first is "IPC Compliant Footprint Wizard" and second is "Component Wizard". Both of them can be access from menu Tools.

For example, I will make SMD capacitor footprint using tool Component Wizard. This is the steps to do that:
  • First, select the component that you want to make, in this case is capacitor.

Sunday, October 25, 2015

Altium Designer Tutorial 1 - Schematic Library

In this tutorial, I will share how to use Altium Designer software to make a simple PCB layout. This tutorial will explain how to make the circuit schematic, PCB layout, schematic library, and PCB footprint library. This tutorial is suitable for beginner who never use Altium Designer to learn the basic function of this software.

For this tutorial, I will make PCB for simple 3.3V power supply module. After you start the Altium Designer software, go to Flie New Project to make a new Altium project. Then give name for that project, for example "power_supply_3_3_v".

On the Projects explorer, right click on the project that has been created and select Add New to Project Schematic to add a schematic file to that project. Repeat this step for add PCB file, schematic library file, and PCB library file. To rename all the files that have been created can be done by menu File Save All

Sunday, September 20, 2015

LCD 16x2 HD44780 Tutorial 4 - Character Entry Mode

In this tutorial, I will discuss about character entry mode of LCD 16x2 HD44780. There are 4 character entry mode that can be selected. So far, we have been used the default character entry mode until previous post. The entry mode is auto-incrementing the cursor address every new character is entered. It is also possible to auto-decrementing the cursor and combine with shifting the display.

This is the first entry mode or the default entry mode. To do this we can send instruction 0b00000110 to the LCD. This is the default entry mode every LCD powered on. Every new character is entered, the cursor/ DDRAM address is auto-incremented by 1. This mode is illustrated by picture below:

  1. Set cursor to 0x07 address location.
  2. Put char 'A' on 0x07 location, cursor auto-incremented to 0x08 address location.
  3. Put char 'B' on 0x08 location, cursor auto-incremented to 0x09 address location.
  4. Put char 'C' on 0x09 location, cursor auto-incremented to 0x0A address location.
  5. Return home (0x00 location).

Saturday, September 19, 2015

LCD 16x2 HD44780 Tutorial 3 - Display Address and Shifting

In previous tutorial, we have done displaying a word "AnNyeongHaSeYo!" (Hello in Korean) on LCD 16x2. In this tutorial, I will explain about addressing to DDRAM (Display Data RAM). The function of DDRAM is to store character that displayed on LCD screen. 

HD44780 LCD controller has 128 different addresses for DDRAM, although not all addresses have their own location on LCD screen. Only 80 display locations can be used to store characters. HD44780 is a LCD controller that can be used not just for 16x2 LCD size, but also for other size such as 16x4, 20x2, or 40x2. The display location for all LCD size is also same (80 location). The different is number of location that can displayed on screen. For example, on 16x2 size is only 32 location, but other location still can be used to store character, although not displayed. To displayed that, we can shift the display right or left. This is the address location of DDRAM that displayed on LCD 16x2 size every LCD power on:


Saturday, June 20, 2015

LCD 16x2 HD44780 Tutorial 2 - Basic Commands and Displaying Text

In this post, I will explain how to send commands and characters data to LCD 16x2 HD44780. From the previous tutorial, we have finished building the circuit on the breadboard. When you power up this circuit, you will see a series of square only on line 1 of the display. This is the default pattern of an uninitialized LCD display. The LCD will always reset itself to this pattern when power is applied. If you not see this pattern, you can turn the resistor variable that controls the contrast of the LCD until see this pattern.


Saturday, June 13, 2015

LCD 16x2 HD44780 Tutorial 1 - Basic Circuit

In this tutorial, I will explain about LCD 16x2 basic operation. LCD 16x2 that I will use have a Hitachi HD44780 (or compatible) controller chip. In this tutorial I will not use any microcontroller for controlling the LCD, but just use a series of switches, because it will be useful to understand the working principle of HD44780 controller chip. When you use microcontroller to drive LCD effectively, this experiment can be a benefical step to have more knowledge about HD44780 chip rather than just use existing library.


First step of this experiment is make the circuit. I will make this circuit on a breadboard. This is the circuit that I use for this experiment.