beautypg.com

Graphic and text string display – Zilog ZUSBOPTS User Manual

Page 21

background image

UM025603-0814

Graphic and Text String Display

Zilog Educational Shields

User Manual

14

Graphic and Text String Display

When using the

LEDString

command, characters display on a 4x7 LED matrix. Because

bits PA4 and PA5 are reserved for use by the UART, Port A is not used for graphics. How-
ever, the full 5x8 matrix is available when the UART is not in use; i.e., when the USB A to
Mini-B cable is not connected to the J5 console connector.

The following brief example demonstrates how to program a character in a 5x5 matrix. In
this example, the ZDS II development environment is used instead of the command shell.
A complete program that displays one text string a character at a time can be found in the

ZDS II Developer Studio for the ZNEO CPU

section on page 41.

The ZDSII development environment defaults to the C language. However, writing pro-
grams in Assembly language is also supported.

Example.

Write the program below to display the letter Z on a 5x5 matrix, as shown in

Figure 10

on page 11.

#include

#include "zneo.h"

Void LetterZ(void) {

PAOUT = 0x7C;

PBOUT = 0x08;

PCOUT = 0x10;

PDOUT = 0x20;

PEOUT = 0x7C;

}

Void main(void){

confpwm

Configures the PWM cycle period in kHz (1–20); an absence of parameters displays the
current setting. Syntax: confpwm 2.

setpwmduty

Configures the PWM channel’s duty cycle from 0 to 100%. An absence of a duty parame-
ter will display the current setting of the selected PWM. Syntax: setpwmduty xx [DD],
which xx is a PWM number in the range 1–6, and DD is a duty cycle in the range 0–100.

startshield

Start a shield that is plugged into the board. Use the List parameter to see the list of
shields. Syntax: startshield xxxx, in which xxxx is the shield’s name or list to see the avail-
able shields.

LEDString

Set a string to display on LEDs.

LEDInterval

Set an interval between character displays on all LEDs (defaults to 500 ms).

Table 1. ZED Test Shield Commands (Continued)

Command

Description

Note: