Index

A

ABuffer [], 507
Adaptive differential pulse-coded modulation (ADPCM), 498
ADC1BUF0 register, 255
AD1CHS register, 255, 267
ADC library, 257–258
AD1CON1 register, 252, 253
AD1CON2 register, 252
AD1CON3 register, 252, 254
AD1CSSL register, 252
addrLCD (), 229
ADON, 252
AD1PCFG register, 252
ADPCM; see Adaptive differential pulse-coded modulation (ADPCM)
AEmptyFlag flag, 508
AINPUTS, 252
Alphanumeric modules, 220
amask, 253
Analog-to-digital conversion, 253–254
demo for, 255–257
Analog-to-digital converter (ADC), 249
basic conversion routine, 254
block diagram of ten-bit
high-speed, 250–251
control registers, 251–253
creating mini library, 257–258
and game program, 258–261
initADC(), 252–253
and potentiometer, 251–252
sampling timing in, 254–255
and temperature sensing, 261–266
voltage input in, 253
Analog waveforms, 492–197
algorithm for, 494
and Boethian notation, 495
spreadsheet program for, 495–496
Animate mode, 31–35
delay loop for, 33–34
Timer1 for, 31–33
ANSI C standard, integers in, 62
Arithmetic expressions; see Logic expression
Arithmetic libraries
floating point, 69–70
integers; see Integers
measuring performance of; see StopWatch tool
Arrays, 49–50
initialization for message, 50–51
ASCII characters, 220
arrays, 116
visual displaying of, 387–390
visual printing of, 392–394
ASCII Setup dialog box, 206
Assignment statement, 8
Asynchronous serial application, classes of, 198
Asynchronous serial
communication interface; see Universal asynchronous serial communication interface (UART)
AT (x, y), 394
AudioCfg file format, 503
AudioVideo32 board, 406

B

Baud rate, 200, 201, 202, 215
in asynchronous serial interfaces, 176
in SPI synchronous serial interfaces, 179, 180, 196
Baud Rate Generator (UxBREG), 200
Binary operators, 38
BitBLT (bit block transfer), 391
Bit reversal array, 155, 156
Blocking function, 279
Block read command, 410
Block write command, 410
BMX; see Bus matrix (BMX)
Boolean logic values, 28
Boot record, 440
Break code, 325
Bresenham, Jack E., 370
Bresenham algorithm, 370–373
Buffer, 435
Build Project checklist, 358
Bus matrix (BMX), 131, 347
in memory splitting, 132
busyLCD (), 229
Button inputs, 272–275
debouncing, 277–280
packing, 275–277
Byte command, 182

C

Cache, 347, 348
Cache memory module, 163–164
pre-fetched cached data in, 164–165
Cartesian coordinate system, 364, 391
CGRAM; see Character generator RAM buffer (CGRAM)
Change notification (CN) module, 302–308
cost evaluation, 308–309
Character generator RAM buffer (CGRAM), 220
character (new line), 233
character (tab), 233
char integer, 46
Checklist
project build, 179, 184, 188, 190
project setup, 200, 204, 211
Chip On Glass (COG) technology, 220, 333
chunks, 500
C language
inner iteration, 381–382
pseudo-random number-generator functions of, 366
clearHScreen (), 400
clearScreen (), 356
C library stdio.h, 444
Clipping, 365
Clock output ( SCK ), 408
Clock-polling state machine, 310–314
Clock system
configuration, 148–149
configuration bits; see Configuration bits
oscillators, 142–143
peripheral bus clock, 147–148
primary oscillato clock chain, 146–147
Clrscr (), 394
clusters, 428–429
CNCON register, 303, 329
CNEN register, 303, 329
CNPUE register, 303, 329
COG technology; see Chip On Glass (COG) technology
Communication device class (CDC), 215
Communication protocol, PS/2, 289–290
Compiling, 9
Composite video interface, 350, 364
Composite video signal
defined, 334, 335
generating, 337–342
hardware interface, 337
interface, 350, 364
NTSC, 335
testing, 357–360
Configuration bits, 148
in codes, 150–152
Console library
building, 206–209
testing; see VT100 terminal testing
Contact bouncing, 273
Cyclic redundancy check (CRC), 409

D

D/A converter testing of PWM as, 490–492
data chunk, 501, 505
DDRAM; see Display Data RAM buffer (DDRAM)
Debouncing, 277–280
contact, 273
Debugging, 12–13
Deinterlacing, 336
Delay loops, 33–34
Digital signal processing
coding, 152–153
FFT; see Fast Fourier Transform
DIN connector, 288, 289
Direct memory access (DMA) controller, 346
channel chaining, 351
functions, 348
library; see Dma.h
source pointer, 355
Display data RAM buffer (DDRAM), 220
Division, of integers, 67–68
DMA; see Direct memory Access (DMA)
DMA channel chaining, 351
DmaChnSetControl (), 348, 351
DmaChnSetEventControl (), 348
DmaChnSetTxfer (), 348, 356
DmaCHOpen (), 348
dma.h, 347
Do loops, 44–45
DONE control bit, 253, 255
Double buffering, 399–401; see also Image buffers
Drawing, lines, 368–370
drawProgressBar(), 244
duty cycle, 486; see also Pulse
width modulation (PWM) mode

E

EEPROM, serial, 179, 180, 181
32-bit, library, 187–191
testing, 191–193
sending commands to, 183
status register, 185–186
writing data to, 186–187
8-bit registers, 221
8088 processor; see Microprocessors
Embedded-control applications, 173
communciation in; see
Synchronous serial
communication interfaces;
Universal asynchronous
receiver and transmitters (UART)
Embedded-control memory map, 134–135
kernel mode virtual map, 135
equal-to operator, 28
“escape sequences”, 209, 210
Exceptions, 82–83
vectors table, 83
_exit () function, 27
Explorer 16 buttons
inputs, 272–280
layout, 272, 275
Explorer 16 demonstration board
interfacing, 406–407
message testing with, 54–55
for R6 potentiometer, 251
to SD/MMC memory technology, 406
for TC1047A temperature sensor, 262
External clock source (EC) mode, 143
External low-frequency and low-power oscillator, 142
External primary oscillator (POSC), 142

F

False logic value, 28, 29
Fast Fourier Transform (FFT), 153
algorithm, 154–158
arrays initialization in, 155–156
configuration bit settings, 157–158
initializations, 158
symbols used in, 156–157
FAT, 16
accessory functions, 459, 473–476
books, 482
closing a file, 459, 471–172
code size, 480–481
debriefing, 481
exploration, 428
file allocation table, 429–430
fileio module, 460–462
fundamental questions related to, 433–444
links, 483
opening a file, 444–454
preparation, 427–428
reading data from a file, 454–459
root directory, 430–433
sectors and clusters, 428–429
testing fopenM() and freadM(), 463–465
testing the complete fileio module, 476–480
tips & tricks, 481–482
writing data to a file, 465–471
FAT file system, 427
fcloseM(), 471
FFT; see Fast Fourier Transform (FFT)
File Allocation Table (FAT), 428, 429–430
fileio.c, 460, 465
Files, in project build
header files, 10
library files, 9
object files, 9
other files, 10
source files, 9
findDIR(), 448, 449, 451, 467
First-in/first-out (FIFO) buffer, 319–322
Fixed mapping translation (FMT), 130–131
Flash memory
bus offering access to, 118, 121
mapping, 132–133, 134, 135
memory space allocation, 118, 121
wait states configuration, 160–163
Flash memory, of PIC32, 390
Floating point, 69–70
measuring performance of; see StopWatch tool
fmt chunk, 501, 504
Font8x8 [ ] array, 390
fopenM(), 445, 450, 459
For loops, 47–48
examples of, 48–49
Fractals, definition of, 380
Frame; see Video frame signals
Framed Slave mode, 349
freadM(), 454, 455
fwriteM(), 465–466

G

Gates, Bill, 427
“getC ()” function, 327–328
“getK ()” button encoding, 277–280, 321
getKey (), 373
getLCD (), 229
Graphic card, 385
greater-or-equal to operator, 29
greater-than operator, 29
Group priority level, 85–86

H

haltAudio (), 512
haltVideo (), 356
Hardware interface
for generation of composite video signal, 337
HD44780 Controller
command bits, 223
compatibility of with LCD display modules, 221–223
instruction set, 222
Header files, 10
Heap, 128–129
Hex dump format, 126
Home (), 394
Home computers; see ZX Spectrum
Horizontal line signal, 336
Horizontal synchronization pulse, 336, 338
generating, 342
HRES (horizontal resolution); see Resolution
HyperTerminal Properties dialog box, 205

I

IBM PC XT, 385
ICSP/ICD interface, 16
I2C synchronous serial interfaces, 174, 175
block diagram, 174
vs. SPI synchronous serial interfaces, 176–177
vs. UART, 176–177
ICW rotary encoder, 283
ICxC32 control bit, 329
ICxCON register, 329
ICxFEDGE control bit, 329
Image buffers, 345–346
VH pointer, 364
Image memory map, 356
#include, 234
include directory, creating, 237–240
include search path, 238, 240
Incremental encoders, 280
initADC(), 252
initAudio(), 508
“initEX16 ()” function, 287
initialization, 30
initLCD(), 231
initMedia() function, 412
initVideo (), 400
Inner iteration, in C language, 381–382
Input capture modules, 290–296
cost evaluation, 308–309
Input/output (I/O) pins, 200, 202
direction of, 14–15
PortA in; see PortA
PortB in, 17–19
Input/output (I/O) polling, 309–314
cost and efficiency evaluation, 317–319
testing, 314–317
Integer data type; see Integers
Integers
in ANSI C standard, 62
code generated by compiler, 63
divisions, 67–68
int integer, 62, 63
long long integers, 62, 65–66
measuring performance of; see StopWatch too
multiplication, 63
optimizations, 64
testing, 64–65
Interlacing, 336
Internal low-frequency and low-power oscillator (LPRC), 142
Internal oscillator (FRC), 142
Interrupt
application of, 103–108
handler, 82
declaration, 88–89
latency, 82
library management, 90
managing multiple interrupt, 95–98
multivectored management; see Multivectored interrupt management
priorities, 85–88
single vector management; see Single vector interrupt management
sources of, 84–85
Interrupt-driven rotary encoder input, 283–287
Interrupt Enable bit, 85
Interrupt Flag bit, 85
interrupt service routine (ISR), 82; see also Interrupt handler
int integers, 62, 63
Isometric projection, 376

J

JTAG port, 16–17
and PortA, 16, 17
vs. ICSP/ICD, 16

K

Kata Kana characters, 220
Kernel mode virtual map, 135
Keyboards, 288
interfacing to PS/2, 290–324
Keyboard-to-host communication waveform, 289
Key code decoding, 324–328

L

latency, interrupt, 82
LCD busy flag, 228, 229
LCD display modules
busyLCD() function for, 229–231
and COG technology, 220
Explorer 16 for, 219–221
HD44780 compatibility with, 221–223
initialization sequence, 226–228
small library of functions to access, 225–231
for WAVE file player, 513–514
25LC256 device datasheet, 179, 180, 182; see also EEPROM, serial
LCDlib.c module, 276
LCD library, 231–235
LCD module control advanced, 341–342
PMP configuration for, 224–225
LCD module controller RAM
buffer, 220; see also LCD module control
LCD module Read Busy Flag, 228
LCD status register, 228, 229
LED, 415, 418, 420, 421
connected to PortA, 50
less-or-equal to operator, 29
less-than operator, 29
lib directory, creating, 237–240
Library files, 9
LINE_T, 340
Linker script, 9, 10–11, 125–126
Linking, 9
Logical block addresses (LBA), 414
Logic analyzer, 35–37, 358–359
measuring performance of video interface by, 360–361
message testing with, 53–54
view, 318, 319
Logic expression, 28
Logic operators, 28–29
long integer, 45
long long integer, 46, 62, 65–66
Loops
delay loop, 33–34
do loops, 44–45
for loops; see For loops
main loop, 30, 33–34
for sending message; see Message, loops for
while loops, 28–30, 43, 45
Low-frequency oscillator, 108–109
Low-pass filter circuit, 487
analog output of, 487
Luminance pulse, 337

M

main () function, 7
infinite loop for, 44
Main loops, 30
delay loops in, 33–34
Make code, 325
malloc (), 435
Mandelbrot, Benoit, 380
Mandelbrot set
algorithm, 381–382
cardiod, 384
defined, 380
program, 382–384
Map files, 123–126
list of archives in, 124
memory configuration table, 124–125
memory sections, 125–126
Mass storage technologies, 403; see also Multi media card (MMC); Secure digital (SD)card
criteria, 404
master boot record (MBR), 436
Math functions, 373–376
McDonald, Marc, 427
Mechanical switch, 272
button inputs, 272–280
electrical response of, 272–273
rotary encoders, 280–287
MEDIA, 435, 442, 444, 445
Media player, 498–499
memcpy (), 456, 469
Memory allocation techniques, 118–123
Memory management unit (MMU), 130
Memory mapping
embedded-control applications in, 134–135
PIC32MX, 130–134
Memory Usage Gauge, 21
Message, loops for
initializing arrays for, 50–51
main program with variable declarations, 51–52
testing
with Explorer 16
demonstration board, 54–55
with Logic analyzer, 53–54
with PIC32 Starter Kit, 55–57
timing constants, 50
Messages, voice, 497–498
MFILE, 444, 445, 446, 448, 449, 450, 453, 454, 459, 466, 467
Microchip TC1047A device, 261–266
Microprocessors, 385
MicroSD cards, 405
MiniSD cards, 405
MIPS core, 39
assembly programming interface, 64
mount(), 443, 445
MPLAB C32 compiler, 346
MPLAB C32 linker, 435–436
MPLAB memory usage gauges, 424
MPLAB SIM, for debugging, 12–13
MPLAB SIM simulator, 357, 360
MPLAB SIM software simulator, 296, 301–302
mPMPMasterReadByte(), 231
mPMPOpen(), 231
MPSetAddress(), 231
MSb first, 364
Multi media card association (MMCA), 404
Multi media card (MMC), 404
connectors pin-out, 405
Multiple interrupt, managing, 95–98
coding, 95–96
steps for new code, 97
Multivectored interrupt management, 98–103
coding for, 101–102
Timer2 for, 103
vector table for, 99–100
MUXA, 252

N

newDIR(), 467, 473
newFAT(), 466, 470, 474, 475
nextFAT(), 457
NOT-equal to operator, 28
NTSC video standard, 335, 364

O

Object files, 9
OC32 control bit, 396
OCMbits, 488
OCxCON control register, 342, 343, 392
OCxCON register, 488, 490
OCxR register; see OCxCON register
OCxRS register, 490
OLED; see Organic LED displays (OLED)
OpenTimerXX () function, 159
Optimizations, integers on, 64 testing, 64–65
Organic LED displays (OLED), 219
OR operation, binary, 365
Other files, 10
Output compare modules, 342–344, 488–490
initialization routine for, 490
media player and, 498–499
producing analog waveforms with, 492–497
Output window, 301

P

Pac-Man game program, 258–261
Painted image, 334
PAL video standard, 335, 336
Parallel interfaces; see Parallel master port (PMP)
Parallel Master Port (PMP), 177, 223–224
configuration for LCD module control, 224–225
partition table, 436
Performance, 144, 145
peripheral bus clock, 147–148
Peripheral libraries, 40–41
Phase locked loops (PLL), 146
multiplication factor of, 147
PIC24, 399; see also Microprocessors
PIC32, 329
interfacing to PS/2, 290
PIC32 microcontroller
amount of RAM to store video image in, 340, 345
cache, 347, 348
flash memory of, 390
PIC32MX bus, 129–130
PIC32MX memory mapping, 130–134
PIC32 Starter Kit message testing with, 55–57
PICTail, 296
PICTail daughter board, 407
PICTail™, 361
Pixels, coordinate position of, 364–365
play() ; see PlayWAV()
playWAV(), 501–510
and audio routines, 510–512
coding of, 503–505
and playback sample rate, 506–510
plot (), 366
Plotting, of graphical objects, 364–366
PMCON register, 224, 245
PMMODE register, 228, 246
PMP busy flag, 228, 229
PMP data buffer ( PMPDIN ), 228
PMPDIN; see PMP data buffer (PMPDIN)
PMP library, 231–235
PMPMasterWrite(), 231
PMP mode; see Parallel Master Port (PMP) mode
PMP-to-LCD connection block diagram, 228
Pointers, 127–128
PortA, 7, 8
direction of pins in, 15
and JTAG port pins, 16, 17
LEDs connected to, 50
PortB, 17–19
PORTD pins, 223
PORTE pins, 223
POSTEQ_N, 340
Potentiometer and ADC, 251–252
Power consumption, 144–145
PR4, 309, 310
PREEQ_N, 340
Preprocessor, 6
Primary oscillator clock chain, 146–147
Printing text, on video screen, 391
Progress bar project, 241–245
code for, 242–243
Progressive scanning, 336
Project build
compiling, 9
debugging, 12–13
files in, 9–10
linking, 9
Project Wizard, 4
PR1 registers, 31
PS/2
communication protocol, 289–290
keyboard, interfacing methods
buffering mechanism, 319–324
change notification (CN) module, 302–308
cost and efficiency evaluation of modules, 308–309, 317–319
input capture modules, 290–296
I/O polling, 309–319
testing using stimulus scripts, 296–301
physical interface, 288–289
PIC32 interfacing to, 290
Pseudo-random number generators, 258, 260
to test efficiency of Bresenham algorithm, 371
to test video library project, 366
Pulse width modulation (PWM) mode, 485
audio routines, 510–512
and low-pass filter, 487
OC modules; see OC modules
playWAV(), 501–510
and reproduction of voice messages, 497–498
resolution of, 486
signals, 486–488
testing as D/A converter, 488–490
putcU (), 396
putcV (), 392, 396
putLCD(), 240
putsLCD(), 230, 232
PWM; see Pulse width modulation (PWM)
PWM filter circuit, audio, 499

Q

Quadrature encoders, 281

R

character (line end), 233
RAM, amount of on PIC32, 340, 345
RAM memory
bus offering access to, 129
map files, 126
mapping, 132–134
memory space allocation, 118, 121
placing heap in, 128–129
rand(), 258
RCA jack, 361
readDATA(), 449, 450
readFAT(), 458, 459
“readK ()” button encoding, 275–277
readSECTOR(), 414, 416, 436, 449
READ_SINGLE (CMD17) command, 413–414
Read status register command, testing, 182–186
ReadW() macro, 441
Real-Time Clock and Calendar (RTCC), 109–111
configuration of, 110–111
Resolution, horizontal and vertical, 340, 345, 357
RIFF chunk, 500
RIFF file format, 500; see also WAVE file format
root directory, 430–433
Rotary encoders, 280–283
interrupt-driven inputs, 283–287
state machine, 284
rotations array, 155
RS232 transceiver device, 198
RWTest program, 423
RX, 176

S

SAMP control bit, 253, 255, 267
Sampling timing, automating in ADC, 254–255
Scan codes, 324–325
Scanning
progressive, 336
video image, 334
SCK clock line, 195
SCKpin, 178, 180
SCL, 174, 175
SCL Generator timing example for basic, 298
SDA, 174, 175
SDI, 174, 175, 178, 193
SD/MMC cards, 404; see also SPI interface
to explorer 16 demo board, 406
project, 407–408
reading data from, 413–415
testing, 419–424
writing data to, 416–419
SDMMC.c module functions, 434
SDO, 174, 178, 193
SECAM video standard, 335, 336
Secondary oscillator; see Low-frequency oscillator
Sectors, 428
Secure Digital Card Association (SDCA), 404
Secure digital (SD) card, 404
command response code, 411
connectors pin-out, 405
initialization, 411–413
modes of communication, 405
specifications, 404, 411
writing data to, 414
SEE; see EEPROM, serial
Serial communication interfaces;
see I2C synchronous serial
communication interfaces;
SPI synchronous serial
communication interfaces;
Universal asynchronous
receiver and transmitters (UART)
Serial interface engine (SIE), USB, 215
Serialization, 346–353
Shadow registers, 101
short integer, 46
Simulator profiler, 301–302
sin (), 375, 495
singleV (), 401
Single vector interrupt management, 90–95
coding, 91, 92
testing, 93
Timer2for, 90–91, 92, 94
Sinusoidal function graph, 375
Slave select (SS), 175
Software simulator, 10–11
Source files, 9
SPI baud rate generator ( SPI2BRG ), 408
SPI2CON register, 407
SPI interface, 405
selecting, 408
sending commands in, 408–411
SPI module, 346
testing, 357–360
SPI peripheral module (SPI1), 406
SPI synchronous serial interfaces, 174; see also SPIxCON control register
advantage of, 175
baud rate in, 179, 180, 196
block diagram, 175
clock frequency of, 180
communication using, 179–182
module block diagram, 178
PIC32, 175
vs. I2C, 176–177
vs. UART, 176–177
SPIxCON control register, 179, 180, 194
Spreadsheet
to compute 100-point sinusoid, 496
Startup code, 7
Stimulus scripts, 296–301
StopWatch tool, 70–73
coding, 70–71
StepOver command execution, 71–72
String declaration, 116–117
Subpriority level, 86
S-Video, 364
SV_LINE, 355
SV_POSTEQ, 358
swapV (), 400
Synchronization, 346–353
Synchronization pulses
horizontal, 336, 338
vertical, 336, 339
Synchronous serial communication interfaces
I2C; see I2C synchronous serial communication interfaces
SPI; see SPI synchronous serial communication interfaces
versus UART, 174

T

T1CON, 32–33
Temperature sensing in ADC, 261–266
Temperature sensors; see Microchip TC1047A device
Text; see ASCII character set
Text Test project, 395
Timer1, 31–33, 226
application of, 103–108
low-frequency oscillator for, 108–109
Timer2
for multivectored interrupt management, 103
for single vector interrupt management, 90–91, 92, 94
Timers
combining, 159–160
OpenTimerXX () for, 159
Timer1; see Timer1
Timer2; see Timer2
WriteTimerXX () for, 159
T2Interrupt(), 508
TM162JCAWG1, Tianma, 220
TMR1, 31
Tracing function, 35–36
Triangular waveform, 494
TRISA register, 15
True logic value, 28, 29
TV broadcasting, 336
Two-dimensional function, graph of visualization, 376–380
TX, 176

U

UART; see Universal asynchronous receiver and transmitters (UART )
U2MODE, 201; see also UxMODE control registers
initialization value for, 201
Universal asynchronous receiver and transmitters (UART ); see also Console library
basic functionality of, 199
baud rate, 200, 201, 202, 215
baud rate in, 176
block diagram, 176
confi guration, 200–202
control registers; see UxMODE control registers
as debugging tool, 211
demo project, matrix, 211–214
modules block diagram, 199
receiving data from, 203
sending data to, 202–203
testing, 204–206
vs. I2C, 176–177
vs. SPI synchronous serial communication interfaces, 176–177
vs. synchronous serial communication interfaces, 174
USB bus, 198, 288, 290
serial interface engine (SIE), 215
User-defined symbols, 240
U2STA, 201
initialization value for, 202
UxMODE control registers, 201

V

Variable declarations, 45–46
Vectored interrupts, 98–103
Vertical synchronization pulses, 336, 339
VGA, 364
VH pointer, 364
Video frame signals, 336
Video image
buffering, 345–346
drawing lines, 368–370
memory map, 346
scanning, 334
Video interfaces, 364
Video library, 353–355
Video memory
direct memory access controller, 346
image map, 346
writing text on, 387–390
Video pins, 337, 345, 346
Video project, 356–357
Video standards, international, 335
VirtToPhys (), 356
Voice messages
PWM and reproduction of, 497–498
Voltage
input in ADC, 253
output in ADC, 261
VRES (vertical resolution); see Resolution
VT100 terminal, 206, 396
testing, 209–211

W

Wait states configuration, for flash memory, 160–163
WAVE file format, 500–501
uncompressed, 499
WAVE file player, 513–515
bandwidth require for, 515
dataflow, 507
Waveforms, analog, 492–497
algorithm for, 494
and Boethian notation, 495
spreadsheet program for, 495–496
While loop, 28–30, 43, 45
logic expression, 28–29
window array, 155
writeFAT(), 475
writeLCD(), 240
writeSECTOR() function, 416
WriteSPI2(), 181, 182
WriteTimerXX () function, 159
Writing text, on video memory, 387–390

X

xxCON registers, 224

Z

ZX80 processor; see Microprocessors
ZX Spectrum, 384–385
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.232.189