Professional Documents
Culture Documents
Answers
Answers
05/04/2012
Answers
128k = 128 x 1024 bytes
128 x 1024 x 8 bits
= 1,048,576 bits
Answers
Common File: Rewriting the hardware definitions
for each and every programs to be used for the
same board can be troublesome. All the
programs using the same hardware/circuit can
just include the common hardware definitions file
into the source code
05/04/2012
Answers
Serial vs Parallel: The data has to be converted to serial
form in a shift register and transmitted one bit at a time
on a single line, while parallel data is transferred 8 (or
more) bits at a time.
Answers
This function initializes the RS232 The oscillator frequency to be used is 10MHz.
The baud rate required is 9600 bps. Calculate the value of X to obtain the required
baud rate.
void init_rs232( )
{
BRGH = 1;
SPBRG = X;
TX9 = 0;
SYNC = 0;
SPEN = 1;
TXEN = 1;
CREN = 1;
SREN = 0;
TXIE = 0;
RCIE = 0;
10
}
11
12
05/04/2012
Answers
13
Answers
The conventional process is to build
prototype hardware, download the
program to the microcontroller and test it
in circuit.
Simulation allows the design to be tested
and debugged before building hardware.
The schematic can then be converted into
a netlist and a layout to produce the final
PCB without prototyping.
15
16
05/04/2012
Answers
18
Answers
19
20
05/04/2012
Answers
21
22
Answers
In a system using von Neumann architecture,
the CPU can be either reading an instruction or
reading/writing data from/to the memory. Both
cannot occur at the same time since the
instructions and data use the same bus system.
In a system using the Harvard architecture, the
CPU can both read an instruction and perform a
data memory access at the same time, can thus
be faster for a given circuit complexity because
instruction fetches and data access do not
contend for a single memory pathway.
23
24
05/04/2012
Answers
25
26
Answers
#include <htc.h>
#include <pic16f877a.h>
#define _XTAL_FREQ 20000000
// Set the oscillator frequency to 20MHz
void main( )
{
TRISC=0x00; //Port C as outputs
T2CON = 0b01010000;
// Timer 2 control register
PR2 = 0b01111111;
CCP1CON = 0b00111100; //Set to PWM mode
CCPR1L=63;
27
28
05/04/2012
Answers
29
The End
Thats all for this time.
Enjoy your time playing around with
microcontroller and interfacing
31