PIC16 Microcontrollers, Unit 4, Ch 2.3-2.4; Memory, Stack, and SFRs

Clint Halsted
22 Aug 201219:16

Summary

TLDRIn this lecture, Clint Halstead introduces microprocessors, focusing on program memory, the stack, data memory, and special function registers using the book 'Designing Embedded Systems with PIC Microcontrollers' by Tim Wilmshurst. He explains flash memory, program counters, the stack's LIFO structure, and their roles in executing and storing code. Halstead also covers SRAM, special function registers, and their use in interfacing with peripherals. He concludes by discussing the configuration word, its significance in setting microcontroller features, and its protection mechanisms against code theft.

Takeaways

  • 📚 The lecture is an introduction to microprocessors, specifically using 'Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Second Edition' by Tim.
  • 💾 The program memory is composed of non-volatile flash memory, which retains the program code even when power is removed from the chip.
  • 🔢 The program memory space ranges from 0 to 3FF, providing approximately 1000 memory locations for storing code.
  • 👉 The program counter is essential as it points to the next instruction in the program memory and starts at address zero upon power-up or reset.
  • 📚 Section 2.3 and 2.4 of the book are being discussed, which cover program memory, stack, data memory, and special function registers.
  • 🔠 The stack is a part of SRAM and operates on a LIFO (Last In, First Out) basis, crucial for function calls and preserving the state of the program counter.
  • 🔄 The stack facilitates the 'push' and 'pop' operations, which save and restore the program counter's state during function calls.
  • 🔩 Data memory is stored in SRAM, which is volatile and loses its values when power is removed, typically used for values set during program execution.
  • 🌐 Special function registers are used for interfacing with peripherals, controlling aspects such as timers, port directions, and EEPROM memory.
  • 🛠 The configuration word, found in program memory, determines certain operating features of the microcontroller and can be set during the programming process.
  • 🔒 Code protection bits within the configuration word can prevent unauthorized reading of the microcontroller's program memory, protecting intellectual property.
  • ⚙️ Oscillator configuration is vital as it dictates how the microcontroller operates, with options for internal (RC) and external oscillators.

Q & A

  • What is the primary function of program memory in a microcontroller?

    -The primary function of program memory in a microcontroller is to store the code, including assembler language code and C code, which the microcontroller executes.

  • Why is program memory often implemented using flash memory?

    -Program memory is often implemented using flash memory because it is non-volatile, meaning it retains the stored values even when the power is removed from the chip.

  • What does the program counter in a microcontroller do?

    -The program counter in a microcontroller points to the next instruction to be executed. It is set to zero upon power-up or reset, indicating the starting point of the code execution.

  • What is the significance of the stack in a microcontroller?

    -The stack in a microcontroller is used to store the return addresses during function calls, allowing the program to resume execution at the correct location after the function completes. It operates on a LIFO (Last In, First Out) principle.

  • How does the stack assist during function calls in a program?

    -During function calls, the current value of the program counter is pushed onto the stack to remember the current location in the code. After the function executes, the program counter is popped with the stored address, resuming the code execution from where it left off.

  • What is the role of the special function registers in data memory?

    -Special function registers in data memory control various aspects of the microcontroller's operation, such as timers, the program counter, status, file select for indirect addressing, and port control.

  • Why is SRAM considered volatile memory?

    -SRAM is considered volatile memory because it loses its stored values when power is removed from the chip, unlike non-volatile memory which retains values after power loss.

  • What is the purpose of the TRISC register in a microcontroller?

    -The TRISC register controls the direction of Port C on a microcontroller, determining whether the port operates as an input or output.

  • How does the configuration word in a microcontroller affect its operation?

    -The configuration word in a microcontroller determines certain operating features, such as code protection, power-up configuration, watchdog timer settings, and oscillator selection. It is set during the programming process and cannot be changed during normal operation.

  • What is the purpose of code protection bits in the configuration word?

    -Code protection bits in the configuration word prevent unauthorized reading of the microcontroller's program memory, protecting the intellectual property of the software developed for the microcontroller.

  • Why is it important to check the watchdog timer and oscillator settings when troubleshooting a microcontroller?

    -It is important to check the watchdog timer and oscillator settings when troubleshooting a microcontroller because incorrect settings can prevent the microcontroller from operating correctly. The watchdog timer may need to be disabled, and the oscillator must be correctly configured for the microcontroller to function.

Outlines

00:00

📘 Program Memory and Stack Overview

This paragraph introduces the concept of program memory in microprocessors, specifically focusing on the PIC microcontroller. It explains that program memory is composed of non-volatile flash memory, which retains the code even when power is removed. The memory is addressed from 0 to 3FF, providing approximately a thousand memory locations for code storage. The paragraph also introduces the program counter, which points to the next instruction in the program memory, and the stack, which is likened to a LIFO (Last In, First Out) structure used for function calls. The program counter's role in starting at address zero and the importance of the interrupt service routine starting at address 004 are also highlighted.

05:02

🔧 Understanding the Stack and Data Memory

The second paragraph delves into the functionality of the stack, which is a part of the SRAM and operates on a LIFO principle. It is used to store the program counter during function calls, ensuring that the program can return to the correct location after the function is executed. The explanation uses the analogy of stacking plates to clarify the concept of the stack. The paragraph also discusses data memory, which is volatile and stored in SRAM, and its role in setting values during program execution. Special function registers are introduced, which are crucial for the microcontroller's operation, including timer controls, status registers, and port controls.

10:08

🔄 Special Function Registers and Peripheral Interaction

This section explains the role of special function registers in interfacing with peripherals. It describes how these registers act as an interface between the microcontroller's core and external devices, such as LEDs or LCD panels. The paragraph outlines the process of configuring peripherals through software to operate in various modes and the importance of special function control registers in this process. It also touches on the data transfer process involving special function registers and the need for further control data during operation.

15:09

⚙️ Configuration Word and Microcontroller Settings

The final paragraph discusses the importance of the configuration word in determining the microcontroller's operating features. It is highlighted that the configuration word is written during the programming process and cannot be accessed during normal operation. The paragraph explains the various settings that can be adjusted in the configuration word, such as code protection bits to prevent software theft, power-up enable bits, watchdog timer settings, and oscillator configurations. The importance of correctly setting these options during the programming phase is emphasized, and an example of checking for an internal RC oscillator in the datasheet of the 16F-84A microcontroller is provided.

Mindmap

Keywords

💡Microprocessors

Microprocessors are the central processing units of computers and other electronic systems, responsible for executing program instructions. In the video, microprocessors are the focus as the speaker introduces the concept and its significance in embedded systems design, using the book 'Designing Embedded Systems with PIC Microcontrollers'.

💡Program Memory

Program memory, also known as flash memory in the context of microcontrollers, is non-volatile storage that retains the program instructions even when power is removed. The script describes how program memory is organized and its importance for storing the assembler or C code, with specific reference to the memory addresses ranging from 0 to 3FF.

💡Stack

The stack is a special area of memory in a microcontroller that follows a LIFO (Last In, First Out) principle. It is used to store the return addresses for function calls, allowing the program to resume execution at the correct location after the function completes. The script explains the stack's role in function calls and its operation with push and pop actions.

💡Program Counter

The program counter is a register in a microcontroller that holds the memory address of the next instruction to be executed. The script mentions that the program counter starts at address zero upon power-up and is crucial for the sequential execution of code, with specific mention of the interrupt service routine starting at address 004.

💡Data Memory

Data memory, often stored in SRAM (Static Random-Access Memory), is volatile and loses its contents when power is removed. It is used to store data that the program manipulates during execution. The script discusses data memory's role and its distinction from program memory, with examples of general-purpose registers and special function registers.

💡Special Function Registers

Special function registers are dedicated registers in a microcontroller used to control and interface with various hardware features and peripherals. The script explains that these registers, such as TRISA and PORTA, are crucial for controlling input/output operations and are part of the data memory section.

💡Peripherals

Peripherals are external devices or components that connect to a microcontroller to extend its functionality, such as LEDs, LCD panels, or sensors. The script describes how peripherals interface with the microcontroller through special function registers and data transfers, emphasizing the role of these interfaces in connecting the microcontroller to the external world.

💡Configuration Word

The configuration word is a set of bits in a microcontroller's program memory that determines certain operating features and is written to during the programming process. The script highlights the importance of the configuration word in setting up the microcontroller's operation, such as code protection, power-up configuration, and oscillator settings.

💡Code Protection

Code protection is a feature that prevents unauthorized reading of the program memory, protecting intellectual property and ensuring that the developed software cannot be easily copied. The script discusses the role of code protection bits in the configuration word and their importance in safeguarding the software during manufacturing.

💡Oscillator

An oscillator is a component that provides the clock signal necessary for the microcontroller's operation. The script mentions the importance of configuring the oscillator correctly, with options for internal (RC) and external oscillators, and highlights common issues related to oscillator configuration when troubleshooting a microcontroller.

Highlights

Introduction to microprocessors and usage of the textbook 'Designing Embedded Systems with PIC Microcontrollers'.

Overview of program memory and stack, sections 2.3 and 2.4 of the textbook.

Explanation of flash memory as non-volatile memory used for program storage.

Program memory space details with user memory locations from 0 to 3FF, allowing storage of up to 1000 instructions.

Introduction to program counter, stack, and program memory (flash).

Description of how the program counter points to the next instruction in program memory.

Explanation of interrupt service routines starting at address 004.

Details about the stack functioning as last in first out (LIFO) memory.

Explanation of how the stack is used during function calls and returns.

Introduction to data memory and special function registers (SFRs).

Description of SRAM as volatile memory for data storage.

Details about data memory sections, general-purpose registers, and special function registers.

Explanation of how to access banked memory sections using the bank select bit.

Overview of special function registers for controlling peripherals and data transfers.

Introduction to configuration word for setting microcontroller operating features during programming.

Explanation of code protection bits to prevent software theft.

Details about power-up enable bits, watchdog timer, and oscillator configuration.

Exercise suggestion to check the datasheet for the PIC16F84A for internal RC oscillator presence.

Next section to cover topics from 2.5 to 2.7 of the textbook.

Transcripts

play00:00

hello this is Clint Halstead and this is

play00:04

introduction to microprocessors I'm

play00:08

using again the designing embedded

play00:10

systems with pic microcontrollers

play00:12

principles and applications second

play00:13

edition with Tim well first today we're

play00:18

going to be talking about program memory

play00:21

and the stack will be going over section

play00:23

2.3 and 2.4 of the book also will cover

play00:27

data memory and special function

play00:29

registers interfacing with peripherals

play00:32

and talk about the configuration word so

play00:41

the program memory and stack looks

play00:48

similar to this diagram the program

play00:51

memory is made up out of flash flash

play00:53

memory which is non-volatile memory

play00:56

which means that you know when the power

play00:59

is removed from your from the chip then

play01:02

it remembers the values the program the

play01:08

program memory is a section of the chip

play01:12

where you're you're actually your code

play01:14

exists so your assembler language code

play01:16

where your C code exists in this section

play01:19

here called called the flash ok and you

play01:26

can see here that we have from 0 to 3 FF

play01:31

of this user memory space program memory

play01:35

space your instructions are here each

play01:40

you have each memory address location

play01:43

even though they're not all shown these

play01:46

numbers go from 0 0 0 0

play01:49

hex - 0 0 0 1 0 0 2 0 0

play01:55

0:04 and it just continues to go on up

play01:57

even though they're not labeled so you

play01:59

have a thousand memory locations in

play02:04

order to store your code notice that

play02:10

three F F remember F F is represents

play02:15

eight ones so f f hex it represents

play02:19

eight binary ones which also represents

play02:22

256 decimal so 256 and notice that we

play02:27

have we're going to have four of those

play02:29

because we have zero one two and three

play02:31

because it goes all way up to two three

play02:34

F F that means it had you have 0 F 0 F F

play02:38

which is 256 and you have one F F 2 F f

play02:41

+ 3 F F so that's a 1000 you know if you

play02:47

take 256 times 4 it gives you roughly a

play02:50

thousand so you have a thousand

play02:52

different memory locations in order to

play02:54

store your code so as long as your code

play02:57

isn't longer than that then it will fit

play02:58

in this space if you need more code

play03:00

space than you have to go up to a part

play03:03

of different pic microcontroller that

play03:05

has more program memory space or flash

play03:10

so also notice here that we have we have

play03:14

several features of the program memory

play03:17

and the stack first thing we have is

play03:20

there's three pieces three main pieces

play03:22

we have the program counter we have the

play03:25

stack which we'll talk about later and

play03:27

then we have or we'll talk about in just

play03:30

a few minutes so we have a program

play03:31

counter the stack and then we have the

play03:34

program memory which is the flash now

play03:37

the program counter points to the

play03:41

program memory so the the program

play03:44

counter contains your next instruction

play03:47

so when powers reset on the chip or when

play03:51

you first powered up the program counter

play03:53

is set to zero which means it's pointing

play03:55

to the very first location which is zero

play03:59

and then this is where your code has to

play04:01

start

play04:04

so also notice you have a also have an

play04:09

interrupts interrupt service routine

play04:11

that must start at zero zero four we'll

play04:14

talk about that later on in the book but

play04:16

not today

play04:18

so if you have an external pin that's an

play04:21

interrupt if that pin goes high

play04:23

it creates an interrupt and then your

play04:25

code will instantly go to this place and

play04:27

so you need to put any sort of interrupt

play04:29

code here so typically what people do is

play04:32

they if they're not going to use

play04:34

interrupts they they reset to zero and

play04:36

then they put a go-to instruction as the

play04:38

first instruction so say go to down here

play04:41

and then you can start your code from

play04:42

that point so you need to skip this

play04:45

peripheral interrupt vector so that's

play04:47

just a little tip we'll learn again more

play04:50

about that later next thing that we want

play04:53

to notice here is we've all read about

play04:57

this a program must start here at zero

play04:59

and the program counter points to the

play05:02

locations in the program memory so the

play05:04

program counter points here now the

play05:07

question is what is this stack and the

play05:09

best way I can describe the stack is

play05:12

it's just a you've got some SRAM here

play05:16

that will the program counter will be

play05:19

copied to this stack and the stack is

play05:23

just some some RAM some memory and this

play05:26

memory is called a LIFO the book talks

play05:29

about on page 37 it's a last in first

play05:31

out last in first out just means that

play05:34

the last thing that you put in the stack

play05:36

is the first thing that comes out so if

play05:41

you for example if you anytime describe

play05:45

it as being stacking plates you know if

play05:47

you stack a bunch of plates the last

play05:48

plate you put down is also the first

play05:50

plate you're gonna pick up when you grab

play05:52

it you're not going to grab the plate

play05:53

from the bottom you're gonna grab it

play05:55

from the top so that's another reason

play05:57

they call it a stack and the best way I

play05:59

can describe the stack is the stack is

play06:01

used during function calls so when

play06:03

you're in here using your program and

play06:05

you're you're running sequentially in

play06:07

your code if you have a go-to statement

play06:10

or a call statement I mean

play06:12

rather a call statement what a call

play06:15

statement does is it takes the he

play06:18

remembers the place that you're at the

play06:19

current value of the program counter

play06:20

let's say that you I think about it also

play06:24

as a reading a book you can think of it

play06:26

as flipping through the pages of a book

play06:27

and each page of the book you know how

play06:30

can represent the address to your at so

play06:34

let's say you're going out through here

play06:35

and you're executing instructions to

play06:37

address twenty you can think of that as

play06:41

being reading through a book and then on

play06:43

page 20 of the book it says well I want

play06:47

you to go to page 50 so if you go to

play06:52

page 50 you need to remember that you're

play06:55

on page 20 so you need to remember that

play06:57

you're at address location 20 so if you

play07:00

jump down here to 50 you execute the

play07:04

instructions at 50 but then when you get

play07:06

a return statement you have to remember

play07:09

where you you have to go back to so you

play07:11

have to go back to 20 so that's kind of

play07:14

a way to remember it's the same way when

play07:16

you're reading a text book when you're

play07:17

reading along and there's a reference to

play07:19

another page you have to go to the other

play07:21

page but you want to also remember where

play07:23

you are at so that you can continue

play07:25

reading your text later on so that's

play07:28

kind of the way it works is is that the

play07:31

the stack when there's a call function

play07:34

it it jumps to the location where your

play07:38

your program is that in the in the your

play07:42

in your code so it's going to jump to

play07:44

the new location but it needs to

play07:47

remember so it pushes that we call that

play07:49

pushing divided to the stack so let's

play07:52

say that you're you're executing code to

play07:54

get to 20 and then you get a call

play07:56

function to another location it's going

play07:58

to push that location of 20 onto the

play08:00

stack now you're going to go execute

play08:02

your code down here at a different

play08:03

location and then when you get a return

play08:05

it's going to what we call pop it's

play08:08

going to pop that 20 value back to the

play08:10

program counter so that your you can go

play08:13

back and continue executing your code so

play08:15

it's called when you put something on

play08:17

the stack or when you put the program

play08:19

counter on the stack it's called pushing

play08:20

when you pull it back off then it's

play08:23

called

play08:23

popping so push and pop okay and go

play08:31

ahead and read the textbook if you need

play08:32

more information on that the next thing

play08:36

we're talking about is data and memory

play08:38

and special function register map now

play08:42

the data memory is stored in the SRAM

play08:44

portion SRAM is volatile memory which

play08:48

means that these values are lost

play08:52

you know once the powers are moved from

play08:54

the chip okay so these do not get

play08:57

remembered so that basically means your

play09:00

your code your code typically sets these

play09:04

values as the as the program is running

play09:06

so as the program is running here and

play09:08

your non-volatile memory in your flash

play09:11

you're going to code that so that it

play09:13

sets these values the way you want so it

play09:15

doesn't really matter that these values

play09:18

go away when power goes away because

play09:20

your program is going to control these

play09:23

registers anyway so from that

play09:26

perspective you know you don't really

play09:29

need to worry about it so you don't

play09:31

really need this to be non-volatile

play09:32

memory but anyway these are called your

play09:35

special function registers so your your

play09:38

data memory section is from 0 to 7f but

play09:45

whether or not this part down here is

play09:47

grayed out but pins on what type of chip

play09:50

you have so if you have a larger chip

play09:52

then you may have memory space all the

play09:54

way down to 7f H or 7f hex but for the

play10:01

16 f-84 we only have from 0 to 4 F okay

play10:08

so means we have 68 general-purpose

play10:10

registers if we had and notice that it

play10:14

goes from it goes on both side you have

play10:16

two banks so if you had a larger chip

play10:19

that had all of these available than you

play10:21

would have up to 256 because FF

play10:24

represents 256 in 7f preferences 128 so

play10:31

Bank 0 has 128 locations my coin has

play10:35

another hundred twenty-eight locations

play10:36

if you add those together it gives you

play10:38

256 locations but notice that the first

play10:43

few from zero to zero B are reserved the

play10:48

rest of these you can write whatever

play10:49

values you want to these and you can

play10:52

define them to what you want but the

play10:53

first 0 to 0 0 to 0 B are called special

play10:59

function registers this is for the timer

play11:02

this is for the this is the program

play11:05

counter low value this is the status

play11:06

register this is the file select

play11:09

register for indirect addressing a

play11:11

support a which controls your your port

play11:15

a on your chip port B controls port B

play11:19

which is your pins on your chip your

play11:22

parallel port then you have EE data

play11:24

that's your key EEPROM memory location

play11:29

data and EEPROM address and then you

play11:33

have some internet interrupt registers

play11:37

then when you go to banker when you go

play11:41

to this other side to bank one you

play11:43

actually the only way you can get there

play11:44

is you have to set the bank select bit

play11:47

in the status register to 1 I believe

play11:51

that's a bit bit 5 of the status

play11:53

register you have to set two more in

play11:55

order to go over here and then once you

play11:57

get that makes a lot select register set

play11:59

then you go ahead and you you you

play12:01

address location 0 but that will give

play12:05

you a 0 so it's a little confusing but

play12:12

once you see if you have to have this

play12:13

Bank select register set to 0 to get to

play12:15

this side and you have to have the bank

play12:17

select bit set to 1 to get to this side

play12:19

over here once we do a lab we'll we'll

play12:23

understand that a little bit better so

play12:26

the option register you have to be you

play12:28

have to have the bits so like the make

play12:31

select bit set to 1 but once you do then

play12:33

you can get over here option register

play12:36

notice that some of these are the same

play12:38

so notice that the program counter low

play12:41

is the same whether I'm banks you or

play12:43

Bank 1 same with the status

play12:45

registers same with the file select

play12:47

register but notice that for the port a

play12:51

when you have the bank's select bit one

play12:55

then you have this tryst a function

play12:57

instead of port a so you have the tryst

play12:59

a controls the direction for port a so

play13:02

if you so what that means is if you want

play13:04

do you want to report any to B inputs or

play13:06

outputs so that's what's being set by

play13:08

the tryst a whether or not the port a is

play13:10

input or output because you can't really

play13:12

have both you typically have your ports

play13:15

or either one way or another it is

play13:17

possible to have a by Direction report

play13:18

but you would have to control that

play13:20

somehow through software through a

play13:22

read/write bit or something like that

play13:25

but for a lot of simple app simple

play13:27

applications they're usually either set

play13:29

to either inputs or outputs so that's

play13:32

the tryst a is how you control those and

play13:35

then your e address EE prom data you

play13:40

control with these EE control registers

play13:42

1 & 2 and so that's about it for that

play13:46

so that's your data memory and special

play13:49

function register map now when you want

play13:52

to interface with peripherals you do

play13:57

that through the special function

play13:59

control registers which means these

play14:02

registers like tryst a tryst B and then

play14:05

the data transfer special function

play14:06

register which would be port a import B

play14:08

so those are examples of this kind of

play14:11

diagram this is a generic diagram of

play14:13

showing you how do you get to the

play14:15

outside world

play14:16

you got this microcontroller core and

play14:18

you got your program space over here in

play14:20

your program code and you're wanting to

play14:23

get to this outside world which may be

play14:25

an LED or LCD panel liquid crystal

play14:29

display or a variety of other things but

play14:33

the way the interface between those the

play14:36

outside world and the internal processor

play14:38

core are your special function registers

play14:43

and your data your data so your control

play14:46

special function and your data transfers

play14:47

special function so you've got two

play14:49

registers here that you need to control

play14:51

and then you know sometimes your outside

play14:54

world you have some interrupts that come

play14:55

into your my

play14:56

processor so the peripherals can be

play15:02

configured in software to operate a

play15:03

number of modes and you do this to do

play15:07

this certain control data must be

play15:08

sitting set sit to them to set them up

play15:12

in the desired way once in use there

play15:14

will be data flow between core and

play15:15

peripheral there may still be need for

play15:19

further control data these needs are

play15:23

commonly met by means of dedicated

play15:25

memory memory registers sometimes called

play15:27

special function registers this approach

play15:30

gives a microcontroller manufacturer

play15:32

greater flexibility to extend the

play15:34

microcontroller family so now we're

play15:42

going to continue on to the

play15:43

configuration word configuration word is

play15:45

important part of the microcontroller as

play15:47

well it determines certain operating

play15:50

features of the microcontroller it is in

play15:52

program memory but cannot be accessed in

play15:55

normal operation okay so you get this

play15:58

special word in here it's written to

play16:00

during the programming process so the

play16:02

only way to control this configuration

play16:04

word is when you program the chip when

play16:07

you connect your picot 3 or pick it to

play16:10

what are we using to your processor and

play16:13

program it through your mplab software

play16:17

there's a special menu at the top where

play16:21

you can control this but this is not and

play16:25

many times you can add this some code

play16:28

some lines of code to your software

play16:31

program your assembler or C and you can

play16:34

get these bits to be changed as well

play16:35

they're called assembler directives so

play16:37

you can add these are similar directives

play16:39

at the head of your program in order to

play16:42

get these to be set but these are for

play16:44

some pretty important bits here we have

play16:48

code protect bits code protect bits will

play16:51

prevent someone from stealing your your

play16:54

software so if you spend a lot of time

play16:55

designing some software for a pig

play16:58

microprocessor or if a company does and

play17:00

then you spend you know months and

play17:03

months developing it and then you

play17:04

competitor just simply takes your chip

play17:06

and then just reads all your software

play17:08

and they can just steal your code and

play17:11

whereas you would put spend a lot of

play17:13

money developing that then they could

play17:14

just steal it so the code protection bit

play17:17

prevents them from being able to read

play17:18

that back it also prevents you from

play17:20

being able to read that back but you

play17:22

don't really need to read that back I

play17:24

guess it's not really that important it

play17:27

would be important during debug process

play17:29

but once you've got the program working

play17:31

the way you want it and in manufacturing

play17:33

and you're gonna program all these chips

play17:36

to go to sell them then you would

play17:39

probably want to enable the code

play17:41

protection so zero represents that all

play17:45

the memory is code protected so if these

play17:47

are all ones and it would there would be

play17:50

no code protection so you also have bit

play17:53

three you have a powerup enable bit you

play17:57

have a watchdog timer in a little bit

play17:58

many times the watchdog timer needs to

play18:00

be disabled when you do many things so

play18:02

this is a common thing that you would

play18:04

disable would be the watchdog timer and

play18:06

then everyone needs to know how to set

play18:08

the oscillator because the chip won't

play18:10

work if you don't have an oscillator so

play18:12

if you have any errors universe first

play18:14

start trying to use a chip I would check

play18:17

the watchdog timer and the oscillator

play18:19

the RC oscillator is the one that's

play18:21

internal to the oscillator and then you

play18:24

have these high speed options X TLP

play18:28

low-power option so these last three

play18:32

here are external oscillator options and

play18:34

the RC one is the internal oscillator if

play18:37

your processor has an internal

play18:38

oscillator not all of them do so you

play18:40

have to check your device datasheet to

play18:42

see if you have an an RC oscillator so a

play18:47

good exercise here would be to go for

play18:48

the sixteen f-84 a would be to look at

play18:51

the datasheet and tell me whether or not

play18:53

this chip has an RC internal oscillator

play18:56

if it doesn't you have to add an

play18:59

external oscillator crystal and wire

play19:04

that up and configure that that's it for

play19:07

this section the next section is going

play19:10

to cover section two point five to two

play19:11

point seven

play19:12

thank you very much

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
MicroprocessorsProgram MemoryStack MechanismPIC MicrocontrollersEmbedded SystemsDesign PrinciplesData MemorySpecial RegistersPeripherals InterfaceConfiguration WordClint Halstead
Benötigen Sie eine Zusammenfassung auf Englisch?