Embedded systems

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/70

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:07 PM on 4/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

71 Terms

1
New cards

sleep instruction

command that puts the device into a low power mode until an interrupt is generated

2
New cards

inherent addressing

nop, return, sleep

no ooperand

3
New cards

absolute addressing

goto and call

allow program to jump to another location (address) in the program

4
New cards

literal (immediate) addressing

addlw, retlw

the destination is always the working register

5
New cards

file direct addressing

instructions that access the data store - addwf, movwf

outcome stored either in the working register or back in the file

6
New cards

bit addressing

bcf, bsf, btfsc, btfss

access the specified bit in a file register

7
New cards

file indirect addressing

internal register, the File Select Register is used to store the data

to trigger, specify the null address (0×00)

to change value stored inside, use the address 0×04

8
New cards

how to load a value into the program counter using PCL and PCLATH

bits <4:0> of the PCLATH will be bits <12:8> of the PC and bits <7:0> come from the PCL.

Write to PCLATH and then write to PCL

9
New cards

how to load a value into the program counter without using PCL

write value to PCLATH if needed

use call instruction, as it takes in a 13 bit literal and the PC is also 13 bits

10
New cards

move value into working register without triggering the flags

swapf 0×21, f followed by swapf 0×21, w as swapf does not affect any status flags

11
New cards

STATUS File 0×03 bits in order

IRP, RP1, PR0, /TO, /PD, Z, DC, C

12
New cards

STATUS IRP<7>

register bank select bit for file indirect addressing

13
New cards

STATUS RP1<6> and RP0<5>

register bank select bits - switch between banks 0, 1, 2 and 3

14
New cards

STATUS /TO<4>

time out

1 = after power-up, clrwdt or sleep instruction

0 = a WDT time out occured

15
New cards

STATUS /PD<3>

power down

1 = after power-up, or by the clrwdt instruction

0 = execution of the sleep instruction

16
New cards

STATUS DC<1>

digit carry / /borrow bit

1 = carry out between the nibbles occured

17
New cards

Little endian for (0×12345678)

leftmost address stores the two LSB (0×78)

18
New cards

Big endian for (0×12345678)

leftmost address stores the two MSB (0×12) - easier to read

19
New cards

stack structure

LIFO - last in first out

20
New cards

stack purpose

hold the subroutine return addresses

stack pointer is post-incremented and pre-decremented

21
New cards

lookup table structure

ORG 0×80

NAME: addwf PCL, f

retlw ?

22
New cards

polling

continously reading a signal

while ( this != that);

23
New cards

INTCON FIle 0×0B bits in order

GIE, PEIE, T0IE, INTE, RABIE, T0IF, INTF, RABIF

1 = enabled or interrupt occured

24
New cards

INTCON GIE<7>

general interrupt enable bit

1 = enable

25
New cards

INTCON PEIE<6>

peripheral interrupt enable bit

26
New cards

UNTCON T0IE<5>

TMR0 overflow interrupt enable bit

27
New cards

INTCON INTE<4>

RA2/INT pin external interrupt enable bit

28
New cards

INTCON RABIE<3>

PORTA/ PORTB change interrupt enable bit

29
New cards

INTCON T0IF<2>

TMR0 overflow interrupt flag bit

30
New cards

INTCON INTF<1>

RA2/INT pin external interrupt flag bit

31
New cards

INTCON RABIF<0>

PORTA/ PORTB change interrupt flab bit

32
New cards

how to enable the hardware interrupt

INTCONbits.GIE = 1;

INTCONbits.INTE = 1;

33
New cards

Program store/ program memory

persistent memory

holds the bit patters that define the operation of the program

34
New cards

RAM data memory/ data store

volatile memory

holds the data being processed by the program

can contain special function registers

35
New cards

EEPROM data memory

programmer readable/ writable persistent data memory

256 bytes of data accessed via special purpose registers EECON1, EECON2, EEDATA and EEADR

36
New cards

Persistent (non-volatile) memory

type of computer memory that can retain stored information even after power is removed

EEPROM and the program store

37
New cards

volatile memory

computer memory that requires power to maintain the stored information

RAM (data store - the file registers)

38
New cards

Configure all of PORT C pins to be digital inputs

set ANSEL and ANSELH to 0 to make them digital

set TRISC to 1 to make them inputs

39
New cards

how would you write a program to divide an 8 bit number by another 8 bit number

subtract the divisor from the dividend repeatedly until a carry (/borrow) is generated and then go back one iteration to get the final solution

40
New cards

program directive

are used to configure various options in relation to the operation of the device, for things such as code protection, enabling watchdog timer and oscillator setup

gives instructions to the assembler on how the program will be assembled or organised

41
New cards

assembly language instruction

line of code that is converted into executable machine code and executed by the CPU

42
New cards

two methods of including assembly language instructions in a C program

either the asm() for a single line of code or #asm to #endasm for multiple lines of code

43
New cards

for a variable to be shared between C and Assembly

ensure both variable definitions refer to the same location in the memory and are accessed using the same symbol name

44
New cards

stack pointer

3 bit register tied to the stack which points to the next available register in the stack

45
New cards

purpose of the TMR0 register

Timer0 module register that can count clock cycles (timer mode) or count external events (counter mode)

set up using the T0IF and T0IE bits in the INTCON register

46
New cards

purpose of the PCL register

stores the lower bytes of the program counter

47
New cards

purpose of the STATUS register

used to store flags that reflect the current state of the CPU and the results of operations

48
New cards

purpose of the FSR register

file select register is used to store the address of the data in file indirect addressing (file 0×04)

49
New cards

purpose of the EEADR register

used to store the address of the EEPROM data memory location that will be accessed in the read or write operation

file 0×10D

50
New cards

purpose of the EEDATA register

used to store the data that is currently being read/ written

file 0×10C

51
New cards

OPTION_REG INTEDG bit

used to select whether the interrupt will be generated on the rising or falling edge of the signal

52
New cards

PIE2 EEIE bit

Peripheral Interrupt Enable Register 2

EE Write Operation Interrupt Enable bit

53
New cards

EEPROM

electrically erasable programmable read only memory

54
New cards

PIR2 EEIF bit

Peripheral interrupt Request Register 2

EE Write Operation Interrupt Flag bit

55
New cards

advantages and disadvantages of using lookup tables

quicker and simpler than performing the calculations + lower CPU usage

takes up more memory space, only works for predefined values

56
New cards

char

8 bits (1 byte)

57
New cards

short

16 bits (2 bytes)

58
New cards

int

16 bits (2 bytes)

59
New cards

long

32 bits (4 bytes)

60
New cards

float

24 bits (3 bytes)

61
New cards

double

24 or 32 bits (3 or 4 bytes)

62
New cards

how to disable the oscillator and place the PIC in a low power standby mode

sleep instruction

63
New cards

special function register

used to control and monitor the internal hardware features of the device

INTCON, STATUS, TRISX, TMR0

64
New cards

reset vector

address 0×000 that the program jumps to on reset

65
New cards

interrupt vector

address 0×004 that the program jumps to whenever an interrupt is generated

66
New cards

Arithmetic and logic unit

carries out an arithmetic or logic operation as commanded by the mode code which is extracted from the instruction by the instruction decoder

67
New cards

Program store

each location has an address and holds one 14 bit long instruction

68
New cards

Data store

each file holds one byte of data. the file address is generated by the execute unit via the File Address Register and the contents of the addressed file are either read into the File Data Register or written to from it

69
New cards

File Address Register

when the CPU wants to access a file in the data store the address of the file goes into the FAR via the FA bus

70
New cards

File Data Register

bidirectional register which holds the contents of an addressed file of the CPU is executing a read cycle or that the CPU wants to send out to an existing memory location

71
New cards

why the goto instruction should never be used to call a subroutine

the goto instruction is unidirectional and it does not provide the program with a return address to be placed on the stack that the program can jump to when it finishes executing the subroutine