English
Language : 

VMX1C1020 Datasheet, PDF (16/80 Pages) List of Unclassifed Manufacturers – Versa Mix 8051 Mixed-Signal MCU
VMX51C1020
The P3PINCFG register controls I/O access to
UART0, the I2C interface, capture compare
input0 and 1, Timer 0 and Timer 1 inputs as well
as defines the direction of P3 when used as
general purpose I/O
TABLE 18: (P3PINCFG) PORT 3 PORT CONFIGURATION REGISTER - SFR 9EH
7
6
5
4
P3.7/MSCLEN
P3.6/MSDAEN
P3.5/T1INE
N
P3.4/CCU1E
N
3
P3.3/CCU0EN
2
P3.2/T0INEN
1
P3.1/RX0EN
0
P3.0/TX0EN
Bit Mnemonic
Function
7
0: General purpose input
1: General purpose output or
P3.7/MSCLEN
Master I2C SCL output
When using the I2C you must
set this bit to 1.
6
0: General purpose input
1: General purpose output or
P3.6/MSDAEN
Master I2C SDA
When using the I2C you must
set this bit to 1.
5
0: General purpose input or
Timer1 Input
P3.5/T1INEN 1: General purpose output
Using General Purpose I/O Ports
The VMX51C1020’s 28 I/Os are grouped into
four ports. For each port an SFR register
location is defined. Those registers are bit
addressable providing the ability to control the
I/O lines individually.
When the port pin configuration register value
defines the pin as an output, the value written
into the port register will be reflected at the pin
level.
Reading the I/O pin configured as input is done
by reading the contents of its associated port
register.
TABLE 19:
PORT 0 - SFR 80H
7
6
5
4
3
2
1
0
P0 [7:0]
PORT 1 - SFR 90H
7
6
5
4
3
2
1
0
P1 [7:0]
PORT 2 - SFR A0H
7
6
5
4
3
2
1
0
P2 [7:0]
PORT 3 - SFR B0H
7
6
5
4
3
2
1
0
P3 [7:0]
When using Timer 1 you must
set this bit to 0.
4
0: General purpose input or
CCU1 Input
1: General purpose output
P3.4/CCU1EN
When using the Compare and
Capture unit you must set this
bit to 0.
3
0: General purpose input or
CCU0 Input
1: General purpose output
P3.3/CCU0EN
When using the Compare and
Capture unit you must set this
bit to 0.
2
0: General purpose input or
Timer 0 Input
P3.2/T0INEN 1: General purpose output
When using Timer 0 you must
set this bit to 0.
1
0: General purpose input or
UART0 Rx
P3.1/RX0EN 1: General purpose output
When using UART0 you must
set this bit to 0.
0
0: General purpose input
1: General purpose output or
P3.0/TX0EN
UART0 Tx
When using UART0 you must
set this bit to 1.
Bit Mnemonic
7-0 P0, 1, 2, 3
Function
When the Port is configured as an
output, setting a port pin to 1 will
make the corresponding pin to
output logic high.
When set to 0, the corresponding
pin will set a logic low.
I/O usage example
The following example demonstrates the configuration of the VMX51C1020 I/Os.
//---------------------------------------------------------------------------
//This example continuously reads the P0 and writes its contents into //P1 and it
toggle P2 and P3.
//---------------------------------------------------------------------------
#pragma TINY
#pragma UNSIGNEDCHAR
#include <VMIXReg.h>
at 0x0000 void main (void)
{
DIGPWREN = 0x80;
P1PINCFG = 0x00;
P1PINCFG = 0xFF;
P2PINCFG = 0xFF;
P3PINCFG = 0xFF;
// Enable Timer 2 to activate P1
//Output
// Configure all P0 as Input
//Configure P1 as Output
//Configure P2 as Output
//Configure P3 as Output
while(1)
{
P1 = P0;
P2 = ~P2;
P3 = ~P3;
}
}//end of main() function
//Write P0 into P1
//Toggle P2 & P3
Using Port1.0-3 as General Purpose
Output
Port1.0-P1.3 can be used as standard digital
outputs. However, in order to do this, the Timer
2 clock must be enabled by setting the
_________________________________________________________________________________________________
www.ramtron.com
page 16 of 80