Other articles

  1. PIC 16F690 7 seg voltmeter

    Introduction

    This little program reads analog voltage on AN2, and converts it into an ADC value, and then claculates the volt. The volt is displayed on a 3 digit 7 seg.

    Check out this article for the schematic.

    #include <xc.h>
    
    // CONFIG
    #pragma config FOSC = XT        // Oscillator Selection bits (HS …
    read more
  2. PIC 16F690 7 seg display

    Introduction

    In this note I make a program that counts decimal number from 00.0 to 99.99. Eventually, this program will be the base program to both a voltmeter and a thermometer. That's actually the same thing. Calculating the voltage is a tiny bit different.

    The program

    #include <xc …
    read more
  3. PIC 16F688 ADC average.

    Introduction

    This little program reads the ADC value of AN7 5 times, stores it in an array, and calculates the average. This perticular examples uses an LM34. This is converted to Celsius.

    All the Uart - code is in the uart_header and uart_source files.

    The output

    Output

    The program

    // INCLUDE LIBRARIES
    #include …
    read more
  4. PIC 16F688 1 sec interrupt demo.

    The 1-sec

    This is a small demo on how to use interrupt to flash a led at a 1 sec rate.

    PIC16F688 have one 8-bit timer. This means that the max value TMR0 can have is 256, then it rolls over to 0, creating an interrupt.

    To generate a one …

    read more
  5. PIC 16F688 LM34 to PC.

    Introduction

    This little program reads ADC from AN7, converts and converts it to Celsius. There's a LM34 connected to AN7. TX is connected to a USB-RS232 converter.

    All the Uart - code is in the uart_header and uart_source files.

    The output

    Output

    The program

    // INCLUDE LIBRARIES
    #include <xc.h>
    #include <stdio.h …
    read more
  6. PIC 16F628A GSM Demo.

    PIC and SIM900A

    This program demonstrates how to use the SIM900A to connect and disconnect to the cell network with GPRS. The uart code are in libraries.

    Main program

    // INCLUDES
    #include <stdio.h>
    #include <stdlib.h>
    #include <xc.h>
    #include <string.h>
    #include "uart_init_header.h"
    
    // CONFIG
    #pragma config FOSC = HS …
    read more
  7. PIC 16F628A UART demo.

    This is a demo of how to use libraries when programming PICs.

    Main program

    // INCLUDES
    #include <stdio.h>
    #include <stdlib.h>
    #include <xc.h>
    #include <stdbool.h>
    #include <string.h>
    #include "uart_init_header.h"
    
    // CONFIG
    #pragma config FOSC = HS        // Oscillator Selection bits (HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT …
    read more
  8. PIC 16F688 ADC demo.

    PIC 16F688 ADC

    This is a little ADC demo, based on the PIC 16F688. I'm using 8-bit analog converter, that's 255, not the 1023 a 10-bit has.

    // INCLUDE LIBRARIES
    #include <xc.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    // CONFIGURATION BITS
    #pragma config FOSC = HS        // Oscillator Selection bits (INTOSCIO oscillator: I …
    read more
  9. MPLAB X - things to remember

    lø. 02 desember 2017

    A Work In Progress

    The list

    This is a list of tips/trix and things to remember in MPLAB X. It is based on my experience.

    To disable warning: (373) implicit signed to unsigned conversion warning, put this in your code:

    #pragma warning disable 373
    

    I place it under the …

    read more
  10. PIC 16F628A 16 x 4 LCD

    In this article I'm using a PIC 16F628a to demonstrate one way of using a 4 line LCD.

    The hardware

    The following schematic is put on a breadboard: Schematic layout

    Click here for a bigger view.

    BOM - Bill of material

    This is what you need.

    Partlist
    
    Exported from PIC16F628A-16x4-lcd-demo.sch at 08 …
    read more
  11. PIC 16F628A Engine Timer

    Work in progress

    PIC 16F628A Engine Timer

    The idea behind this circuit is that I have no idea of how many hours my Volvo Penta is running during a season. With this circuit, I can monitor the hours, and change the motor oil according to the timer.

    The program write …

    read more

Page 1 / 1

blogroll

social