hades.models.pic
Class PicRegBank

java.lang.Object
  extended byhades.models.pic.PicRegBank
All Implemented Interfaces:
PicMemory
Direct Known Subclasses:
PicRegBank16F84

public class PicRegBank
extends java.lang.Object
implements PicMemory

PicRegBank - 512 8-bit-registers, organized in 4 banks including all special registers. The PIC16C84 only implements some of these registers, see documentation. The complexity of this class is high due to the memory-mapped architecture of the PIC-family. Remember this when you try to understand the code...


Field Summary
static int BANK0
           
static int BANK1
           
static int BANK2
           
static int BANK3
           
static int BANKCOUNT
           
static int BANKSIZE
           
 PicByteReg eeadr
           
static int EEADR
           
 PicEecon1Reg eecon1
           
static int EECON1
           
 PicNoReg eecon2
           
static int EECON2
           
 PicByteReg eedata
           
static int EEDATA
           
 PicBitReg eepromInt
           
 PicBitReg extInt
           
 PicByteReg fsr
           
static int FSR
           
 PicIndfReg indf
           
static int INDF
           
 PicIntConReg intcon
           
static int INTCON
           
 PicNoReg notImplemented
           
 PicByteReg option
           
static int OPTION
           
 PicPcReg pcl
           
static int PCL
           
 PicWordReg pclath
           
static int PCLATH
           
 PicPortReg porta
           
static int PORTA
           
 PicPortReg portb
           
static int PORTB
           
 PicBitReg rbInt
           
 PicReg[] reg
           
 PicByteReg status
           
static int STATUS
           
 PicTimerReg tmr0
           
static int TMR0
           
 PicBitReg tmr0Int
          Interrupts
 PicWordReg trisa
           
static int TRISA
           
 PicWordReg trisb
           
static int TRISB
           
 
Constructor Summary
PicRegBank(PicBreakPoint bp, PicEpromBreakPoints epromBreakPoints)
          Constructor, connect all addresses with different kinds of registers
 
Method Summary
 void buildGeneralPurposeRegisters(PicBreakPoint bp)
          create and initialize the 36 GP registers of the PIC16C84
 boolean getBit(int register, int bit)
          test a specified bit in a register with 7-bit-address
 int getFlatAddress(int register)
          Get the absolute address including the bank-switching bits in the status register.
 int getMemorySize()
          Capacity of the memory in words
 int getWordWidth()
          Witdh of one word in bits
 void por()
          Power-on-reset
 int read(int register)
          read the value of a register with 7-bit-address
 int readMemory(int address)
          Read a word from the memory
 void reset()
          Reset, just call the registers reset method and fill some special registers
 void setBit(int register, int bit, boolean newValue)
          set a specified bit in a register with 7-bit-address
 void write(int register, int newValue)
          write a new value into a register with 7-bit-address
 void writeMemory(int address, int word)
          Write a word into the memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reg

public PicReg[] reg

notImplemented

public PicNoReg notImplemented

indf

public PicIndfReg indf

tmr0

public PicTimerReg tmr0

option

public PicByteReg option

pcl

public PicPcReg pcl

status

public PicByteReg status

fsr

public PicByteReg fsr

porta

public PicPortReg porta

trisa

public PicWordReg trisa

portb

public PicPortReg portb

trisb

public PicWordReg trisb

eedata

public PicByteReg eedata

eeadr

public PicByteReg eeadr

eecon1

public PicEecon1Reg eecon1

eecon2

public PicNoReg eecon2

pclath

public PicWordReg pclath

intcon

public PicIntConReg intcon

BANKSIZE

public static final int BANKSIZE
See Also:
Constant Field Values

BANKCOUNT

public static final int BANKCOUNT
See Also:
Constant Field Values

BANK0

public static final int BANK0
See Also:
Constant Field Values

BANK1

public static final int BANK1
See Also:
Constant Field Values

BANK2

public static final int BANK2
See Also:
Constant Field Values

BANK3

public static final int BANK3
See Also:
Constant Field Values

INDF

public static final int INDF
See Also:
Constant Field Values

PCL

public static final int PCL
See Also:
Constant Field Values

STATUS

public static final int STATUS
See Also:
Constant Field Values

FSR

public static final int FSR
See Also:
Constant Field Values

PCLATH

public static final int PCLATH
See Also:
Constant Field Values

INTCON

public static final int INTCON
See Also:
Constant Field Values

PORTA

public static final int PORTA
See Also:
Constant Field Values

PORTB

public static final int PORTB
See Also:
Constant Field Values

TRISA

public static final int TRISA
See Also:
Constant Field Values

TRISB

public static final int TRISB
See Also:
Constant Field Values

TMR0

public static final int TMR0
See Also:
Constant Field Values

OPTION

public static final int OPTION
See Also:
Constant Field Values

EEDATA

public static final int EEDATA
See Also:
Constant Field Values

EEADR

public static final int EEADR
See Also:
Constant Field Values

EECON1

public static final int EECON1
See Also:
Constant Field Values

EECON2

public static final int EECON2
See Also:
Constant Field Values

tmr0Int

public PicBitReg tmr0Int
Interrupts


extInt

public PicBitReg extInt

rbInt

public PicBitReg rbInt

eepromInt

public PicBitReg eepromInt
Constructor Detail

PicRegBank

public PicRegBank(PicBreakPoint bp,
                  PicEpromBreakPoints epromBreakPoints)
Constructor, connect all addresses with different kinds of registers

Method Detail

buildGeneralPurposeRegisters

public void buildGeneralPurposeRegisters(PicBreakPoint bp)
create and initialize the 36 GP registers of the PIC16C84


por

public void por()
Power-on-reset


reset

public void reset()
Reset, just call the registers reset method and fill some special registers


getWordWidth

public int getWordWidth()
Description copied from interface: PicMemory
Witdh of one word in bits

Specified by:
getWordWidth in interface PicMemory

getMemorySize

public int getMemorySize()
Description copied from interface: PicMemory
Capacity of the memory in words

Specified by:
getMemorySize in interface PicMemory

getFlatAddress

public int getFlatAddress(int register)
Get the absolute address including the bank-switching bits in the status register. The addressing scheme requires a 7-bit register-address and returns a 9-bit register-address.


readMemory

public int readMemory(int address)
Description copied from interface: PicMemory
Read a word from the memory

Specified by:
readMemory in interface PicMemory

writeMemory

public void writeMemory(int address,
                        int word)
Description copied from interface: PicMemory
Write a word into the memory

Specified by:
writeMemory in interface PicMemory

read

public int read(int register)
read the value of a register with 7-bit-address


write

public void write(int register,
                  int newValue)
write a new value into a register with 7-bit-address


setBit

public void setBit(int register,
                   int bit,
                   boolean newValue)
set a specified bit in a register with 7-bit-address


getBit

public boolean getBit(int register,
                      int bit)
test a specified bit in a register with 7-bit-address