2024-11-17, Auswendig

rjmp
rcall
ret
reti
ijmp
icall
push
pop

ZH
ZL
HIGH (RAMEND)
LOW (RAMEND)
RAMEND
SPH
SPL

AT90S4433
.include "4433def.inc"

ldi r16, RAMEND
out SP, r16

Atmega8:

.include "m8def.inc"
ldi r16, HIGH (RAMEND)
out SPH, r16
ldi r16, LOW (RAMEND)
out SPL, r16

256 RAM - Attiny 90S4433

HD44780

KS0070
KS0066U
SED1278
TC1602E
ANAG VISION AV1623-YFTY
pollin 120420
pollin 121714

PORTD
DDRD
DB7 .. DB0

ldi r16, 0xff
out DDRD, r16

VCC, VDD, VEE, VSS, VPP

VCC: Voltage, Current, Collector

VSS: GND - Pin 1 - eckig

1. Pin: VSS
2. Pin: VDD
3. Pin: VEE
4. Pin: RS
5. Pin: RW
6. Pin: E
7. bis 14. Pin: DB0 .. DB7
15. Pin: A
16. Pin: K

1. Pin: VSS: GND
2. Pin: VDD: +5V - VCC - Versorgungsspannung
3. Pin: VEE: -5V/0V - 5V: Kontrastspannung
4. Pin: RS: Register Select
5. Pin: RW: Read/Write
6. Pin: E: Enable/Disable
7. bis 14. Pin: DB0 .. DB7
15. Pin: A
16. Pin: K

4. Pin: RS: Register Select
    0 = Befehl
    1 = Daten
5. Pin: RW: Read/write
    0 = Write
    1 = Read

4-Modus
8-Modus

Im Vier Bit
    DB7 .. DB4 sind verbunden

Bei der Übertragung
    1.) Höhere Vier Bit
    2.) Niederwertiges Nibble

DB7: PD3
DB6: PD2
DB5: PD1
DB4: PD0

$3, $3, $3
$3, $3, $3, $2
$3, $3, $3, $2, $20

Im Vier Bit Modus

swap r16

aus 0b01010010 wird
0b00100101

Vier Bit Modus

ldi r17, r16
swap r16
andi r16, 0b00001111
out PORTD, r16
andi r17, 0b00001111
out PORTD, r16

Warten, mit Enable

sbr PORTD, 5
nop
nop
nop
cbr PORTD, 5

Befehle

1.) Clear Display
2.) Cursor Home
3.) Entry Mode
4.) On/Off Controll
5.) Cursor/Scrollen
6.) Konfiguration
7.) Charakter RAM Address Set
8.) Display RAM Address Set

0b0000 0001 - Clear Display
0b0000 001x - Cursor Home
0b0000 01is - Entry Mode
0b0000 1dcb - On/Off Controll
0b0001 srxx - Cursor/Scrollen
0b....
0b01aa aaaa - Character RAM Address Set
0b1aaa aaaa - Display RAM Address Set

UBRR
UBRRL, UBRRH
UDR
UCSRA, UCSRB, UCSRC

TXEN
TXE
UCS..0 und 1
USEL oder so

UART - Asynchronous Reciever/Transmitter

MAX232 - Pegelwandler
R1IN
R2IN
T1IN
T2IN
R1OUT
R2OUT
T1OUT
T2OUT

Baud-Rate: 1 Zeichen Pro Sekunde = 1 Baud
Jean Maurice Emile Baudot
Baudot Code - ursprünglicher synchroner 5 Bit - Digitaler Code - CCITT-1

TxD, RxD
RTS, CTS
DSR,

Terminal = PC = Datenendgerät
Modem = Datenübertragungsgerät

NUL
SOH - Start of Heading
STX - Start of Text
ETX - End of Text
EOT - End of Transmission
ETB - End of Transmission Block
ACK - Acknowledge
NAK - Negative Acknowlege
VT - Vertical Tab
HT - Horizontal Tab
LF - Line Feed
FF - Form Feed
CR - Carriage Return
DEL - Delete
CAN - Cancel
SO - Shift Out
SI - shift In
DC1, ..., DC4: Device Controll

Strg-Q, Strg-S

ACK/NAK-Protokoll
X-ON/X-OFF Protokoll

Problem: Asynchron, kein Takt - Data Flow Controll
    1.) Protokoll
    2.) Hardware
    3.) Software

brid, brie
brcc, brcs
brhs, brhc
brbs, brbc
brvs, brvc
brts, brtc
breq, brne
brlt, brge
brmi, brpl
brsh, br

...

X, Y, Z
-X, X, X+
-Y, Y, Y+
-Z, Z, Y+

ld, ldd, ldi, lds
st, std, sts
lpm spm

ld r0, -X
ld r0, X
ld r0, X+
ld r0, -Y
ld r0, Y
ld r0, Y+
ld r0, -Z
ld r0, Z
ld r0, Z+
st -X, r0
st X, r0
st X+, r0
st -Y, r0
st Y, r0
st Y+, r0
st -Z, r0
st Z, r0
st Z+, r0

ldd r0, Y+k
ldd r0, Z+k
std Y+k, r0
std Z+k, r0

add
adc
adiw
sub
sbc
sbiw
subi
sbci

add         Add two registers
adc         Add with carry two registers
adiw        Add immidiate to Word
sub         Subtract two registers
sbc         Subtract with carry two registers
sbiw        Subtract immediate from word
subi        Subtract constant from register
sbci        Subtract with carry constant from register

Minix - gleich lernen, was ich weiss:

NR_REGS
NR_SEGS
NR_HOLES
NR_PROCS
NR_TASKS

struct mem_map {
    vir_clicks mem_vir;
    phys_clicks mem_phys;
    vir_clicks mem_len;
};

vir, phys, len
mem_map, ...

EXTERN struct proc {
    int p_reg [N_REGS];

} proc [NR_TASKS + NR_PROCS];

PRIVATE struct hole {
    phys_clicks h_base;
    phys_clicks h_len;
    struct hole *h_next;
};

vir, phys, bytes, clicks

vir_bytes
vir_clicks
phys_bytes
phys_clicks

h/const.h
h/com.h
h/callnr.h
h/sgtty.h
h/stat.h
h/signal.h
h/type.h
h/error.h

h, kernel, mm, fs

kernel/...h
kernel/main.c
kernel/proc.c
kernel/system.c
kernel/mpx88.s
kernel/klib88.s
kernel/clock.c
kernel/memory.c
kernel/tty.c
kernel/floppy.c
kernel... winni oder disk

kernel/main.c
    main ()
    unexpected_int ()
    trap ()
    div_trap ()
    set_vec ()
    panic ()

kernel/mpx88.s
    _MINIX:
    _s_call:
    _wini_int:
    _clock_init
    _tty/floppy...
    _trp:
    _divide:
    _suprise:
    _save:
    _restart:
    _idle:
    _data:

kernel/floppy:
    tty_task ()
    do_rdwt ()

    start_motor ()
    stop_motor ()
    clock_mess ()
    send_mess ()
    seek ()
    transfer ()
    recalibrate ()
    reset ()
    fdc_results ()
    fdc_out ()

kernel/tty.c
    tty_task ()

    do_read
    do_write
    do_ioctl
    do_cancel
    do_charint

    keyboard
    console
    set_6845
    beep
    escape
    flush
    scroll_screen
    char_in ?
    char_out ?


Unterabschnitte