USB to RS-232 – FT232RL

There are tons of articles out there, but I decided to make my own device at the moment:

I had thoughts to make such a device long ago, but at this point of time, the necessity of having this stuff increased significantly. Initially, I found a cheap CP2102 IC, it was cheaper than the huge FT232RL, which has a lot of redundant for me functions. Then I went shopping (here I’m talking about Belarus like 8 years ago) and realized that for us CP2102 is more expensive than FT232RL. Well, my choice was kind of obvious.

Continue reading →

Pic Lab, PIC16, Experiment #19, The WIN QT application for COM port

In a previous experiment, I made an application (well borrowed) with help of C++ Builder, but I really did not enjoy/like it much. So, I was exploring the web again and found an article.  It was much more logical and simple to me, so I decided to give it a shot.

Firstly, we need the Qt SDK. Then we should take sources from here: qt.gitorious.org/qt/qt/trees/4.7/src/corelib/kernel files qwineventnotifier_p.h and qwineventnotifier_p.cpp and place them QtSDKDesktopQt4.7.4mingwincludeQtCoreprivate

Also, download the library dedicated to working with a COM port. Good enough, now we are prepared.

Continue reading →

Pic Lab, PIC16, Experiment #17, The clock with a thermometer

After I had enough time playing with a thermal sensor DS18b20 and the RTC DS1307 I decided to bundle them together into a single device. Another reason was the fact that the cheap Chinese clock called a day and let its electronic soul leave the nice enclosure. I considered this as an opportunity to put my stuff inside of it.

That is what I got in the end:

+1 reason is that I had a free sample of the “port expander” PCA9539, I mentioned this IC in experiment #13.

Continue reading →

Pic Lab, PIC16, Experiment #15, Real-time clock (RTC) DS1307

I got the package from China with some ICs I wanted to try before embedding them to the clock project I want to make. Have to warn: my point of interest was just a time, the date was out of the scope, so nothing about it will be investigated further.

Goal: To write the value of the time/read the time and output it thru UART from the DS1307 chip

Tools: PIC16f628a, DS1307, MAX232 level converter, devboard, proteus.

Continue reading →

Pic Lab, PIC16, Experiment #14, USART (UART) module

Let’s look at USART module in pic microcontroller (uart module).

I’m going to move in two ways:

1. Using existing functions from a hi-tech compiler.

2. Writing my own functions.

USART = UART = SCI – the universal data transmitting/receiving protocol, which can work in synchronous and asynchronous modes. We pay attention to the second mode at the moment, this one is used for communications mostly.

Continue reading →

Pic Lab, PIC16, Experiment #13, Software I2C

I choose the software realization of the I2C protocol as the next experiment. There isn’t a description of this protocol, only realization. The curious soul should google it, there is a lot information on i2c subject.

So:

Goal: To make the connection between PIC16f628a and IO port expander PCA9539 by i2c

What we have: PIC16f628a, PCA9539, devboard.

Why do I need it (in short): I have one project in development state for now. The project is a clock with a thermometer and two seven-segment indicators: the first 4-digit and the second has 3 digits. To control it I need 8+4+8+3 = 23 IO pins, but PIC16f628a has only 16, so in the such configuration, it seems not real to me. In the beginning, I thought about shift register using, but suddenly I received free sample sets from NXP and I took the decision to use PCA9539. In this case, there are only 9 pins to be used, and two pins from it are for I2C communication between pic micro, RTC clock, and the thermometer.

Continue reading →

Pic Lab, PIC16, Experiment #12, EEPROM

Goal: To write and read EEPROM

What we have: PIC16f628a and a simple devboard.

Microcontroller PIC16f628a has 128 bytes of EEPROM memory on board, not too much but we have what we have. Hi-tech PICC compiler has internal functions for work with EEPROM, but here I’m going to make some my personal functions.

Let’s look at the EECON1 register:

ee
from the mikroe resourse
Continue reading →