|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpicmicrocontroller.DataMemory
public class DataMemory
This class represents the data memory of a PIC16F877. Data memory consists of 4 banks, each having 128 registers.
Field Summary | |
---|---|
protected PIC |
pic
|
Constructor Summary | |
---|---|
DataMemory(PIC pic)
Main constructor that initializes the data memory. |
Method Summary | |
---|---|
int |
AD_channel()
Get the active AD converter channel. |
boolean |
AD_enabled()
Checks if AD converter module is activated. |
boolean |
AD_started()
Checks if AD conversion started. |
void |
AD_stop()
Stops the AD conversion. |
void |
AD_write(int dval)
Writes the conversion result into ADRESL and ADRESH registers. |
void |
clear(int address)
Clears the Register at the given address |
void |
clearCarry()
Set the carry flag of the status register to 0. |
void |
clearDigitCarry()
Set the digit flag of the status register to 0. |
void |
clearZeroFlag()
Set the zero flag of the status register to 0. |
Register |
getADCON0()
Get content of ADCON0 register. |
byte |
getPCH()
Get content of PCH register. |
Register |
getPORTA()
Get content of PORTA register. |
Register |
getPORTB()
Get content of PORTB register. |
Register |
getPORTC()
Get content of PORTC register. |
Register |
getPORTD()
Get content of PORTD register. |
Register |
getPORTE()
Get content of PORTE register. |
Register |
getTRISA()
Get content of TRISA register. |
Register |
getTRISB()
Get content of TRISB register. |
Register |
getTRISC()
Get content of TRISC register. |
Register |
getTRISD()
Get content of TRISD register. |
Register |
getTRISE()
Get content of TRISE register. |
byte |
output(int bank,
int address)
Gets the value of a register specified by bank number and adress value. |
byte |
read(int address)
Read the content of the register from a given address. |
void |
reset()
Clears all the Registers in the data memory |
void |
setCarry()
Set the carry flag of the status register. |
void |
setDigitCarry()
Set the digit flag of the status register. |
void |
setPCH(byte data)
Set content of PCH register. |
void |
setPORTAbyPeripheral(byte data)
Sets the value of PORTA. |
void |
setPORTBbyPeripheral(byte data)
Sets the value of PORTB. |
void |
setPORTCbyPeripheral(byte data)
Sets the value of PORTC. |
void |
setPORTDbyPeripheral(byte data)
Sets the value of PORTD. |
void |
setPORTEbyPeripheral(byte data)
Sets the value of PORTE. |
void |
setZeroFlag()
Set the zero flag of the status register. |
void |
write(int address,
byte data)
Change the content of the register of a given address. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PIC pic
Constructor Detail |
---|
public DataMemory(PIC pic)
Method Detail |
---|
public byte read(int address)
public void write(int address, byte data)
public void clear(int address)
public void reset()
public Register getPORTA()
public Register getPORTB()
public Register getPORTC()
public Register getPORTD()
public Register getPORTE()
public Register getTRISA()
public Register getTRISB()
public Register getTRISC()
public Register getTRISD()
public Register getTRISE()
public Register getADCON0()
public byte getPCH()
public void setPCH(byte data)
public void setZeroFlag()
public void clearZeroFlag()
public void setCarry()
public void clearCarry()
public void setDigitCarry()
public void clearDigitCarry()
public boolean AD_enabled()
public boolean AD_started()
public int AD_channel()
public void AD_write(int dval)
dval
- digital value produced after conversionpublic void AD_stop()
public void setPORTAbyPeripheral(byte data)
public void setPORTBbyPeripheral(byte data)
public void setPORTCbyPeripheral(byte data)
public void setPORTDbyPeripheral(byte data)
public void setPORTEbyPeripheral(byte data)
public byte output(int bank, int address)
bank
- address
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |