Homeworks about a microcontroller PIC16F877/A

Discussion in 'Homework Help' started by nomad1003, Apr 17, 2013.

  1. nomad1003

    Thread Starter New Member

    Apr 17, 2013
    Hello everyone, im new here to be that i have asked that undefined situations, :confused: respectively. But i can't follow an efficient way to understand these PIC families cause of low level coding :mad: Assembly?! (The cumulative homeworks are asked as regularly if they're replied well. :eek: ) However, i need to describe myself to get your reputable approachs :rolleyes: as firstly;

    1.) Consider the following circuit, which has 4 input switches and 4 output LEDs. The input switches are used to read input from a 4-bit parallel binary information source that generates information in every second. The system should apply the following digital filter to this input data:

    O[n]=(I[n] + I[n-1])/2,

    here I[n] and I[n-1] represents current and last input data, the generated output is O[n] and it should be displayed using the LEDs.

    a) Choose the XTAL frequency and the resistor values R1 and R2 proper to your design.
    b) Design the firmware that implements the required digital filtering.Use interrupt in the design.
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    We can not or will not do your homework for you. But of course give you a push in the correct direction. From you post. It is unclear what part of this project you struggle with. Can you be more specific. And also post what you have done so far. As a hint! A right arithmetic shift is the same as divide by two http://en.wikipedia.org/wiki/Arithmetic_shift
    This lab assignment is also not your first lab assignment using PIC. So looking back to what you have done before is often quite smart ;)
  3. mitko89


    Sep 20, 2012
    a) The oscillator frequency will have effect on the code of the program I suggest 8 or 12MHz. Resistors should be R1=10k, R2=470.
    b) What you have to do is to initialize the ports of the PIC where the switches and LEDs are connected and repeatedly read the switches. Use timer with enabled interrupt that fires every second. As t06afre suggested you can use shift for the division and you have addition in the mpasm. There is a bit "tricky" moment when you deal with switches. If you tell me what it is and how to deal with it, I will give you further instructions. The program is about 80-100 lines at total.
  4. nomad1003

    Thread Starter New Member

    Apr 17, 2013
    the asked instructions that you want is appeared at the last given as universly by the itselves, if you cant handle it i can share another sample works of mine to get the idea what it is and how it is? until tomorrow night.