Building my first Microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by beeson76, Jul 5, 2010.

  1. beeson76

    Thread Starter Member

    Apr 19, 2010
    185
    1
    I am building my first circuit with a PIC16f886. I was just wondering if there is a nice website that is devoted to simple circuits that contain microcontrollers. I would like to learn just the basic stuff like the correct way to integrate it. (such things like how to hook up the "power" to it and such things like what certain pins do like the VPP, VDD, VSS and if I need to do anything with these pins.

    Thanks.

    I appreciate the help very much.
     
  2. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
  3. beeson76

    Thread Starter Member

    Apr 19, 2010
    185
    1
    Thanks debjit625 for the reply with schmatics. I see that in all the schematics, they have a non-polarized capacitor between VDD and VSS. Why is that? And then I see that they are connected to ground.? Do I have to connect that to ground?
     
  4. ecka333

    Active Member

    Oct 1, 2009
    76
    0
    100nF capacitor between power supply pins is necessary, it eliminates voltage ripples. Capacitor is needed practically beside every digital chip, not necessary microcontroller. Capacitor must be most close power pins as possible.
     
  5. beeson76

    Thread Starter Member

    Apr 19, 2010
    185
    1
    Thanks for the reply ecka333. I understand then that I need a 100n cap. between VSS and VDD (on my chip, they are pins 19 and 20.) But chip layout also shows VSS on Pin 8. Why do they have VSS on Pin 8? From what I understand VSS refers to Voltage Source and VDD refers to Voltage Drain. Can anyone please explain this. Thanks.
     
  6. beeson76

    Thread Starter Member

    Apr 19, 2010
    185
    1
    Just did some reading and here is what I found out. Pin 1 of my PIC is MCLR/VPP. This pin resets the PIC.

    Apply 5 Volts--code runs from start to finish (and I guess will keep running--therefore your loop in your program.

    If connected to Ground by way of Push Button (or some other switch)--code doesn't run. It resets to very beginning and just sits there as long as switch is pressed.

    If you leave it disconnected--called a floating ground. Sometimes it will work, sometimes it will not work. Unreliable.

    Am I correct??? If I am then I will need to have it connected at all times to my 5 Volt supply. Something I don't understand is having a 10k resistor from MCLR to VDD. Can anyone explain that please. Thanks.
     
  7. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    Ok in simple way
    1) Vss pin in your MCU is for ground or negative connection
    2) Vdd pin is for positive supply connection
    Most of the Microchips MCU support a max of 5V range i.e you connect the ground or 0V to the Vss pin and the +5V to the Vdd pin,some chip also have two Vss and Vdd pins they are connected internally with a small resistance but then also all the pins should be connected properly.

    3)MCLR or Vpp means Master CLear or Voltage for programming this pin is used when we program the chip i.e.. when you download the hex file to the mcu ,you put this pin to a high volt (its done by the programmer) ,and in normal condition when the mcu is running the code its for external reset.If you make this pin low i.e. ground it the mcu will be reset and starts executing the codes from (reset vector)0000H location of your program memory.Their is one shot thats when you start means power the mcu the mcu cant start executing code why? because the Oscillator dosent starts oscillating at first it needs some time to start oscillate properly,so we hold the mcu in a reset state for some time and this is called Power on Reset and its done by the mcu when we connect the MCLR pin with Vdd and that 10K resistor its for limiting
    the current.

    Hope you got it
    Good Luck
     
    beeson76 likes this.
  8. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Sounds like you have got it. 10K is to guarantee no overcurrent and also so you can ground the pin to reset the PIC without shorting the power rails.
     
    beeson76 likes this.
  9. beeson76

    Thread Starter Member

    Apr 19, 2010
    185
    1
    So because my chip has 2 Vss Pins, I need to make sure they are connected, either by trace or by soldering a wire between the 2 pins???

    I now understand the 10k resistor. It is simply so do don't short the power rails together. I understand that now. Thanks for the replies.
     
  10. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Best to connect them together. They are internally connected but they are connected to the pins by tiny thin wires. If only one was connected externally it is possible that enough current would flow through the tiny thin wire to damage it.
     
  11. beeson76

    Thread Starter Member

    Apr 19, 2010
    185
    1
    Thanks Markd77. I will connect them together then. As far as grounding the chip, does that happen on a Vss pin. I ask that because I have a 3 pin 4 mhz resonator that I have hooked to my Pins 8 (VSS) 9 (OSC1/CLKIN) and 10 (OSC2/CLKOUT). I have the middle pin of my resonator connected to Pin 8. But I don't yet have Vss connected to ground yet. Do I just simply connect that to ground somewhere, such as in the schematics that debjit625 provided (on the Vss side of the 100n capacitor)?
     
  12. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    Yes ,your resonator i.e.. a ceramic resonator have three pins ,middle one is for ground.For simple way think it like this the Vss pin is the negative side(ground) and the Vdd pin is the positive side and the 100n capacitor will be connected in parallel with it.

    Good Luck
     
  13. beeson76

    Thread Starter Member

    Apr 19, 2010
    185
    1
    Thanks debjit625. So I will ground my chip like the way described. I appreciate the help.
     
  14. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Hi Benson
    Your MCU have 8MHz internal oscillator. This can be configured to give clock speeds down to 125KHz. You can drop the resonator. Less to worry about in the beginning, and you can free up two IO pins. Of course you can add a crystal at a later stage if needed
     
Loading...