Using this “forced” addressing allows the instruction to
2
operate on a data address in a single cycle, without
3
updating the BSR first.
heisst das, dass alle Variablen die nicht in Access Ram liegen,
vorher BSR updaten müssen? Mein Stand war, dass jede Instruktion
beim PIC 4 cycles braucht. Wären die instructions mit Zugriffen
auf Access Ram eine Ausnahme hiervon?
Gruß,
Daniel
Nein.
Der Vorgänger, pic16 hatte einen 14bit Instructionsbreite und 5bit
adresse
für das Registerfile. Um die verschiedenen Bänke auszuwählen wurde dann
die Bank im Statusregister RB0/RB1 ausgewählt, auf welche Bank denn
zugegriffen wird. Ungefähr wie 2:5 bit addressierung mit einem
Basisregister.
Die Pic18 Serie hat eine 16/32 bit Instruktionsbreite, verwendet aber
nur
8bit für die Registerfile Adresse. Um mehr anzusprechen wurde dann ein
eigenes Register BSR geschaffen, weil das Statusregister nicht mehr
ausreichte. Gleichzeitig aber hatten sie ein Bit geschaffen im
Instruktionsregister, welches zwischen zwei möglichen Ram-Addressen
umschalten. Ist das A(ccess) bit nicht gesetzt, dann wird das RAM
verwendet,
welches im BSR ausgewählt wurde. Ist hingegen das Access Bit gesetzt,
dann wird automatisch BANK15 verwendet, egal was in BSR drinsteht.
Bank15 Addresse 0-0x5F ist wie eine Spiegelung der BANK0 dasselbe gab es
auch im Pic16, und ab 0x60-0xff sind die SFR vorhanden.
Zusätzlich hat man noch mehrere Pointer Register, welche eine direkte
Ramadressierung ermöglichen.
Es ist eben eine Aufbohrung des 14-Bit Instructionset und da die meiste
Funktionalität schon drin war hat man sich zu sowas entschieden,
anstelle
eines linearen 9bit Adressraumes mit zusatzlichem Paging des
oberen/unteren
Hälfte.
pic user schrieb:> Ist hingegen das Access Bit gesetzt,> dann wird automatisch BANK15 verwendet, egal was in BSR drinsteht.> Bank15 Addresse 0-0x5F ist wie eine Spiegelung der BANK0 dasselbe gab es> auch im Pic16, und ab 0x60-0xff sind die SFR vorhanden.
mit pic16 hatte ich nicht zu tun. Zu den pic18 stimme ich dir voll zu.
Im Datenblatt von pic18f8527 bin ich über diesen Text gestolpert...
1
To streamline access for the most commonly used data
2
memory locations, the data memory is configured with
3
an Access Bank, which allows users to access a
4
mapped block of memory without specifying a BSR.
5
The Access Bank consists of the first 96 bytes of
6
memory (00h-5Fh) in Bank 0 and the last 160 bytes of
7
memory (60h-FFh) in Block 15. The lower half is known
8
as the “Access RAM” and is composed of GPRs. This
9
upper half is also where the device’s SFRs are
10
mapped. These two areas are mapped contiguously in
11
the Access Bank and can be addressed in a linear
12
fashion by an 8-bit address (Figure 5-6).
13
The Access Bank is used by core PIC18 instructions
14
that include the Access RAM bit (the ‘a’ parameter in
15
the instruction). When ‘a’ is equal to ‘1’, the instruction
16
uses the BSR and the 8-bit address included in the
17
opcode for the data memory address. When ‘a’ is ‘0’,
18
however, the instruction is forced to use the Access
19
Bank address map; the current value of the BSR is
20
ignored entirely.
21
Using this “forced” addressing allows the instruction to
22
operate on a data address in a *single* cycle, without
23
updating the BSR first. For 8-bit addresses of 60h and
24
above, this means that users can evaluate and operate
25
on SFRs more efficiently. The Access RAM below 60h
26
is a good place for data values that the user might need
27
to access rapidly, such as immediate computational
28
results or common program variables. Access RAM
29
also allows for faster and more code efficient context
30
saving and switching of variables.
dass die Bankumschaltung entfällt macht es natürlich effizienter.
Das mit dem single cycle hat mich stützig gemacht.
Gruß,
Daniel
Daniel schrieb:> mit pic16 hatte ich nicht zu tun. Zu den pic18 stimme ich dir voll zu.
Ich brachte den pic16 ins Spiel, weil es historisch bedingt ist.
Teilweise ist es auch Marketing-Zeug um zu begründen, wieso nun der
aufgemotzte Pic17, welcher nicht beliebt war, nun mit einigen wenigen
und kleinen Erweiterung plötzlich doch so super ist, oder auch daß
ein Code welcher auf pic16 3 cyclen braucht, auf einem pic18 nun 4
benötigt.
bsf foo,bar
btfss foo,bar
goto foobar
movff src,dst z.B. arbeitet mit 12bit Adressen, und kann somit das
ganze
Ram ansprechen.
Du solltest dir mal dieses Dokument ansehen, ist zwar nicht mehr
aktuell,
einige Periferie fehlt, aber es sollte ein guter Startpunkt sein
http://ww1.microchip.com/downloads/en/DeviceDoc/39500a.pdf