0% found this document useful (0 votes)
58 views

Self Internet Notes

The document discusses pull-up and pull-down resistors used with microcontroller input pins. Pull-up resistors pull the input high when not connected to a signal, while pull-down resistors pull the input low. The MCU uses the PxREN register to enable/disable these resistors and the PxOUT register to select between pull-up or pull-down behavior. Configuring the appropriate resistor avoids floating inputs when nothing is connected.

Uploaded by

Farhan Aziz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Self Internet Notes

The document discusses pull-up and pull-down resistors used with microcontroller input pins. Pull-up resistors pull the input high when not connected to a signal, while pull-down resistors pull the input low. The MCU uses the PxREN register to enable/disable these resistors and the PxOUT register to select between pull-up or pull-down behavior. Configuring the appropriate resistor avoids floating inputs when nothing is connected.

Uploaded by

Farhan Aziz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

An emulator is a hardware device or software program that enables one computer system (also

known as a host) to imitate the functions of another computer system (known as the guest). It
enables the host system to run software, tools, peripheral devices and other components which
are designed for the guest system.

Difference between Harvard and Von Neumann computer architectures


There are basically two types of digital computer architectures. The first one is called Von
Neumann architecture and later Harvard architecture was adopted for designing digital
computers.

Von Neumann Architecture:

 It is named after the mathematician and early computer scientist John Von Neumann.
 The computer has single storage system(memory) for storing data as well as program to
be executed.
 Processor needs two clock cycles to complete an instruction.Pipelining the instructions is
not possible with this architecture.
 In the first clock cycle the processor gets the instruction from memory and decodes it. In
the next clock cycle the required data is taken from memory. For each instruction this cycle
repeats and hence needs two cycles to complete an instruction.
 This is a relatively older architecture and was replaced by Harvard architecture.
Harvard Architecture:

 The name is originated from "Harvard Mark I" a relay based old computer.
 The computer has two separate memories for storing data and program.
 Processor can complete an instruction in one cycle if appropriate pipelining strategies are
implemented.
 In the first stage of pipeline the instruction to be executed can be taken from program
memory.In the second stage of pipeline data is taken from the data memory using the decoded
instruction or address.
 Most of the modern computing architectures are based on Harvard architecture.But the
number of stages in the pipeline varies from system to system.
Cache Memory
Definition - What does Cache Memory mean?
Cache memory is a small-sized type of volatile computer memory that provides high-
speed data access to a processor and stores frequently used computer programs,
applications and data. It is the fastest memory in a computer, and is typically integrated
onto the motherboard and directly embedded in the processor or main random access
memory (RAM).

Techopedia explains Cache Memory


Cache memory provides faster data storage and access by storing instances of
programs and data routinely accessed by the processor. Thus, when a processor
requests data that already has an instance in the cache memory, it does not need to go
to the main memory or the hard disk to fetch the data.
Cache memory can be primary or secondary cache memory, with primary cache
memory directly integrated into (or closest to) the processor. In addition to hardware-
based cache, cache memory also can be a disk cache, where a reserved portion on a
disk stores and provides access to frequently accessed data/applications from the disk.
Clock System and Low Power Modes of MSP430
This is a brief introduction into the clock system and low power modes supported
by MSP430x2xxxseries microcontrollers (like MSP430G2553).MSP430 microcontroller
is designed for energy constrained applications which should operate reliably over long
period of time with as little power as possible like Wireless sensor networks,body
worn medical devices,measuring instruments etc.In order to address the conflicting
requirements of fast processing and low power consumption,Designers
of MSP430 created multiple clock sources and signals which can be configured to suit
conflicting requirements of various applications.

A simplified block diagram of the MSP430x2xxx series is given below.


Clock Sources (oscillators) of MSP430

Basic Clock System provides the required clocks to the MSP430x2xxx devices.Most
MSP430 microcontrollers have 4 clock sources to produce fast and slow clocks.The
main clock sources (oscillators) of MSP430x2x family are

LFXT1CLK - It is a crystal powered low/high frequency oscillator that can work with
either a 32KHz standard watch crystal,standard crystals that operate in the MHz range
or external clock sources (400KHz -16MHz range).Please note that,not all clock
features are supported on all msp430x2xxx devices.For eg: LFXT1CLK of
MSP430G2553 supports only the low frequency mode.You can only connect a 32KHz
watch crystal to the oscillator inputs,higher frequency crystals are not supported.

XT2CLK -This is an optional high frequency oscillator that can be used with standard
crystals,resonator or external clock sources in the 400KHz to 16MHz range.Please note
that XT2 is absent in MSP430Gxxx series like MSP430G2553.

DCOCLK - DCO is an integrated Digitally Controlled Oscillator which do not use any
external crystals.The DCO can generate a wide variety of frequencies ranging from few
100 kilo hertz to 10's of MHz.The oscillator has a first startup time and is the default
clock of the MSP430 after reset.One problem with DCO is that clock frequency is
temperature dependent.

VLOCCLK - this is a very low power/low frequency internal oscillator than can produce
a frequency of12 KHz.

Clock Signals of MSP430

MSP430 produces 3 different clock signals using a combination of the above mentioned
oscillators.These clock signals can be routed to various peripherals
like CPU,Timers,ADC etc depending upon the requirements.The 3 clock signals are

MCLK - Known as Main Clock.It is a fast,high frequency clock usually used by the
CPU or other fast components like ADC10,ADC12,Watch Dog Timer (WDT).MCLK can
be sourced either from LFT1CLK,DCO,VLO or XT2 oscillator (if it is present).You can
divide the clock signal by 1/2/4/8 using the internal divider.

SMCLK - Known as Sub Main clock.It can be sourced either from LFT1CLK,DCO,VLO
or XT2 oscillator (if it is present).You can divide the clock signal by 1/2/4/8 using
the internal divider.

ACLK - Known as Auxiliary Clock is a slow, low frequency clock(12 KHz or 32KHz).It
can only be sourced from LFT1CLK or VLO.You can divide the clock signal by 1/2/4/8
using the internal divider. ACLK is active in all Low power modes except LPM4.
Low Power Modes of MSP430

To conserve power, MSP430 spends most of its time in sleep and periodically wakes up
to perform some operation and again goes back to sleep.MSP430 has 5 low power
modes named as LPM0 to LPM4 .The table below shows which clocks are active and
which are disabled in various low power modes.

LPM0 - Both CPU and MCLK are disabled.SMCLK and ACLK remain active.Peripherals
which use SMCLK and ACLK also remain active.

LPM1 - Both CPU and MCLK are disabled.DCO(digitally controlled oscillator) is


disabled.SMCLK is not available if it is sourced from DCO.ACLK remains active.

LPM2 - CPU,MCLK,SMCLK and DCO are disabled,ACLK remains active

LPM2 - CPU,MCLK,SMCLK,DCO and DC generator are disabled,ACLK remain active.

LPM4 - All the clocks including ACLK are disabled in this mode.The controller
can only be waken from this mode by an external interrupt.This mode consumes
the least power compared to all other modes.
Fig 2-10 Operating Modes
PxREN register, Pull up/down resistors

Now, after we direct a pin towards INPUT, and when there is no actual input given,
what value of input does the MCU take? The input value is neither HIGH not LOW, it is
FLOATING. To eliminate this problem =, we use a pull up/ pull down resistor.

Pull up resistor: A pull up resistor pulls the input to HIGH when it is floating. That
means, the input value will be initially HIGH. Here, forget the concept that input is
HIGH only when a button is pressed. When a pull up resistor is enabled for a button, the
input value will be HIGH when the button is NOT PRESSED. When the button is
PRESSED, the input value becomes LOW. So, we have to alter the conditions we give in
the code so that the corresponding code is executed when the button is
PRESSED. It should not be generalised that HIGH = BUTTON PRESSED or vice
versa.

A pull up resistor. When the switch is not pressed, we can see that the input is taken as
Vcc (HIGH). When the switch is pressed, the input gets to LOW. Note that the other
end of the switch is connected to GROUND not Vcc, and the resistor’s end is
connected to Vcc.

Pull down resistor: A pull down resistor works the opposite way of the pull up
resistor. When no external input is provided, the input value is pulled down to LOW,
and when the actual input is provided (say, button is pressed), the input value becomes
HIGH.

A pull down resistor. When the switch is not pressed, the input is taken as LOW, and
when the switch is pressed the input is taken as HIGH. Note that the other end of
the switch is connected to Vcc, and the resistor is connected to ground.

PxREN register:
To enable/disable the pull up/down resistor, we use the PxREN register.

If PxREN is 0, the pull up/down resistor is disabled.

If PxREN is 1, the pull up/down resistor is enabled.

By default, the pin 1.3 (connected to the in built button on the MCU), the pull up
resistor is enabled when P1REN is 1 for that corresponding pin.

Configuring the resistor:

What if you want to use a pull down resistor instead of the default pull up resistor?
You can choose the resistor to pull up/down using the PxOUT register. Note that we are
using pull up/down resistors for pins that are configured towards input. So using the
PxOUT register here doesn’t provide an output but configures the pull up/down resistor.

If PxOUT=0, pull down resistor is enabled.

If PxOUT=1, pull up resistor is enabled.

You might also like