Archive for the 'Hardware' Category

Migrating from demo compilers to SDCC

I found these tips from SDCC manual pages and though that it should be useful. If you would like to migrate from a demo C Compiler with the limitation of code size, such as Keil C51 and Raisonance RIDE-51, to SDCC, please consider to port your present code to SDCC by following these instructions.

check whether [...]

Distance Measurement Sensor

GP2Y0A21YK is General Purpose Type Distance Measuring Sensors from Sharp. (see the product page). Sharp Infrared (IR) radiation Distance Measuring Sensor use Infrared signal to measure object distance from 10 to 80 cm with analog output.
Features

Less influence on the color of reflective objects, reflectivity
Line-up of distance output/distance judgement type
Distance output type (analog voltage) : [...]

Servo Motor Control

Servos
Servos are DC motors with built in gearing and feedback control loop circuitry. And no motor drivers required. They are extremely popular with robot, RC plane, and RC boat builders. Most servo motors can rotate about 90 to 180 degrees. Some rotate through a full 360 degrees or more.
However, servos are unable to [...]

EEPROMs Interfacing

24LC512 is a 64K x 8 (512 Kbit) Serial Electrically Erasable PROM (EEPROMs), from Microchip Technology Inc. (see the product page). It has been developed for advanced, low-power applications such as personal communications and data acquisition. This device also has a page write capability of up to 128 bytes of data.
This device is capable [...]

Real Time Clock Interfacing

DS1307, a 64 x 8, Serial, I2C Real-Time Clock, is a low-power, full binary-coded decimal (BCD) clock/calendar plus 56 bytes of NV SRAM. Address and data are transferred serially through an I2C, bidirectional bus. The clock/calendar provides seconds, minutes, hours, day, date, month, and year information. It a product of Maxim/Dallas Semiconductor, see the [...]

I²C Bus Interfacing

I²C bus (Inter-Integrated Circuit) is a bidirectional, half duplex, two-wire, synchoronous bus, originally designed for interconnection over short distances within a piece of equipment. The I2C bus uses two lines called Serial Clock Line (SCL) and Serial Data Lines (SDA). Both [...]

Analog-to-Digital Interfacing

The ADS7841 is a 4-channel, 12-bit sampling Analog-to-Digital Converter (ADC) with a synchronous serial interface. The resolution is programmable to either 8 bits or 12 bits. It is a product of Burr-Brown form Texas Instrument, see the product page.
This ADC give the 12-bit Binary Code Decimal (BCD) output value therefore the [...]

LCD interfacing

This is an example how to interface to the standard Hitachi-44780 LCD using an 8051 microcontroller and SDCC as C Compiler. I use a standard 16-character by 2-line LCD module, see schematic below. Here, I use 4-bit interfacing.

Schematic: 4-bit interfacing 16×2 LCD
Source Code (For SDCC)
- lcd.h
- test_lcd.c
Related Links
- How to [...]