Showing posts with label Library. Show all posts
Showing posts with label Library. Show all posts

Arduino: interrupts in class and callback functions

 Posted by:   Posted on:    7 comments

Arduino is a popular open source electronics development platform. The programming language is nothing else but C/C++. The predefined Arduino libraries provide easy to use functions for most usual tasks, like writing and reading to MCU pins, data transfer using common protocols etc.

If you're working on a complex project or you are developing your own library, chances are you are creating new classes. That's because a class can contain member data (just like data structures) and member functions (which modify, process or generate data). Access to class members is usually governed by an access specifier. Private members are accessible only from within other members of the same class, while public members can be accessed from anywhere where the class object is visible. This is the C/C++ programming language. If you're not familiar with it I suggest starting with this tutorial about classes.

Arduino: interrupts in class and callback functions

Arduino Library for SX8646 Capacitive Button Controller

 Posted by:   Posted on:    4 comments

The router front panel with LCD I began interfacing has a capacitive five button keypad. The panel I'm talking about was used by Sercomm SHG1500 routers and although there are multiple hardware versions of the LCD (some make use of FPGA circuits to drive the LCD, others use SPI interface), the keypad seems to be the same. Based on Semtech SX8646, it is controlled over I2C bus.

SX8646 requires 3.3 V power and is not compatible with 5 V bus. Besides I2C, it uses another pin to trigger an interrupt at host when a button is touched. The keypad PCB sits next to LCD PCB and on some hardware versions it plugs straight into it, while on others it uses a connection cable going to the router main board.

Arduino Library for SX8646 Capacitive Button Controller

SX8646 keypad PCB

Drive stepper motors with Arduino (code)

 Posted by:   Posted on:    No comments

A stepper motor is a brushless electric motor that rotates in small equal steps, as opposed to the continuous rotation of regular motors. It has the ability to rotate a predefined number of steps, being made of multiple coils that are energized in regular sequences by trains of digital pulses. Unipolar motors use two coils, each of them having a center tap. The center taps from both coils connect to a power line and the remaining four coil terminals are powered sequentially (they have at least 5 wires). On the other hand, bipolar stepper motors have two coils that are powered one after another then voltage polarity is reversed and coils are powered again (this type of motors have only 4 wires).

A simple transistor driver and connections (only for unipolar steppers) and driving methods were discussed in the previous post: Driver and Arduino code for unipolar stepper motors. Some basic Arduino functions were provided there. But those functions are too basic for most usage scenarios. The motor can be driven only in with multiples of 4 or 8 steps and you can't change rotation direction. In this post, I will explain further the driving methods and I will generate driving pulses programmatically, with the ability to move one step at a time and change the rotation direction.

Drive stepper motors with Arduino (code)

A 15-Segment VFD controlled by HT16515

 Posted by:   Posted on:    No comments

FV865ND is a VFD panel manufactured by Futaba Corporation. It is designed to be used in DVD players or set-top-boxes. It can show 8 characters and it has a lot of symbols (icons). I found it in a DVB-S2 receiver (Comag SL100HD) where it was used at the front panel with HT16515 controller IC. Fortunately, the front panel of this receiver contains everything needed to power the VFD (the power is supplied via 5 V line and it is converted to filament and VFD voltage by a small transformer located on the back side of the PCB).

I couldn't find any software for HT16515 but its datasheet is available. The IC is 3.3V and 5V compatible and the nice thing is that the panel connector has different pins for IC supply and VFD transformer. The IC supports key scan too and the front panel makes use of only 7 keys (maximum 32). Data is sent/received via 4 lines serial interface, SPI like.

Comag SL100HD front panel with VFD

Comag SL100HD front panel with VFD

SC75823 13-Segment LCD Display

 Posted by:   Posted on:    No comments
SC75823 is an LCD controller IC that is able to drive up to 156 segments. It is a 5V device that gets display data via serial bus. I found it in an auto CD player's front panel with 8 x 13 segment character LCD. I couldn't find an Arduino compatible library for it so I wrote one.

The controller only supports writing data to it. There is no key input support like other front panel ICs that can control a display and read pressed keys. The panel I'm using had each key connected in series with a different resistor and the main processor read pressed key by analog read value. Since some keys didn't work anymore, I cut the PCB and removed extra parts, keeping only the LCD panel, its backlight and the controller.

The communication protocol is probably Sanyo CCB (computer control bus), somewhat similar to SPI (it uses clock, data and chip enable signals). The controller has a pin INH that when LOW turns off the display. The library supports turning display off via this pin if connected or using software command.
Arduino SC75823 13-Segment LCD Display

A different TM1628 7-segment display

 Posted by:   Posted on:    No comments
TM1628 is an LED controller IC that's used mostly at DVD players front panels. The IC can control up to 7 sets of segments (separate digits) and can also process input from up to 16 individual keys. It is controlled via SPI compatible serial interface.

The only Arduino compatible library I was able to find for TM1628 is developed by Vasyl Yudin and is available on GitHub. But, I couldn't get any readable output on display. That happened because my front panel had a different segment assignment to the controller than what I found on YouTube (the display with disc icon on it).

My front panel came from TeleSystem TS5.9RX DVD Recorder and it has 7 digits and some other indicator LEDs. The PCB also contains 5 keys - but I can expand it by adding more buttons. Below is a sketch example for this front panel. It is 5V compatible so it can be connected directly to 5V levels development boards like Arduino and compatible.
A different TM1628 7-segment display