程序代写代做代考 22/08/2013

22/08/2013
Embedded Systems Design ELEN90066
Lecture 8 Crystals and PCBs
David Jahshan
Notes from last lecture
• Driving LEDs
• PWM of backlights via a MOSFET
• ADC wiring up
• SS should not be used as an input. If it is an input it will force the SPI to be in slave mode. We require it in master mode. You can use SS as an output.
Example exam question
• Why don’t you drive the backlight of the LCD directly from the output of the ATMEGA16
• Why would you put a 15 ohm resistor in series with the MOSFET’s gate?
Schematic to PCB
• You import your schematic into the PCB editor.
• This process adds all the physical footprints for each part on your schematic and adds a net for each pin of that part.
• The part appears as a rats nest.
• Your task is to layout the parts so that the rats nest is as neat as possible.
PCB layout strategies
• ForgoodPCBdesign80%ofyourtimeshouldbe positioning parts, 20% on running the wires. Could spend 6 hours or more positioning components
• Youhavecompetingpriorities,positionofparts so that it is ergonomic
• Positionofpartssothathighfrequencysignals are as short as possible
• Positionofpartssothathighcurrentwiresareas short as possible.
Location of parts
• Technicallyspeakingyoushouldnothaveany SMD parts on both sides of the board.
• Itcoststwiceasmuchtopopulatebothsidesof the board, and need to use glue.
• Howeverwhenyouhavebuttonsyouprobably should put them on the other side of the board.
• YoushouldneverputSMDpartsunderother parts. You should not have parts under the LCD or the battery pack.
• Youshouldalwaysthinkifyoucanassemblethe PCB, no interlocking parts.
1

22/08/2013
Layout strategies
• Usually you lay out all the high speed lines first, (or sensitive analogue lines).
• In our case we have a number of large constraints, the LCD, battery pack and buttons.
• Need to tackle these first.
• Then uC, Crystal, Decoupling caps, RAM, the rest.
Crystals
• Used to generate a clock for the microcontroller.
• All transfers between registers occur on clock edges.
• No clock, no data, most critical part of the circuit.
How they work
• Piezoelectric materials create electric charge when squeezed
• Apply a voltage and the material will distort
• Piezoelectric materials can be cut very
precisely
• They are an electromechanical system
• Symbol
Parallel Oscillator
• In our project we will be using the crystal as a parallel oscillator.
• Size of the capacitor for our crystal is 18pf.
• Different crystals require different capacitors. Xtal1 Xtal2
Layout of XTAL
• Crystal is the highest frequency device in your system, and it is also an analogue system so it is sensitive to noise.
• Should be the first part that you place in your PCB layout.
Decoupling Capacitors
• Decoupling capacitors should be as close to each power pin as possible.
• These are the second highest frequency parts, they should be placed second as close to the related power pin as possible.
• They should never be placed as a group at a random location on the PCB.
2

22/08/2013
JTAG
• JTAG is essential to program your PCB, make sure it is wired up as follows:
PCB tracks
• Widerthebetter,lessinductance
• Highcurrentwiressuchasinthestepup converter and VCC lines should be thicker than the other tracks.
• Highcurrenttrackstakethepathofleast resistance.
• Highfrequencytrackstakethepathofleast inductance
• Asolidgroundplaneisessentialforagood circuit. See if you can route all the signals on one side and have a solid ground plane on the other.
Touch screen
• I do not answer any questions about how to wire up the touch screen.
• You do not require any additional parts other than the touch screen and the connector.
• If you ask me about the touch screen, my answer will be I do not answer any questions about the touch screen.
Next Lecture
• We will go through the marking sheet for the schematic to make sure everyone knows how to go through and mark their own schematic.
• Discuss common mistakes made on PCB routing.
3