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 #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 #8, The timer1 module

The goal: to get 1 Hz pulses.

What do we have: PIC16f628a, a handmade devboard, and proteus

Continuing to learn pic microcontrollers, and the timer1 is the next module in our way. Usually, this is a 16bit timer, so it allows to have a larger time frame.

timer1 block diagram, pic16f628a datasheet
Continue reading

Pic Lab, PIC16, Experiment #4: 7 segment display

It was 2012 year, I was just starting to learn how to work with the PIC microcontrollers, so the code is far away from optimal.

uC: PIC16F628a

Compiler: Hi-TECH PICC

Goal: To connect 7 segment indicator and display numbers from 0 to 9

7 segment indicator connection
Continue reading