8051 Controller (BASIC)
8051-controller-20180830-01.jpg

Right now I have the controller configured to run MCS BASIC-52 V1.1.

10     REM TEST LCD
20     GOSUB 510
25     STRING 100,20
30    $(1)="BASIC-52 "
40     GOSUB 605
50    B=0C0H
60     GOSUB 410
70    $(1)="CONTROLLER "
80     GOSUB 605
81    $(1)=" 2018 "
82     GOSUB 605
90     END 
200    REM LCD DRIVER
210    REM LCD READY
220    DO 
230   F=XBY(8002H)
240    WHILE (F.AND.80H)<>0
250    RETURN 
300    REM WRITE DATA
310    GOSUB 220
320   XBY(8001H)=A
330    RETURN 
400    REM write command
410    GOSUB 220
420   XBY(8000H)=B
430    RETURN 
500    REM init lcd
510   B=38H
520    GOSUB 410
530   B=0CH
540    GOSUB 410
550   B=1
560    GOSUB 410
570    RETURN 
600    REM print strings
605   K=1
610    DO 
620   A=ASC($(1),K)
630    GOSUB 310
635   K=K+1
640    WHILE A<>20H
650    RETURN

2018-09-29

I have not had a lot of time to get any information up here but I am slowly learning a few pieces of this wonderful system.

basic-52-controller-2018-09-28-01.jpg

2019-01-25

This is a test routine to sequentially test D0-D7

10     DO                                                                       
20    XBY(8100H)=N                                                              
30    N=N+1                                                                     
35     GOSUB 60                                                                 
40     UNTIL N>100                                                              
45    N=0                                                                       
50     GOTO 10                                                                  
60     FOR I=1 TO 100                                                           
65     NEXT I                                                                   
70     RETURN

You can use the following commands to test the amber display above the keyboard.

PORT2 (8202H) drives segment.
PORT1 (8201H) drives digit.

On the BASIC prompt, type:

>XBY(8201H)=0
>XBY(8202H)=255

All digits will be turned on. This will test display. Note the right (2) LED displays will always be off.

You can use

>XBY(8100H)=0FFH

This will light all the GPIO1 leds (D0-D7)

The I/O space for 8051 Microcontroller:

8100H: GPIO1 LED

8000H; LCD command write

8001H: LCD data write

8002H: LCD Command read

8003H: LCD data write

8200H: PORT0, 8-bit input port

8201H: PORT1, digit drive

8202H: PORT2, segment drive

All I/O devices are mapped using external data memory. We can access them easily with XBY(address) command.

2019-01-26

I have been having some problems with the amber LEDs, segments (portions of one LED) have been dying as well as some entire LED were dead. Re-soldering them hasn't entirely resolved the LED issues with both units.

8051-Microcontrollers-(pair)-2019-01-26-001.jpg8051-xterm-console.jpg