Archives

All Posts Tagged Tag: ‘PIC16F877A’

HC-SR04 Ultrasonic Sensor on PIC

Hcsr04 Banner

HC-SR04 is a very common ultrasonic sensor and it is normally found in Arduino kits or projects. The library for this sensor is widely available for the Arduino platform but not for PIC. I’ve been asked to help to write a simple PIC code to interface with the ultrasonic sensor. It’s actually very simple by referring to the timing diagram. …

Read More

5 Digit 7-Segment Display

5 Digit Banner

I’ve been working on a digital clock project so I thought I will get 4 units of 7-segment displays and put all of them on a PCB to show the time. When I was at the electronics store, I stumbled upon this. I bought this because it has 5 digits on a single package and it looks much neater than …

Read More

Microchip PIC16F877A ADC Configuration

16f877a Adc Banner

I’ll admit that the datasheet is very confusing especially for beginners like me. In this post, I’ll attempt to summarize everything I know about the ADC on a PIC16F877A and hopefully it will be informative to my dear readers. First and foremost, we must have a clear picture on what the built-in ADC is doing. Think of it like there’s …

Read More

Writing code for PIC Microcontrollers in C (Hi-Tech C Compiler)

Hitech Banner

I’ve always wanted to learn how to write PIC programs in C. You might think that’s odd but I was taught how to write in assembly language and not C unlike other universities or colleges. Most of the time it’s the other way around. Learning assembly code is a good thing actually because these C code will eventually be translated …

Read More

Microchip PIC16F877A Analogue to Digital Conversion

16f877a Adc Banner

As mentioned in the previous post, the PIC16F877A has a built-in Analogue to Digital converter. What ADC does is basically convert an analogue voltage ranging from -Vref to +Vref (usually 0V to 5V) and converts it to a binary value. The ADC on the PIC16F877A has 10-bit resolution and this provides 1024 steps (2^10=1024) which is more than enough for …

Read More

Microchip PIC16F877A

16f877a Banner

Moving up the Microchip PIC16F Microcontroller family, we have the PIC16F877A. This is a very common MCU and it’s always mentioned in DIY projects. It’s popular among students, hobbyist and even engineers because it’s cheap. I got it for only RM23 and oddly enough that’s cheaper than its’ little brother I mentioned in a previous post, the PIC16F84A. Another reason …

Read More