beautypg.com

Zilog Z8F0130 User Manual

Page 437

background image

UM013037-1212

Appendix A. Zilog Standard Library Notes and Tips

Zilog Developer Studio II – Z8 Encore!

User Manual

413

I am using the UART in the interrupt mode. Why do I seem to lose
some of the data when I try to print or try to receive a large amount of
data?

One of the reasons could be that the software FIFO buffer size is small. Try increasing the
size to a bigger value. The default size of the software FIFO is 64. The software FIFO size
is defined in the

zsldevinit.asm

file as the BUFF_SIZE macro.

When I call open_UARTx() function by configuring it in INTERRUPT
mode, the control never comes back to my program and my program
behaves indifferently. Why is this?

The

open_UARTx()

function calls the

control_UARTx()

function, which enables the

UART interrupt. As a result of this, the UARTx transmit empty interrupt is generated
immediately. If the ISR for UART is not installed, the control on the program can be lost.
So install the ISR before calling

open_UARTx()

in the INTERRUPT mode. This is not a

problem when the standard boot module is used.

Where can I find sample applications that demonstrate the use of
ZSL?

The ZDS II installation includes two different directories called Applications and Samples.
In both of these directories, all projects using devices supported by ZSL are configured to
use it. The main difference between the directories is that the applications demonstrate the
use of direct ZSL APIs, and the samples demonstrate the indirect use of ZSL using RTL
calls.

I have used init_uart() and other functions provided in the RTL. Do I
need to change my source code because of ZSL?

No. The

sio.c

file of RTL has been modified to call ZSL APIs, so you can continue to

use the run-time library (RTL) without changing your source code. But Zilog advises you
to change your source code to make direct calls to ZSL. This is recommended for the fol-
lowing reasons:

The calls in RTL support only one UART (UART0 or UART1) at any given time in
the library. You cannot switch between the UARTs dynamically.

There is a small code size increase in the RTL due to the additional overhead of call-
ing ZSL APIs from

sio.c

.

Future releases of RTL might or might not continue to support this method of indi-
rectly accessing the UARTs via ZSL.