Chameleon-AVR Nurve Networks, Chameleon-AVR Datasheet - Page 203

MCU, MPU & DSP Development Tools AVR8 & PROPELLER DEV SYSTEM (SBC)

Chameleon-AVR

Manufacturer Part Number
Chameleon-AVR
Description
MCU, MPU & DSP Development Tools AVR8 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-AVR

Processor To Be Evaluated
AVR 328P
Data Bus Width
8 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
26.0 Propeller Local I/O Port Module Primer
The Propeller chip on the Chameleon is more or less “peripheraless” if that’s a word? In other words, if you want serial,
SPI, A/D, D/A, etc. you use a core and write one yourself using software. Thus, the philosophy of the Propeller chip is a lot
of I/O pins and a lot of processors, what you do with them is up to you. The Chameleon uses most of the I/O pins for the
video, audio, VGA, and PS/2 port, but we were able to tuck 8 I/O pins away and export them out to what is called the
“Propeller Local Port”. With this you can hook up devices that are designed to interface to the Propeller, us it for switches,
a D/A, A/D, even another video or VGA port! That said, what I decided to do was write a very rudimentary interface to it,
so you can control the direction of each port bit (input or output) and then write/read data to and from the port from the
AVR. So, if you run out of digital I/Os on the AVR headers you can use the Propeller port, or if you just want to connect
something to the Propeller that takes 8 or less I/O pins that someone has developed a Propeller object for. Either way, in
this section, we will see the API for the Propeller Local Port.
One detail before we begin, the Propeller Port does NOT have a driver object running on another core. It’s so simple that
we wrote the code right into the master control dispatch program object. There is a complete listing of the code below
excerpted from CHAM_DEFAULT2_DRV_112.spin.
As you can see, there are 3 commands; set direction, read, and write. These are directly interfaced to SPIN native
functions and port I/O control. The AVR side API is nothing more than 3 commands to set the direction, read, and write.
The name of the API file is:
CHAM_AVR_PROP_PORT_DRV_V010.c – Contains the API functions for the Propeller local port functionality.
And once again, this functionality is available in all versions of the main Propeller driver Default1 and 2.
26.1 Header File Contents Overview
The “Propeller Local Port” module header CHAM_AVR_PROP_PORT_DRV_V010.h has nothing in it, but the prototypes
for the API functions, so nothing to show you there.
26.2 API Listing Reference
The API listing for the “Propeller Local Port” module CHAM_AVR_PROP_PORT_DRV_V010.c is listed in Table 26.1
categorized by functionality.
Function Name
int PropPort_SetDir(int dirbits);
int PropPort_Read(void);
int PropPort_Write(int data8);
Note: When reading or writing, I/O pins that aren’t set the proper direction will have invalid data on them, thus if you have
set the lower 4-bits as inputs and read the port, only count on the lower 4-bits having valid data. Similarly when writing
data, only pins that are outputs will drive current. The only will sink it as inputs. Thus, any data written to them is ignored
(as is should be).
Table 26.1 – “Propeller Local Port” module API functions listing.
Description
Sets the port bit direction bits individually.
Read the port input buffer.
Writes to the port output buffer.
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon AVR 8-Bit”
203

Related parts for Chameleon-AVR