18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8<br />

Listing 8-6 (page 1 of 2). Creates and displays a custom character<br />

(upside-down question mark) on an LCD module.<br />

1 REM You must add lines 5-380 from Listing 8-4 to this<br />

2 REM program.<br />

400 REM R1-R8 store row patterns for custom character<br />

401 R1=4<br />

402 R2=0<br />

403 R3=4<br />

404 R4=8<br />

405 R5=10H<br />

406 R6=11H<br />

407 R7=0BH<br />

408 R8=0<br />

410 REM custom character number<br />

420 CC=0<br />

430 XBY(X)=RS<br />

440 XBY(X)=RW<br />

450 REM display clear<br />

460 XBY(A)=1<br />

470 XBY(X)=E+1:XBY(X)=E<br />

480 REM set CG RAM address to 0<br />

490 XBY(A)=40H<br />

500 XBY(X)=E+1:XBY(X)=E<br />

510 REM store R1-R8 in CG RAM<br />

520 D=(CC)+R1<br />

530 GOSUB 800<br />

540 D=(CC)+R2<br />

550 GOSUB 800<br />

560 D=(CC)+R3<br />

570 GOSUB 800<br />

580 D=(CC)+R4<br />

590 GOSUB 800<br />

600 D=(CC)+R5<br />

610 GOSUB 800<br />

620 D=(CC)+R6<br />

630 GOSUB 800<br />

640 D=(CC)+R7<br />

650 GOSUB 800<br />

660 D=(CC)+R8<br />

670 GOSUB 800<br />

150 <strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!