microcontroller help

Discussion in 'The Projects Forum' started by s3b4k, Sep 21, 2011.

  1. s3b4k

    Thread Starter Member

    Feb 15, 2010
    38
    0
    I need help with this, microcontroller is Atmega 8

    I have two problems

    1. My teacher said first that the switches will not work due to a semiconductor technology in the microcontroller. How do i fix this
    2.Next there is a problem with the reset with the isp connector. How do i fix that?
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I don't see offhand what's wrong with the S1 and S2 connection. You have 10k pull-up resistors to +5v, and the switches are there for overriding the pull-up resistors, putting 0v on the inputs. Perhaps your instructor is considering switch bounce, as you have not defined to us what the purpose of the switches are. If it's for counting or the like, you will need some kind of de-bouncing circuit.

    You have the ISP connector's RESET input grounded. Shouldn't that go to the RESET on the uC?
    Where is the SCLK supposed to go? Not to ground, certainly.
    Where is the MISO supposed to connect? Not to ground, either.
    You have pin 3 on the ISP not connected to anything. I don't know, but should that be ground?
     
    s3b4k likes this.
  3. s3b4k

    Thread Starter Member

    Feb 15, 2010
    38
    0
    i didnt show you the complete diagram, and the switch buttons are used to blink leds. i uploaded full schematic. ignore the other parts of the diagram i just need help with those two, i know the rest of my errors. also can you tell me why everyone uses 10 k ohm there what is that significance
     
    Last edited: Sep 21, 2011
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Maybe you should ask your teacher if their objection to the switch/resistor connection has something to do with switch bounce.

    The ATmega 8 is a CMOS device. 10k is a very common value for pull-up and pull-down resistors for CMOS devices. It's enough to pull an input up or down, and a CMOS output can override it.



    Did you know that you had R7 through R9 mirror imaged? Also, you ought to not have MISO and MOSI so close to the SCLK line; it makes things a bit confusing.
     
    s3b4k likes this.
  5. s3b4k

    Thread Starter Member

    Feb 15, 2010
    38
    0
    alright thanks man, do you need a pullup resistor for the reset on the isp connector to the microcontroller
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    On a PIC, you need the MCLR pin pulled to Vcc by a 10k resistor. The programmer raises that pin higher for programming. I don't know what the ATMega 8 requires. You'll need to look at the programming specifications.
     
    s3b4k likes this.
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I agree with Sgtwookie's comment concerning the hookup of the switches. I don't understand the comment from your teacher. I have connected switches in the same way you have on several AVR micrcontrollers and they work fine.

    As for the ISP connector, I see you have chosen the ISP10PIN version. It uses a dual row 10 pin connector. It appears to be wired per the ATMEL standard.

    Here is a link to an example of the ISP10PIN connector wiring.

    hgmjr
     
    s3b4k and SgtWookie like this.
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Thanks, I completely missed that it's a 10-pin header. The PIC ICP's are 5-pin, and that threw me off completely.
     
  9. s3b4k

    Thread Starter Member

    Feb 15, 2010
    38
    0
    for the switch i put a capacitor in parallel, will this be able to debounce the switch
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I think it is wrong of your teacher to say your switch setup want work. But switches that are not debounced may in some settings give unwanted behavior. As an example. A push of a button that was meant to indicate one occurrence, may in some cases be counted as several events. It will be up to the designer to evaluate if this may cause problems or not. And you can also debounce a switch in software. That is not a problem. I think this answer was more educational correct, than saying "It will not work"
    I found this quite interesting in order cast some light on the problem
    http://www.ganssle.com/debouncing.htm
     
    Last edited: Sep 22, 2011
    s3b4k likes this.
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Rather than just adding a capacitor, look at figure 3 on the 2nd page that t06afre linked to.

    It's not a good idea to short across a capacitor with a switch directly, as it will tend to burn the switch contacts. The above referenced circuit has a resistor in the discharge path, which will make the peak switch current much lower.
     
    s3b4k likes this.
  12. MrChips

    Moderator

    Oct 2, 2009
    12,432
    3,360
    The ATmega8 I/O pins have internal pullups. To enable the pullup for an individual pin, set the direction to input and write a 1 to the output.

    The RESET pin already has pullup. There is no need for external RESET circuitry.
     
    s3b4k likes this.
  13. s3b4k

    Thread Starter Member

    Feb 15, 2010
    38
    0
    thanks for all the help but i got another two questions: it would mean a lot if you can help.

    1.you see the 10k resistor in the figure, what is the min and max value this can be on the micro-controller?

    2. is in the attached file. Basically can you put a check or an x i.e(√ or x)
    if it can operate in the region or not(high or low)

    thank you
     
  14. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    What is shown as the "Bad Region" is actually called the "indeterminate region", that area where the signal is neither a logic "1" nor "0"; a non-Schmitt trigger input won't be certain to be set correctly - the output can be incorrect.

    Since I'm not familiar with Atmel 8's, perhaps someone else will help you with the rest.
     
  15. s3b4k

    Thread Starter Member

    Feb 15, 2010
    38
    0
    alright thanks man
     
Loading...