Ads

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

Saturday, December 26, 2015

ARM Cortex-M3 (STM32F103) Tutorial - Keil uVision IDE - Make a New Project

In this tutorial, I will explain how to make a new project for STM32F103C8 using Keil uVision IDE. STM32F103C8 is a 32-bit microcontroller produced by ST Microelectronincs Company. It use ARM Cortex-M3 CPU Core. The clock speed is up to 72MHz. It has 64Kbytes of flash memory and 20Kbytes of SRAM.


The development board for this microcontroller is quite small. It came with DIP 40 pin that fits on breadboard. It has 2 × 12-bit ADCs, 7 × timers, Up to 9 communication interface (3 × USART, 2 × I2C, 2 × SPI, 1 × CAN, 1 × USB), External Interupt, DMA.


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: