Skip to main content

Posts

Showing posts from August, 2017

Serial Communication Interrupts using pic18f

PIC Serial Communication using Interrupt In my Last Post we studied the serial communication of the PIC18. All sample programs in that Post used the polling method.  In this Post we explore interrupt based  serial communication, which allows the PIC18 to do many things, in addition  to sending and receiving data from the serial communication port. RCIF and TXIF flags and interrupts TXIF (transfer interrupt) is raised  when the last bit of the framed data, the stop bit, is transferred, indicating that the  TXREG register is ready to transfer the next byte. RCIF (received interrupt) is  raised when the entire frame of data, including the stop bit, is received.  In other  words, when the RCREG register has a byte, RCIF is raised to indicate that the  received byte needs to be picked up before it is lost (overrun) by new incoming  serial data.  As far as serial communication is concerned, all the concepts which we have discussed in Basic o

PIC18f Serial Communication Tutorial

PIC18f4580 Serial Communication Tutorial Basics of Serial Communication: When a microprocessor connects with the outside world, it offers  the data in byte-sized chunks. In particular cases, such as printers, the information is simply taken from the 8-bit data bus and offered to the 8-bit data bus of the printer. This can work only if the cable is not too long, because long cables reduce and even distort signals. Moreover, an 8-bit data path is expensive. Keeping this in mind, serial communication is used for transmitting data between two systems  situated at distances of hundreds of feet to millions of miles apart. serial versus parallel data transfers. One will simply analyze major distinction between serial and parallel communication topologies. Parallel communication within which a lot of connections and so on associative hardware as a result of in parallel communication technique  it transmits every bit at he same time. In contrast, Serial comm

Frequency Counter using Interrupts PIC18f4580 Project

Frequency Counter  using PIC18f458 0 Proje ct This POST describes the construction of small frequency counter with a cheap PIC18f4580 microcontroller with 16 x 2 LCD.   Prerequisites: PIC18F4580 TIMER Programming. PIC18F4580 COUNTER Programming. PIC18F4580 Interfacing with 16x2 LCD. PIC18F4580 Interrupts Programming  ( we will cover in this POST) Concept: Frequency  is the number of occurrences of a repeating event per unit time. in our case we will measure a number of clocks generated by clock source per unit time. In this project, LCD is used to display the frequency and PIC timer 1 to measure the input signal and Timer0 to generate an indication that one second has gone. System software utilizes Timer-1 in the 16-bit counter mode to count the input signal and overflows of the counter are added to provide the aggregate count in multiples of 65536. Totaling the existing value of the counter at the conclusion provides the full count.