Use CH341A with AsProgrammer on Windows

 Author:   Posted on:    1 comment
CH341A serial programmers are cheap and quite popular. One of the most used device is the MiniProgrammer. CH341A is a chip with USB port. It can be interfaced with parallel ports, serial ports, I2C and SPI devices. The manufacturer of CH341A chip offers drivers for all operating systems. They even offer API for programmers who want to build software to talk to CH341A. In spite of this, software tools for CH341A are not very easy to find. Linux users have some command line tools, but Windows users had no open source software.

AsProgrammer is a graphical interface tool that can read, erase and write serial memory chips. It has been created by Alexander and it seems to exist since late 2011. It supports for UsbAsp, AVRISP-MKII and CH341A programmers. The utility is released under MIT license and can be downloaded from GitHub – binary releases here. I tested the utility with I2C EEPROM and SPI FLASH chips with success.

Use CH341A with AsProgrammer on Windows

Counting time with Arduino (basic clock)

 Author:   Posted on:    No comments
When it comes to counting time using an Arduino or other MCU platform, the use of a RTC (real time clock) circuit is highly recommended. These devices are cheap, have good accuracy and keep counting time even when the main MCU is not powered. They run from a small battery and draw low current. There are quite a lot of Arduino libraries that deal with time and make the interaction with a time source easy. One of these is the Time library by Paul Stoffregen. It is a well written library with internal time based on standard Unix time time_t (number of seconds passed since Jan 1, 1970).

But I wanted something even more basic. I wrote a 50 lines of code function that increments seconds variable each time it is called. When seconds overflow (reach 60), it increments minutes variable and resets seconds. And so on. Only when a time variable changes, it is printed on the output device (16x2 LCD in this case). Around this function I added code that turns the Arduino into a common clock. As a prototype as used the LCD and keypad shield fitted to an Arduino Uno compatible board. The code should compile on any other development board because it doesn't use specific functions or libraries. You will have to adjust LCD pin configuration and keypad buttons (require modification if using buttons connected to digital input pins instead of the analog keypad).

Counting time with Arduino (basic clock)