1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Struggling to do my own ELectronic Stuff?

Discussion in 'General Electronics Chat' started by fouadalnoor, Jun 19, 2011.

  1. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    Actually scratch that it works. I have now changed the track size and the copper layer. The only thing left to do is to add the decoupling caps. I dont think I need the download circuit because I only program the chip using the circuit already provided with the chip (look here: http://www.techsupplies.co.uk/epage...ath=/Shops/Store.TechSupplies/Products/AXE003)

    I have the download circuit from that starter pack, and I was thinking of just soldering on the IC Holder to the board so I could just easily take the chip out and re-program it. That way if the chip goes bust then I could also easily replace it. (bad idea?).
     
    Last edited: Jul 4, 2011
  2. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    As i said before the picaxe must have the 22K and 10K resistors of the download circuit in the circuit at all times, weather you use the download circuit or not.

    If you choose to not add them you will get erratic behavior from the picaxe, and dont ask later "Why my circuit do strange things"? Because the answer will be you did not add the resistors.
    There is many pages on the picaxe forum of people leaving the resistors out and asking why the circuit wont work.

    As a rule of thumb for you, dont go smaller than 1mm for your track sizes while you are starting out making boards, as you get more advanced and understand your ability you may be able to go smaller where need be, but keep the bigger tracks where space is not an issue.

    Pete.
     
  3. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    Ah I guess I can't make any assumptions when I am treating the PIC as a black box. Right I shall add the resistors and the decoupling caps and shall post the circuit on here as well.

    Fouad.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2

    Okay, I have now added the resistors and the decoupling caps. The thing that I am unsure about is how to connect up the resistors so that the PIC will be in "Out" mode instead of "PROG" mode. I think that when it's in "Out" mode pins 2 and 3 on the header has to be connected together (and this just forming a simple series circuit). Though I am unsure of this (please refer to page 26 of the PICAXE manual).
     

    Attached Files:

  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Check the LM311 datasheet, pin 7, collector out is o/c, usual to add a pull up resistor to +Vs, a 4k7.
     
  7. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    eh? I don't know what you mean. The output (pin 7) of the LM311 should go to V+ through a 4.7k pull up resistor? I can't find that in the data sheet (why would I need to connect a pull up resistor to the output?)
     
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    The output pin #7 on the LM311, is only a transistor collector output.
    Without a suitable pull up resistor the output will never go high.
    Look at the applications in the datasheet for examples

    EDIT:
    On some smaller PIC's they have weak internal pull ups, which the program has to enable, a weak pull would mean an external pull up is not required.

    I do not use Picaxe, so I am not sure which PIC types they use.?

    EDIT2:
    12F683 pull ups.
     

    Attached Files:

    Last edited: Jul 5, 2011
  9. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    Very good point Eric.

    I have not paid close attention to the circuit design and more to the help with development of the circuit board.

    A external pullup as Eric has recommended is a good addition and will not hurt the circuit even if there is internal pullups, which i do not think there is.

    Add the 4K7 resistor as a pullup to ensure the issue is covered.

    As Eric has said its not the opamp that needs the pullup, its the picaxe that requires it to give a distinct change in output from the LM311.

    For referance sake the 08m picaxe is based on the Pic 12F683 chip.

    Pete.
     
    Last edited: Jul 5, 2011
  10. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    Hello,

    Yeah I shall add that to the output I guess. I dont quite understand exactly WHY though... is it to do with the PIC having to draw current from the OP-AMP? hmm...
     

    Attached Files:

    Last edited: Jul 5, 2011
  11. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    Your circuit board design looks much better with the use of bigger tracks, and the current changes.

    One thing i always do is to bring unused pins of components out on a track with a pad at the end, the reason is, often a circuit design evolves, and the need to a extra add on circuit is required so access to spare pins is often very handy.

    When you think about it, the cost is no greater to leave the copper behind on the board as it is to remove it.
    At the end of the day it all comes down to design techniques that you learn over time or is shared by others more experienced in the process.

    Pete.
     
  12. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    Your circuit change is wrong.

    The 4K7 resistor goes from pin7 in your earlier circuit to the 5v+ track.

    Hence the ....pullup expression, it pulls the output to 5v+ when the tranistor in the LM311 ts switched off.

    The picaxe needs to see a change in voltage on the input pin between 0 volts and 5 volts, when the LM311 is switched on pin 7 it will be 0 volts, but when it is switched off there is nothing to pull the line high so the picaxe will still only see 0 volts on the input pin, hence the pullup resistor, when the LM311 is switched off the pullup takes the input pin of the picaxe high, giving a 0 to 5v change on the input pin of the picaxe.

    If you dont understand then email me the express art work and i will change it to be correct for you.

    Pete.
     
  13. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    Thanks Pete!

    I have now added the track pads at the end of the unused pins in case I need them (keep these little tips coming, I can't easily find them anywhere else ;-) )
     

    Attached Files:

  14. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    AH, just saw this. Yeah I was thinking it should go up to the V+ buut...donno I guess I find the Circuit Theory part of it a little hard to understand. I WILL get it, though I need to look at the LM311 circuit in more detail...
     

    Attached Files:

    Last edited: Jul 5, 2011
  15. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    Ok there. Now the New circuit is attached to the above post. Hmm..Wonder what else I'm missing...
     
  16. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    Its nice to see you listen to advice given, i often feel i am picking at someones good work, but these are the little tips you learn when prototyping a board, as it not always things goes as originally planned, and to give a option of future change is always a good foresight.

    There is atleast 1 pin on the opamp you can also do the same with.

    Pete.
     
  17. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    Woops, didnt see that.

    Alrighty, done that now (can't find any space for the last pin on the op-amp though..)
     

    Attached Files:

  18. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    OK, that looks better.

    Think of it like a switch, when the switch is off the input pin on the picaxe is connected to nothing or floating as it is called.
    So when the LM311 is not on the input to the picaxe is really connected to nothing, so we have a pullup to connect it to 5v+, when the LM311 switches on it sinks the 5v+ from the resistor to ground, pulling the input low.

    So the function is the resistor pulls the picaxe input high and the LM311 pulls the picaxe input low, this gives a distinct high low switching of the input pin.

    Pete.
     
  19. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    Not that it is important, but you could move a couple of tracks over and bring to last pin on the opamp out as you have the previous pin.

    My whole point was to get you to look at the circuit design, and take a view of ....leave no man behind...meaning the unused pins.

    Pete.
     
  20. SABorn

    SABorn New Member

    Joined:
    Dec 28, 2010
    Messages:
    624
    Likes:
    8
    Location:
    Adelaide
    One more thing that anoys me.............put some bigger pads in for your motor connections. (getting picky now)
     
  21. fouadalnoor

    fouadalnoor Member

    Joined:
    Oct 5, 2008
    Messages:
    270
    Likes:
    2
    Also now to try to explain the Pullup resistor...


    Looking at this data sheet: http://www.rapidonline.com/netalogue/specs/82-0208.pdf

    Q15 will ensure that when its ON the output will go to ground through Q16. This cannot happen if there is no pullup resistor connecting the collector of Q15 to V++.

    emm hmm.. still confused a little...too many transistors!
     

Share This Page