Home
Mensch Computer Developer Guide
Contents
1. 44 XE UIDI L 45 D DISPLAY SET Ros eol av EE EE 46 2 DISPLAY amp SET NN D 46 3 DISPLAY amp SET ALARM 47 4 serge 0 6 48 UEM ico 48 6 INITIALIZE T UE 48 7 VIEW MODEM SETUP E 50 8 RETURN TO MAIN 51 2 52 1 ALTER vm 53 2 DISPLAY REGISTERS 54 3 SET BREAKPOINT Lem 54 d FILL MEMORY E 55 35 DUMP TO SCREEN RE 56 ASCI Screen D mp E 57 58 8 42 151 00029029290000 1 6 000 58 DEM FOL YE EE 59 1 58 60 P NEP P ILU NEU Dod terc eve 61 D MODEM 62 4 E 63 5 GAME CONTROLLER 64 0 SOFTWARE VERSION
2. E A E O 34 External Charger Power Module 34 THE WESTERN DESIGN CENTER INC Internal Battery Bock Alternate Power Configurations 2 2 2 2 00000000000002 0000000000000000 35 MINE PA CHECKOUT cc 36 POMP VY UNG TOWER e O 36 EE 37 VIG ee 37 172717 PUT NEN 37 7 37 OTT SAIS FC 37 MENSCH OPERA TENG uU e Un YN VER 39 SYSTEM MANAGEMENT WEE 39 TCS N 39 Initialization Sequence 39 Pertormed by Mensch MOBILE nosti da car EeeuEn 39 Performed by EPROM Mensch Operating System 1422252 02 0000000000000000000000505220 0 0000000 044 40 TIME OE DAY CEOCK CAEENDAR E 40 AT UO eeh 40 leggi T y RC 41 POWER MANAGEMENT esee ese ese ese sse ese 41 Battery Monitoring TT M P 41 Low Power Mode EE 41 Voltage Detection Circuitry E EE 42 Programming Support EE 42 NEEN Eeer 43 EE 43
3. sa esee esee esa aa esee sana aae 152 DUMP REGS 153 BLENI TI 32 H 154 155 FDELE d O i iE iror 155 ICI aor E 156 POETE ccc ne 156 402222 157 FOLT TY EE 157 FILELENG TH 157 FILL uni EE 158 FINDEIR n A E dum Mets 159 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide P es 163 164 ET EUN sso a a 165 GET ALARM STA TUS PH 166 CET FROM Ee 166 CT 167 Get E II e 168 HEY Rom 169 Me H m 170 GET MODEM RESbONSEk 170 ed 04 E UU ME CHR eee 171 E UU S EE T TT 172 MU LR 173 Oso its
4. 52 FIGURE 46 ALTER MEMORY PROMPT 53 FIGURE 47 ALTER MEMORY DISPLAY aaeeneenesenesessensensesserssrssrsserssesserserserosererestosersereeroseresrosersereeesersee 53 FIGURE 46 DISPLAY EIERE EA Centum Opa cn aa ru icri ure 54 FIGURE 49 SET 53 540029 WEEN 54 FIGURE 50 FILL MEMORY FIRST PpOovMpt 55 FIGURE 51 FILL MEMORY SECOND DROMPT ise ese ese tenerse eee 55 FIGURE 52 FILL MEMORY THIRD Pott 55 THE WESTERN DESIGN CENTER INC FIGURE 53 DUMP TO SCREEN FIRST PROMPT FIGURE 54 DUMP TO SCREEN SECOND DROMPT 56 FIGURE 55 DUMP TO SCREEN DATA DISPLAY 57 FIGURE 56 ASCII SCREEN DUMP FIRST PpOovMpr 57 FIGURE 57 ASCII SCREEN DUMP SECOND PROMPT eere he eene 57 FIGURE 58 ASCII SCREEN DUMP DATA DISPLAY 58 FIGURE 59 DEBUG sr yc 56 605 TEST MENU wens acces edn es EE ic 59 FIGURE 6l TEST MENU TBBE EE 59 FIGURE 62 KEYBOARBD TESE E 60 FIGURE 63 TEST MENU DTMF TEST 00 000004 0 61 FIGURE 64 TEST SCREEN 61 65 MODEM TES WEE 62 FIGURE 06 TES
5. Noeffecton port operation _ o Noeffecton port operation p o Noeffecton port operation p o Noeffecton port operation 0 1 Noeffecton port operation 0 1 _ Disable transmitinterrupts 0 1 Disable XON XOFF handshaking 0 1 Disable portpower 0 i Set DTR signal FALSE DTR2 1 0 i f Disable Echomode 0 it f Disable UART receive _1 1 Cea port input buffer _1 1 Clear port output buffer 1 1 Enable XON XOFF handshaking 1 1 Enable port pe pi 1 Set DTR signal TRUE DTR2 0 pi 1 f Enable Echomode Ji Enable UART receive RETURNS No arguments returned ERRORS No meaningful errors NOTE Any serial port on the W65C265S micro controller may be driven by either of the baud rate generators The decision was made to allocate one baud rate source to the modem port and share the other among the remaining ports in the Mensch Computer configuration This was based significantly upon the assumption that the keyboard
6. 38 Ke B 30884 EES EN Dol UPPER 44 FIGURE 29 MAIN MENU TREE E 44 FICURE SETUP MENU EE 45 FIGURE 31 SETUP MENU Ku DEEN 45 FIGURE 32 DISPLAY ai iniaa 46 FIGURE 33 DISPLAY amp SET DATE EEN 46 FIGURE 34 DISPLAY amp SET ALARM 47 FIGURE 35 ALARM ENTRY PROMPT wisssiisssiscesiesscciaisasesedtecvacdsiseusscevadcusdabsasseasegdsvelac vacdsuncodasesbavdseesveiusadeseess FIGURE 36 SETUP MENU OPTIONS 4 amp n 48 FIGURE 37 INITIALIZE MODEM 1ST SCREEN BLINKS QUICKLY 48 FIGURE 38 INITIALIZE MODEM 2ND SCREEN APPROX 5 40 004 4 20000 00002 49 FIGURE 39 INITIALIZE MODEM 3RD SCREEN W MODEM ID 0 ccc cece 49 FIGURE 40 INITIALIZE MOD 50 FIGURE 41 VIEW MODEM SETUP IST SCREEN 0000 888 50 FIGURE 42 VIEW MODEM SETUP 2ND SCREEN eese eene hene ese hee n eee ese ee tese ese tesis esee 5 FIGURE 43 VIEW MODEM SETUP ARD 8 51 FIGURE 44 DEBUG 32 FIGURE 45 2
7. 72 FIGURE 87 DUMP TO PRINTER FIRST 0 00004400 0 0000 002 73 FIGURE 88 DUMP TO PRINTER SECOND DROMPT 73 FIGURE 89 DUMP TO PRINTER BRIEF 0 74 FIGURE 90 DUMP TO PRINTER Low 74 FIGURE 91 DUMP TO SCREEN FIRST PROMPT 75 FIGURE 92 DUMP TO SCREEN SECOND PROMPT 3 75 FIGURE 93 DUMP TP SCREEN DISPLAY 75 FIGURE 94 ASCII SCREEN DUMP FIRST 76 FIGURE 95 ASCI SCREEN DUMP SECOND 2 00 00600000 76 FIGURE 96 ASCII SCREEN DUMP DISPLAY 76 FIGURE 97 ALTER MEMORY PpOowMprt 3 77 FIGURE 98 ALTER MEMORY EDIT SCREEN 77 FIGURE 98 ALTER MEMORY EDIT SCREEN 77 FIGURE 99 ROM MONITOR STARTUP PROMPT 8 78 FIGURE 100 ROM MONITOR CONMMANDS 78 FIGURE 101 RUN PCMCIA SHELL 5052 o Ee Bele DEF qs 79 FIGURE 102 PCMCIA SHELL OpPTIONS 79 FIGURE 103 MENSCH COMPUTER FRONT PANEL eem 96 FIGURE 104 REPLACING THE BATTERY 96 FIGURE 105 SYSTEM STATUS BAR BATTERY CONDITION NOR
8. 173 174 S CN 175 IS CARD INSERTED M 175 EE 176 SE 177 LOC DRD eerie ne 177 ECT 178 MENDU SE 179 IVE IVE 179 0 180 MODEM HANG UP 180 MODEM REDIA RE 181 MOVE BUFFER TO LUD EE 181 MOVE PAGE TO BUF an ete 182 POSITION PIXEL 182 POSITION TEXT CURSOR 183 183 SIRE 184 RD LCD INA 185 READ ALA RRM 185 RED DYTE 186 PINE ec ent EE ML 187 REMOVE DIRECTORY 0 000 00 0 0 000000 00000 187 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix D 1 Internal Battery Connector 20 eene eene eene enne 204 Appendix D 2 Controller Connector esses eene
9. 24 Connecting the 24 Programming 25 Keyboard Alternatives 25 PRINIER ee 26 Connecting the Printer module 26 Connecting Other Printer 26 EE 27 Alternative I O 27 MODEN 28 Connecting 4 28 Programming Support 4 7 29 Alternative I O 2 29 ig c 30 Connecting the Mensch Computer to a 30 Direct Connection To Another Mensch Computer 31 Connecting To Other Personal Computers eese 31 Programming Support 31 Alternative PED 31 CONTROLLER 32 Connecting the SEGA Game Controller essen eene nennen nas 32 Connecting Other Games Controllers 32 Programming Support ess 33 Interpreting Controller Status 2222222222222 0000000000000000 eens 33 Alternative aveunsieuseuesxaciaine xteevoecawesntucs 34 POVER US TEM
10. se bese S E 99 Card Support RE 99 Card Support PCMCIA Disk kmulaton 100 Timing and Count inp NR cm 100 Miscellaneous WT PH 100 ROM Monitor Subroutines 2 0 0 0 ccc ccccccseseseseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 101 Library Subroutine Descriptions 102 WEE t9 O ie eae 102 Nolo M m PP 103 CHECK Clo e 103 EMEN 104 104 NOTE 105 asp eset 105 ONEN N AAKO s reer eer sees ern ete werent ee mere arene 106 CONTROL CONTROLLER PORT 106 DISPLAY CET 107 108 CONTROL KEYBOARD PORT eerte RR 109 CONTROL MODEM PORT 110 CONTROL OUTPUT 111 CONTEUR POC PORT THER 112 CONTROL PRINTER 114 _DISP_LCD_HEADER oos icit PIRE dv tos
11. LA LA LA ON 99 02 03 04 05 07 Ctrl hH key or BACKSPACE key only or 9 key with any of CTRL or SHIFT SHIFT key A 3B key or ALT modifiers CTRL il key or TAB key SHIFT lt key 0A CTRL jJ key 0C D CTRL kK key E CTRL mM key or ENTER key SHIFT gt key F SHIFT gt key 0 SHIFT 2 key 92 0 0 3 5 v 2 4 6 7 7 9 bech LA _ 9 bech ON 3 4 4 4 ee 3 4 D 4E 5A E C F Gr Gi Gru Gi Gi AN oo 61 mn 5 3 3 4 4 4 4 4 4 4 4 4 5 5 D 5 oo 2 2 2 2 E F 20 22 23 24 25 26 27 29 A B C D 2E THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide A A i W 6 LA ON nN 62 64 65 67 6E 6F 70 72 74 77 TA 7B SHIFT key A F8 key SHIFT 1 key F9 key D SHIFT key F10 key TE SHIFT key am key To TI ALT 29 key SHIFT 1 key ALT aA key SHIFT F2 key ALT bB key SHIFT F3 key ALT cC key SHIFT F4 key 84 ALT dD key Zog Key ALT eE key ALT fF key SHIFT F7 key T DN SHIFT key ALT hH key ALT il key B SHIFT F10 key A ALT jJ key B SHIFT F11 key 8B ALT kK key SHIFT F12 key 8C ALT IL key CTET
12. RETRIEVE_DISPLAY_STATUS DESCRIPTION This subroutine will get the status byte for the LCD display VECTOR 00 8029 RETRIEVE_DISPLAY_STATUS EXPECTS No input arguments RETURNS Display status byte in 8 bit register A 0 c LCD Power 0 OFF 1 ERRORS No meaningful errors NOTE If the controller has been turned OFF via the CONTROL_DISPLAY_PORT subroutine then the returned status bits may be misleading SBREAK DESCRIPTION This subroutine will call the software break routine in ROM It will save and print the processor s registers and transfer control to the Mensch ROM Monitor s command processor Refer to Mensch Monitor Assembly Listing for specific details regarding the processing and internal operations of the SBREAK subroutine NOTE This is entry vector not a subroutine IT WILL NOT RETURN VECTOR 00 E05D SBREAK EXPECTS No input arguments RETURNS This vector does not return ERRORS No errors reported THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SELECTED COMMON RATE for all ports except modem DESCRIPTION This subroutine allows the program to reconfigure the common baud rate generator which drives the serial ports for the keyboard printer and PC link Changing this baud rate will affect all three ports If used incorrectly it can disable the keyboard Refer to Mensch Monitor Assembly Listing for specific details regardi
13. EM 116 _MAIN_MENU m 117 ENGAGE LOW POWER MODBL cione 117 ECCO Mu UE Tr 117 EC MIEL BE 118 GET CONTROLLER EE EE 118 KEYBOARD 119 KOH ILI BY No 119 120 120 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _RETRIEVE_CONTROLLER_ 126 RETRIEVE KEYBOARD STATUS 126 RETRIEVE MODEM PORT SIATUS 127 ARETRIEVE PC PORT STATUS EN baden 128 RETRIEVE PRINTER PORT 5 1 2 129 SELECT MODEM BAUD 130 _5 _ _ WA e NEE 130 SEND dump 131 SLND BELE 131 SEND DIGIT TT 132 SEND MODEM SIRING 133 E M COUNT 133 Een 134 I E E E E T 134 134 EECHER 135 I Eo ar
14. Initial Checkouts The first step in checking the Mensch involves assembling the components previously described Only the CPU module keyboard and display with appropriate special cables and power supply are necessary for checkout The controller modem and printer with appropriate special cables and PC are optional Applying Power Power is available to the W65C265 chip and slow clock circuitry whenever a battery is attached to the internal battery connector of the Mensch or external power is applied There is no power ON OFF switch A special low power mode feature reduces power consumption when the system is inactive A power ON reset should occur whenever the battery pack is first attached or when external power is applied without a battery pack A triggered reset may be initiated manually by pressing the RESET button on the front panel Figure 24 Mensch Computer Front Panel If everything is correctly configured and functional the LCD display should initialize and present the MAIN MENU MENSCH COMPUTER 12 34 56 MAIN MENU SETUP MENU DEBUG ROUTINES TEST MENU PCMCIA CARD MENU GOTO PROGRAM LOADs amp DUMPs ROM MONITOR RUN PCMCIA SHELL USE CURSOR UP DOWN amp ENTER TO SELECT Figure 25 MAIN MENU If the MAIN MENU does not appear as expected confirm that power is available and press the RESET button to force the reset initialization sequence to execute THE WESTERN DESIGN CENTER INC Mens
15. SET_TIME DESCRIPTION This subroutine will set the system time from a null terminated text string in a user specified buffer Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the SET_TIME subroutine VECTOR 00 E078 SET_TIME EXPECTS A pointer in 16 bit register X to a nine 9 character buffer located in memory bank 0 The string format is HH MM SS lt null gt wherein HH Hours code 0 23 possible in ASCH digits 00 Midnight 12 Noon 423 11 PM MM Minutes code 0 59 possible in ASCII digits SS Seconds code 0 59 possible in ASCH digits RETURNS No arguments returned ERRORS Carry bit Clear OK Set Error detected NOTE This subroutine requires a fixed size fixed format input string Therefore the null terminator character is acceptable but not really necessary STRCMP DESCRIPTION This routine will compare 2 strings and test if the same VECTOR 00 80C5 STRCMP EXPECTS TMP PTR Address of String Number 1 Register X High Address of String Number 2 Register A Bank of String Number 2 RETURNS If Strings are Equal Carry Bit Clear ERRORS If Strings are NOT Equal Carry Bit Set No other meaningful errors detected or reported 196 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide UPPER_CASE DESCRIPTION This subroutine will convert a lower case ASCII a z characte
16. MOS Version 1 00 Copyright 1994 Western Design Center All Rights Reserved gt Figure 101 RUN PCMCIA SHELL When the above prompt gt appears the user may enter a command i e FORMAT DIR ect or type EXIT to return to the MAIN MENU FORMAT DIR DEL EDIT Initialize Card Directory Delete Text File CLS DATE HELP EXIT Clear Screen Set Date Command List Return To Main Menu Figure 102 PCMCIA Shell Options The available commands may change but typing HELP should always display the current list THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Programming The Mensch Computer The Firmware provides some subroutines to allow user provided software to perform basic I O functions with the keyboard display modem printer PC link interface and controller The user provided software will access these subroutines through a vector table in EPROM These subroutines will pass arguments through registers and use the carry bit as an error flag Normally the carry bit will return clear indicating normal execution The carry bit will be set if an error occurred If further qualification of the error is appropriate a code will be returned in register A Serial Port Programming Considerations The W65C265 micro controller chip contains four serial communication ports These have been allocated on the Mensch as follows SO Keyboard 51 Printer S2 Modem and 53 PC
17. ALT mM key CTRL FE2Ky ____ 8E ALT nN key CTRL 4 F3 key St ALT key Guer 2 ALT pP key ALT qQ key CTRL F6 key 92 ALT rR key 93 CTRL F7 key ALT sS key CTRL F8 key 6 1 7 bech e 95 OO OO es o N CA 9 8 B B SS 94 95 97 A 9C OF 0 2 3 4 5 6 7 9 9 D E 2 4 CO C2 C3 C4 bech THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 21 MEM S S FE FF DO ALT F8ky PrtSc SysRqkey Pause Break key or SHIFT Pause Break key or ALT Pause Break key THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix Bibliography Recommended References Additional information on WDC products may be obtained by contacting The Western Design Center Inc 2166 East Brown Road Mesa Arizona 85213 USA TEL 480 962 4545 FAX 480 835 6442 Some useful materials from WDC are listed below Publication Programming the 65816 Programming the 65816 Excellent programming reference and Including the 6502 65C02 and 65802 by David Eyes and Ron Lichty tutorial for 65816 amp W65C265S W65C265S INFORMATION SPECIFICATION AND DATA SHEET W65C265S micro controller chip REFERENCE MANUAL program of the W65C2658 chip User Guide Mensch Computer Information about the Analog Disp
18. RETURNS No arguments returned ERRORS The carry bit normally will return clear but will be set if the control code in 8 bit register A was invalid CREATE DIRECTORY Reserved DESCRIPTION This vector currently invokes a non functional dummy subroutine It is reserved for subdirectory operations in future versions of the Mensch Operating System VECTOR 00 80C8 CREATE_DIRECTORY EXPECTS Not Applicable RETURNS Not Applicable ERRORS Not Applicable l thorough description of the algorithm is provided W65C265S INFORMATION SPECIFICATION AND DATA SHEET It also includes precalculated tables of value for typical FCLK frequencies and commonly needed tones modems This document and related literature is available from WDC THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide DIR_COMMD DESCRIPTION This subroutine outputs a file directory list on the LCD screen If there are no files then a message will appear If the list requires more than one screen then any keypress will page to the next screen VECTOR 00 80D4 DIR_COMMD EXPECTS Card specifier in 8 bit register A 00 Low Card Slot 01 High Card Slot RETURNS Normal operation of this subroutine will return with the carry bit clear and no other relevant arguments ERRORS If errors or exceptions were detected by this subroutine it will return with the carry bit set An error code for
19. TT Bach internal UART of W65C265 may select either Timer 3 or Timer 4 as a baud rate source Timer 4 may in some W65C265 configurations be used for Pulse Input Output instead of baud rate generation In that case Timer 3 must be used by all four serial ports THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Support Subroutines The Firmware support library provides two subroutines to set baud rates in the standard configuration Baud Rate Support Subroutines _SELECT_MODEM_BAUD_RATE for modem port only SELECT COMMON BAUD RATE for all ports except modem Each subroutine allows the following baud rates 110 150 300 600 1200 1800 2400 4800 9600 14400 19200 38400 57600 and 115000 Detailed descriptions of these library subroutines are provided in Appendix B Firmware Subroutine Library Keyboard I O Software Most application software for the Mensch will interact with users via the keyboard and display Therefore it is important to understand how the keyboard operates The keyboard provided with the Mensch Computer will automatically go in low power mode during periods of inactivity This inactivity can be forced by a command from the Mensch CPU Decoding Keyboard Status Programs may use the RETRIEVE_KEYBOARD_STATUS subroutine to determine the current status of the keyboard serial port This status will reveal whether or not the keyboard has been disabled If the keyboard is activ
20. VECTOR 00 8065 CONTROL CONTROLLER PORT EXPECTS Control code in 8 bit register A Zero Supply OFF Any Non Zero Supply ON RETURNS No arguments returned no registers changed ERRORS No meaningful errors CAUTION It is not meaningful to call this subroutine if the circuit board in the CPU module has been configured to use the controller port as an ordinary 8 bit I O port Refer to the appropriate schematic diagrams for more information 106 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CONTROL DISPLAY DESCRIPTION This subroutine allows the programmer to reset or manipulate the LCD display characteristics It can enable or disable the text display or the graphics display If both are enabled this routine can define how they interact VECTOR 00 805C CONTROL DISPLAY EXPECTS Control code in 8 bit register A Bit Bit Bit Bit Bit Bit Bit Bit M 7 6 5 4 3 2 1 0 eaning O 0 0 Displayisturned OFF ee enabled ELELLELLL eem enabled _0 TextcusorOFF __ p TI TexdipayOFF Paes fe f1 f Textdispay ON_ dispar OEE displays graphic and text displays Undefined option Sent to the T6963C LCD graphics controller Se displays Select Select 6x8 graphic mode Select 6x8 graphic mode
21. DESCRIPTION This subroutine removes last saved value of DP Pointer from an internal stack and stores it into the DP Register Pop s No safety VECTOR 00 8113 RESTORE DP POINTER EXPECTS No input arguments RETURNS No argument returned ERRORS No meaningful errors are detected NOTE This subroutine performs no error checking It should only be used to recover values saved by the INIT DP POINTER subroutine If no values have been saved its internal stacks can underflow This could set the direct page DP register to a garbage value 125 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide JRETRIEVE CONTROLLER STATUS DESCRIPTION This subroutine will read the controller port VECTOR 00 8056 RETRIEVE CONTROLLER STATUS EXPECTS No input arguments RETURNS Controller status byte in 8 bit register A wherein Bit 7 MSB will be set 1 if the controller port has been disabled Other bits will be irrelevant when this occurs If Bit 7 returns clear 0 then the lower seven bits will be the actual data read from the controller port ERRORS No meaningful errors NOTES If the controller has been turned OFF then the other returned status bits will be misleading Refer to the description of the CONTROL CONTROLLER PORT subroutine for more information RETRIEVE KEYBOARD STATUS DESCRIPTION This subroutine will return the current status of the serial keyboard por
22. Enable PC port output RETURNS No arguments returned ERRORS No meaningful errors THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CONTROL PC PORT DESCRIPTION This subroutine allows the programmer to manipulate the supply voltage delivered to the PC link serial port connector clear the I O buffers and configure the characteristics if the port It does not select the word length parity or number of stop bits These default to 8 bits no parity and one stop bit VECTOR 00 811F CONTROL PC PORT EXPECTS PC port configuration code in 8 bit register A 7 6 5 4 3 2 1 0 _ 0 port operation _ 0 Noeffecton port operation _ 0 Noeffecton port operation _ Noeffecton port operation _ o Noeffecton port operation p o Noeffecton port operation o Noeffecton port operation 0 1 Noeffecton port operation 0 1 Disable transmitinterrupts 0 1 Disable XON XOFF handshaking 0 i _ _ 0 1 f Set DTR signal FALSE DTR3 1 0 i f Disable Echomode 0
23. THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FGETS DESCRIPTION This routine reads a string of data from the specified file Routine will continue reading from the file until a byte of 00 or EOF is found VECTOR 00 80BO FGETS EXPECTS Register Y File Handle to Read From Register X Address to String Storage Location Register A Bank Address of String Storage Location RETURNS If String is Read successfully Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 24 End of File reached FGETW DESCRIPTION This routine reads a Word of data from the specified file VECTOR 00 80AD FGETW EXPECTS Register Y File Handle to read from RETURNS If Word is read successfully Carry Bit Clear Register X Word just read from file ERRORS Else Carry Bit Set Register A Error Code 24 End of File reached FILELENGTH DESCRIPTION This routine returns the current size of the specified file VECTOR 00 80BC FILELENGTH EXPECTS Register A File Handle of File to test RETURNS Register X Low word of File Length Register Y High word of File Length ERRORS No meaningful errors returned 157 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FILL_Memory DESCRIPTION This is the subroutine invoked by typing the F command at the monitor prompt Basically FILL_Memory will request starting and ending addresses and a fill constant via all sele
24. This LOAD amp DUMP MENU item allows the user to send a block of memory to a host computer via the PC Link serial port as 528 records Enter Lowest Address BB AAAA Figure 83 DUMP 528 Records First Prompt When this option is selected it will display the above prompt for the owest address the memory block The user may cancel this operation by pressing the ESC Escape key instead of entering an address Enter Lowest Address BB AAAA 00 0000 Enter Highest Address BB AAAA Figure 84 DUMP 528 Records Second Prompt After the user has entered a lowest address the above prompt for highest address will appear Again the user may cancel this operation by pressing the ESC Escape key instead of entering an address THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide The LCD screen will echo the characters as they are sent to the PC Link serial port The LCD screen may be difficult to read because the data is in S28 record format 52140000005 5 5005 69 5005 0002005 0002 0029 52140000105 0082005 7287005 43 2005 0002 0019 52140000205 2604003600360000000000000000 0059 5214000030000000000300030043039503990390 0398 5214000040530302030004000466000000028004 2 82 Figure 85 DUMP S28 Records Brief 52140000005 5 5005 69 5005 0002005 0002 Z nn 05C0082005C7287005C43EZ005C0002 Se TPT eH RE F46B7BC002A6C02000500AF00 EE D
25. VECTOR 00 8053 _RETRIEVE_PC_PORT_STATUS EXPECTS No input arguments RETURNS PC link port status byte in 8 bit register A O LSB_ Data in input buffer ESCape or C received XON XOFF protocol mode Port power is ON 4 DSR signal is TRUE DSR320 Echo mode is enabled 6 Input buffer has overflowed 7 ven Output buffer has overflowed ERRORS No meaningful errors NOTES If the PC link port supply voltage has been turned OFF via the CONTROL PC PORT subroutine then the returned status bits may be misleading 128 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _RETRIEVE_PRINTER_PORT_STATUS DESCRIPTION This subroutine will return the current status of the serial printer port VECTOR 00 803B _RETRIEVE_PRINTER_PORT_STATUS EXPECTS No input arguments RETURNS Printer port status byte in 8 bit register A O LSB_ Data in input buffer ESCape or C received XON XOFF protocol mode Port power is ON 4 DSR signal is TRUE DSR1 0 Echo mode is enabled 6 Input buffer has overflowed 7 ven Output buffer has overflowed ERRORS No meaningful errors NOTES If the printer port supply voltage has been turned OFF via the CONTROL PRINTER PORT subroutine then the returned status bits may be misleading 129 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SELECT MODEM BAUD RATE for modem port only DESCRIPTION This subroutine will allow the pro
26. mode Ed IdI EM pi Resetusing pattern Reset using ae setup parameters Display ON Blinking cursor and Text OR ed w 6x8 Graphics RETURNS No arguments returned ERRORS No meaningful errors THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _CONTROL_INPUT DESCRIPTION This subroutine sets up the input paths for GET_CHR and other stream oriented subroutines It turns input stream ports ON amp OFF VECTOR 00 80DD CONTROL INPUT EXPECTS Control information in 8 bit register A Bit Bit Bit Bit Bit Bit Bit Bit M 7 6 5 4 3 2 1 0 eaning p loco loc 0 Donotaffect keyboard input o 0 Donotaffect printer port input Pp oc 0 Do not affect modem port input o Donotaffect PC port input 0 1 Disable keyboard input 0 1 Disable printer port input 0 1 Disable modem port input 0 i Disable PC portinput 1 1 Enable keyboardinput 1 1 Enable printer port input _1 1 Enable modem por jEnablPCpotipt RETURNS No arguments returned ERRORS No meaningful errors
27. A 4 digit counter will appear on the screen and increment as each record is received If more than ten thousand records are processed the counter will wrap around and start at zero again This loader performs only minimal validation of received records It does detect checksum errors in properly formatted S28 records If a checksum error is detected the loader will echo a 7 Question Mark to the display 7 00017 Figure 80 LOAD S28 Records THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide The load operation terminates when the final record usually 5 804000000 is processed or an ESC Escape character is detected from any enabled input stream The loader will display a final status message near the bottom of the screen 0666 Load is completed OK Figure 81 LOAD S28 Records 4 Any keypress may be used to acknowledge the status message and return control to the LOAD amp DUMP MENU screen 2 Reserved LOAD amp IDUMIP MENU Optiom This function is not yet assigned It has been reserved for future use When this menu items is selected the following screen will appear 06 18 94 MENSCH COMPUTER 12 34 56 Function not available Figure 82 LOAD amp DUMP MENU Option 2 Press any key to return to the LOAD amp DUMP MENU screen THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 3 DUMP 528 Records LOAD amp IDUMIP MENU Optiom
28. Non destructive testing may be accomplished by accessing the alarm flag directly from page 0 Refer to the source code listing for specific details GET_BYTE_FROM_PC DESCRIPTION This subroutine will read the next available byte from the PC link serial port 3 input buffer If the buffer is empty then the subroutine will return with the carry bit set Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the subroutine 00 E033 GET_BYTE_FROM_PC EXPECTS No input arguments RETURNS Received byte from PC link serial port in 8 bit register A ERRORS The carry bit will return clear if a received data byte is available in 8 bit register A It will be set if no received data was available 166 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide GET_CHR DESCRIPTION This subroutine will get a single character from the selected INPUT streams IT will sample the selected input sources and returns the first character detected Refer to the description of CONTROL_INPUT for details about configuring the input stream and selecting input sources Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the GET_CHR subroutine VECTOR 00 8036 GET_CHR EXPECTS No input arguments RETURNS Normally returns with carry bit clear and received character 8 bit register
29. X ADDRA 26 IL A3 X ADDR3 O ZIL Ai ADDR 0 28 Al ADDR I 3 V A0 ADDRO 30 10 1 BDATAO0 31 DI bDATA 2 32 ATA 34 OND GND J 444 HighICCard LowlCCard P42R D 371 NetUsed J gt 98 1 NetUsed 2 2 9 1 NetUed DATA 40 NetUed DATA 2 At NetUsed DATAIS J gt 42 SV CarEnable2 __ 4 NetUsed RESERVED 45 NotUsed X RESERVED 46 1 7 ADDR 247 8 ADDRI8B O THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 48 AID 2 1 Y Y O 49 A200 ADDRO Ir A2 7 84 ADDR23 1 585 GND ADDRAM 56 GND ADDR2 57 W NeUsd RESERVED fee L gite RS2 H oeo batat 122 R DATAD 1 NotUsed DATAIO Of 7 1 P45R lee GROUND SO THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix D 6 Expansion Connector Pinouts Pin Comments and Notes a aie 16 Not TOT 8 Not Used 2 P7 ic KS FIRES PIRES i I gt I GO GO Go Go Go Go Go Go Go NI
30. a a 65 CRAP NH EE EE 65 8 RETURN TO MAIN 2 42 65 4 PCMCIA CARD MENU ua 66 D COITO GEA tnm 67 65 68 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 1 LOAD S28 Records 001111 69 RCS uii 70 3 DUMP S28 Records ERU 71 d DUMP i0 PRINTER Ace T3 NE Eric 25 75 6 ASCII Screen Dump 76 ALTERMEMORY E 9 RETURN TO MAIN MENU 2555 os 17 Te TN dE 78 8 RUN PCMCIA ET E E 79 PROGRAMMING THE MENSCH COMPUTER csscsccoccccssssssccccccccsssssscccccccccssscccccccccessssscccoees 80 SERIAL PORT PROGRAMMING LC ONSIDERATIONS 80 Baud Rate asa Sse Rm 80 Support 2 2204 202 0 000 0 gt etate 81 Keyboard I O SOW GEG 81 Decoding Keyboard Status 81 Decoding Keyboard Input EE 81 Commanding bkevboard 81 Support
31. an input parameter of 63 will be returned as 43 in register A If the parameter byte passed in register A is not a valid ASCII Hexadecimal character the ISHEX subroutine will return with the carry bit set in the status register ERRORS No errors reported LOG_DRIVE DESCRIPTION This routine switches the current drive to the card in the specified PCMCIA slot VECTOR 00 807D LOG_DRIVE EXPECTS Register A PCMCIA Slot code 00 Low Card Slot 01 High Card Slot RETURNS If RAM Card Logged to properly Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 01 No Card Found in the specified slot 02 Boot Sector on specified card is Invalid 13 Invalid File Access Table FAT THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide MENU_POINT DESCRIPTION This subroutine does the following 1 Asks for a keyboard character 2 Keeps the time and date current on the LCD header 3 Moves the cursor up amp down in first column as arrow keys are pressed 4 Returns to the calling program with carry bit clear and ASCII code for 1 through 8 corresponding to the current menu line when the ENTER key is pressed Returns to the calling program with carry bit clear and ASCII code for 1 through 8 if such a key is pressed 6 Returns to the calling program with carry bit set if the ESC Escape key is pressed VECTOR 00 80E9 MENU_POINT EXPECTS N
32. and high frequency wide power supply range 1 8 volts to 6 0 volts and a debug monitor on ROM W65C265 Microprocessor W65C265S has W65C816S core microprocessor which is a fully static version of the W65C816S This part can operate at very low clock frequencies for low power consumption W65C265S chip also includes 576 bytes of static RAM 8K bytes of mask ROM eight 8 bit bi directional I O ports and eight 16 bit timers The 65I O pins may be reconfigured in software to provide additional functions These include external memory bus 8 bit data 24 bit non multiplexed address hardware interrupts 1 NMI or ABORT 1 IRQ 1 positive edge 3 negative edges eight chip select outputs for external static memories and I O four UARTs and a parallel interface bus PIB In addition the W65C265S has the following features vectored interrupt system 29 priority encoded interrupts two clock inputs software switchable between low frequency and high frequency wide power supply range 2 8 volts to 6 0 volts and a debug monitor in ROM W65C816 Microprocessor The W65C816S has 91 instructions 255 operational codes and 24 addressing modes with one 16 bit accumulator two 16 bit index registers and a 16 bit stack pointer 64K byte stack The standard part has an 8 bit data bus and a 24 bit address bus 16M byte address space The clock input is not divided internally the memory bus runs at one clock cycle per memory cyc
33. register A is non zero 103 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _CHECK_YN DESCRIPTION This subroutines will check for Yes or No responses from keyboard input VECTOR 00 80F2 _CHECK_YN EXPECTS No input arguments RETURNS Carry bit set means that an ESC Escape character was detected Carry bit clear means an appropriate Yes or No response character has been detected The code for this will be in the 8 bit register A wherein or n for or Y or for Yes ERRORS No meaningful errors are detected _Circle DESCRIPTION This subroutine will plot a circle on the display in graphics mode VECTOR 00 8195 _Circle EXPECTS Center of circle coordinates in 16 bit register X and 16 bit register Y Radius of circle in 8 bit register A RETURNS Normal operation returns with the carry bit clear ERRORS If the coordinate in register X exceeds 239 or the coordinate in register Y exceeds 127 then this subroutine will return with the carry bit set and the circle will not be drawn NOTE If any portion of the circle has coordinates outside of the boundaries of the display then that part will not be drawn 104 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide ClearColor DESCRIPTION This subroutine will clear the COLOR flag
34. 1 f Disable UART receive 0 pi 1 Cea port input buffer pi 1 Clear port output buffer pi 1 Enable XON XOFF handshaking _1 1 Enable port power pi 1 Set DTR signal TRUE DTR3 0 pi 1 f f Enable Echo mode pt Lj Enable UART receive 0 RETURNS No arguments returned ERRORS No meaningful errors MORE THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _CONTROL_PC_PORT Continued CAUTION The PC link port in the Mensch configuration is driven by the common baud rate generator T4 The SELECT COMMON BAUD RATE routine may be used to change the baud rate for the PC link port but it will also affect the printer and the keyboard ports as well NOTE Any serial port on the W65C265S micro controller including the PC link port may be driven by either of the baud rate generators The decision was made to allocate one baud rate source to the modem port and share the other among the remaining ports in the Mensch configuration This was based significantly upon the assumption that the keyboard printer and PC link ports could be preset and would probably remain constant Likewise it was assumed that the modem port would frequently need to change its baud rate to accommodate ex
35. 135 277 301 Firmware Subroutine Library 27 32 36 40 45 48 61 64 113 116 117 119 120 121 126 127 128 129 132 133 134 136 CHECK VOLTAGE 135 CHECK YN 144 ClearColor 151 ClearFill 29 CLR STPWTCH 135 CONTROL CONTROLLER PORT 48 CONTROL DISPLAY 122 CONTROL INPUT 142 CONTROL KEYBOARD PORT 156 CONTROL MODEM PORT 158 CONTROL OUTPUT 160 CONTROL PC PORT 161 CONTROL PRINTER PORT 164 DISP LCD HEADER 167 DO MAIN MENU 168 ENGAGE LOW POWER MODE 168 GET A PRINTER BYTE 168 GET BIN NUM 170 GET CONTROLLER DATA 170 GET KEYBOARD CHARACTER 171 _GetGrStatus 143 GetPoint 143 INIT DP POINTER 145 OS SHELL 175 PRINT A BYTE 176 _PtScreen 178 RD COUNT 178 RD STPWTCH 135 RESTORE DP POINTER 145 RETRIEVE CONTROLLER STATUS 181 RETRIEVE KEYBOARD STATUS 181 RETRIEVE MODEM PORT STATUS 183 RETRIEVE PC PORT STATUS 184 RETRIEVE PRINTER PORT STATUS 185 SELECT MODEM BAUD RATE 186 SEND MODEM BYTE 186 220 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SEND 187 SEND BYTE TO KEYBOARD 187 SEND DIGIT 188 SEND MODEM STRING 189 SET COUNT 189 _SetColor 190 _SetGraph 190 _SetGraphText 192 _TIME DATE 194 Alter_Memory 196 BACKSPACE 197 CHANGE DIRECTORY 201 CLEAR LCD DISPLAY 201 CLEAR TO END OF LINE 203 CONTROL SPEAKER AMP 203 CONTROL TONES 204 CREATE DIRECTORY 204 DIR COMMD 206
36. 250 251 Get S Address 146 237 H Hardware 17 24 61 62 135 279 280 297 HEAD PHONES jack 21 HighICCard 24 286 287 288 224 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide IC Card Connectors Pinouts 283 284 286 289 IC Memory Cards 17 Initial Checkouts 52 Initialization 21 24 56 INITIALIZE MODEM 70 71 Insert Key 295 296 Internal Speaker 21 Interrupts 56 58 62 156 158 161 164 209 280 J Jack CHARGER 21 K Keyboard 20 23 31 32 112 113 114 115 116 156 181 187 284 300 Commanding 114 187 Decoding Input 114 Decoding Status 113 KEYBOARD TEST 85 Keycodes 114 291 L LCD See Liquid Crystal Display 21 22 26 27 28 29 30 36 51 52 54 58 61 64 80 81 83 91 96 97 101 103 104 106 117 122 123 124 125 126 127 128 143 144 153 167 173 174 175 178 189 190 192 194 201 203 206 207 208 211 212 247 248 251 252 253 255 261 274 276 278 299 300 Liquid Crystal Display Accessing 32 36 40 48 60 74 131 133 134 228 231 Displaying Graphics 126 LOAD amp DUMP MENU 96 97 99 100 101 102 103 104 105 106 108 ASCII Screen Dump 6 7 13 14 DUMP 528 Records 13 DUMP to PRINTER 13 DUMP to Screen 13 14 LOAD 528 Records 7 97 98 99 LOAD S28 Records 7 13 LOG DRIVE 10 131 LowICCard 5 24 25 286 287 288 Low Power Mode Power Management 6 61 MAIN MENU 6 7 52 53 58 6
37. 5C 69 C5 00 5C 00 02 00 5C 00 82 00 00 0010 5C 00 82 00 5C 72 B7 00 5C 43 EZ 00 5C 00 82 00 00 0020 5C 26 04 00 7D 00 7D 00 00 00 00 00 00 00 00 00 00 0030 00 00 00 00 03 00 03 00 35 01 BF 01 8D 02 93 82 00 0040 02 A8 02 00 04 00 04 66 00 00 00 02 80 04 ZA 00 0050 DF 89 CF 20 B7 BC 80 ZA 6C 02 00 05 00 AF 00 00 Figure 89 DUMP to PRINTER Brief Address 01234 567 89 A BCDEF 00 0000 5C 5B C5 00 5C 69 C5 00 5C 00 02 00 5C 00 82 00 00 0010 5C 00 82 00 5C 72 B7 00 5C 43 EZ 00 5C 00 82 00 00 0020 5C 26 04 00 7D 00 7D 00 00 00 00 00 00 00 00 00 00 0030 00 00 00 00 03 00 03 00 35 01 BF 01 8D 02 93 82 00 0040 02 A8 02 00 04 00 04 66 00 00 00 0Z 80 04 ZA 00 0050 DF 89 CF Z0 B7 BC 80 ZA 6C 02 00 05 00 AF 00 00 00 0060 60 00 00 00 00 00 FF 00 00 BF O Figure 90 DUMP to PRINTER Long Press any key to return to the LOAD amp DUMP MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 5 DUMP to Screen LOAD amp DUMP This LOAD amp DUMP MENU item allows the user to examine a block of memory by dumping its contents appropriately formatted in hexadecimal to the LCD screen Enter Lowest Address BB AAAA Figure 91 DUMP to Screen First Prompt When this option is selected it will display the above prompt for the owest address in the memory block The user may cancel this operation by pressing the ESC Escape key instead of entering an address Ent
38. 65535 Then Register A 06 Register X 5535 ERRORS No meaningful errors are detected Western Design Center Inc recommends that software developers use an include file in their source programs which assigns symbolic names to these vectors current file is available from WDC 102 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _Box DESCRIPTION This subroutine will plot an orthogonal box on the display in graphics mode VECTOR 00 8198 _Box EXPECTS The first corner coordinates of the box must be in the most significant bytes of 16 bit register X and 16 bit register Y The coordinates of the diagonally opposite corner must be in the least significant bytes of the same registers RETURNS Normal operation returns with the carry bit clear ERRORS If either coordinate register X exceeds 239 or either coordinate in register Y exceeds 127 then this subroutine will return with the carry bit set and the box will not be drawn CHECK VOLTAGE DESCRIPTION This subroutine will sample the voltage sensor status VECTOR 00 806B CHECK VOLTAGE EXPECTS No input arguments RETURNS Voltage sensor status in 8 bit register A 00 External power is available 01 Running on batteries with adequate power available FF Running on batteries and the batteries are low ERRORS No meaningful errors are detected The carry bit normally will return clear but will be set if
39. A other registers are saved upon entry and restored before returning ERRORS Exception returns carry bit set if no input sources are enabled No other meaningful errors are detected 167 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Get_E Address DESCRIPTION This subroutine writes the following prompt string to all selected output streams Enter Highest Address BB AAAA It then perform GET_3BYTE_ADDR which accepts six ASCII Hex digits from any selected input stream to form a 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address to each of the selected output stream AAAA is the offset address within the bank Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the Get_E_Address subroutine VECTOR 00 E045 Get_E_Address EXPECTS No input arguments RETURNS No output arguments The 3 byte result is returned the global variables 2 00 0063 TMP2 1 and TMP2 2 The bytes are ordered such that TMP2 LSB and TMP2 2 MSB The subroutine will return with the carry bit clear if a proper 6 digit address has been received ERRORS The carry bit will be returned set if any non digit character is detected before all six ASCII Hex digits have been received 168 THE WESTERN DESIGN CENTER INC Mensch Computer De
40. AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address to all output streams enabled by CONTORL OUTPUT AAAA is the offset address within the bank Refer to the description of CONTROL INPUT for details about configuring input stream and selecting input sources Refer to the description of CONTROL OUTPUT for details about configuring the output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the GET 3BYTE ADDR subroutine VECTOR 00 E02D GET 3BYTE ADDR EXPECTS No input arguments RETURNS No output arguments The 3 byte result is returned in the global variables TMP2 00 0063 TMP2 1 and 2 2 The bytes are ordered such that TMP2 LSB and TMP2 2 MSB The subroutine will return with the carry bit clear if a proper 6 digit address has been received ERRORS The carry bit will be returned set if any non digit character is detected before all six ASCII Hex digits have been received 164 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Get_Address DESCRIPTION This subroutine will write the following string to all selected output streams Enter Address BB AAAA IT then performs GET_3BYTE_ADDR which accepts six ASCII Hex digits from selected input stream to form a 24 bit address The input format is BB AAAA Wherein BB 15 the bank address
41. CPU module Keyboard and Display are packed in individual boxes for shipping The Keyboard and Display are easily connected to the CPU The charger and peripherals attach to the Mensch CPU module via connectors on the rear panel See Figure 3 Figure 3 Mensch Computer Rear Panel CPU Module The CPU module is the core of the Mensch It contains the main board with the W65C265 microcontroller This also includes both fast and slow clock circuits appropriate power control logic a speaker circuit RAM EPROM and connectors for external peripherals Mensch Serial Serial PC Keyboard Printer Modem Ee Display ROM Controller lt CPU Module Speaker Power Control em EPROM Sex LowICCard HighICCard Card 1 Card 2 Figure 4 Mensch Computer CPU Module 1 The Western Design Center Inc offers a variety of additional information on the W65C265 micro controller Refer to Appendix F Bibliography for specific titles uuwuuwLUesternDesignCentercorn 17 THE WESTERN DESIGN CENTER INC Mensch Cor puter Developer Guide Figure 5 Mensch Computer Front Panel Power Control There is no power ON OFF switch on the Mensch A special low power mode feature reduces power consumption when the system is inactive Power is never removed from the W65C265 chip itself Background operations in the Firmware maintain the time of day clock The support software for this resides in the masked ROM of
42. Clock 17 21 22 52 54 56 58 59 60 62 67 133 134 204 209 278 280 281 CLOCK ie Fast Clock Slow Clock Default Clock 20 uuwuwLesternDesignCentercorn 220 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Com Log Company Inc 2 3 4 Commands 39 64 71 87 109 110 111 114 175 280 Communications 42 109 118 120 Configuration 17 24 32 33 35 37 38 41 45 46 51 56 112 113 120 122 129 137 156 157 158 159 161 164 196 210 211 212 213 214 215 216 217 218 222 251 252 268 278 CPU Module 27 31 34 38 42 46 Connections 4 159 163 166 Direct Connection To Another Mensch Computer 44 Keyboard 17 31 32 33 51 52 59 61 69 84 85 86 112 113 114 115 116 134 139 147 150 155 156 157 159 163 166 171 181 182 247 263 Other Game Controllers 47 Printers 34 35 89 112 To a PC 120 contrast control 27 CONTROL_SPEAKER AMP 63 129 136 139 140 203 204 CONTROL_TONES 129 140 204 Controller 26 46 48 121 123 140 181 283 299 Connector Pinouts 3 CPU Module 17 20 21 22 23 24 27 31 34 38 42 51 52 114 138 152 ON OFF Switch 21 52 CREATE_DIRECTORY 204 D Date 54 58 66 67 84 91 194 247 256 269 272 DateField 54 DEBUG MENU 74 75 76 77 78 80 81 83 92 Display Registers 109 DUMP To Screen 80 81 104 105 FILL Memory 109 Decimal Mode 57 DEL Delete Key 295 296 Densitron Cor
43. PCMCIA card VECTOR 00 808F FOPEN EXPECTS Register X Address of Path String in Memory Register A Bank address of Path String in Memory Register Y File Open Code 5 r Open file in read only mode 2 w Open File for writing Overwrite existing file Open file for append or create new file R Open file for updating Read and Write Create file in update mode Read and Write A Open file for append or create new file RETURNS If File was successfully opened Carry Bit 2 Clear Register A File Handle for subsequent usage ERRORS Carry Bit Set Register A Error Code 01 2 No Card Found in the Slot 02 Boot Sector on Card is Invalid 13 Invalid File Access Table FAT 20 Invalid Open mode 21 File no found for Read Mode 22 Too many files open to open this file FORMAT DESCRIPTION This routine formats a PCMCIA RAM Card installed in the specified PCMCIA slot The format used is standard MSDOS format VECTOR 00 807A FORMAT EXPECTS Register A PCMCIA Slot Code 00 Low Card Slot 01 High Card Slot RETURNS If RAM Card formatted properly Register A Number of 64K Banks on Card Carry Bit Clear ERRORS If Card not formatted Carry Bit Set Register A Error Code 01 No Card Found in the specified slot 03 Card is to big for the specified slot 160 THE WESTERN DESIGN CENTER INC Mensch Computer De
44. STAGE 2 Performed by the EPROM Mensch Operating System Miscellaneous initialization Start the fast clock delay while it becomes stable and then switch to fast clock Initialize the RAM interrupts vectors Setup the 1 second time of day clock interrupt Setup serial I O buffers amp pointers in RAM Check the Time of Day clock checksum If the clock checksum has been corrupted Reset the Time of Day clock Reset the baud rate counters for the serial ports to their default values Set up the control ports of the serial UARTs menus and perform requested operations STAGE 3 Performed by application software Time Of Day Clock Calendar The Mensch Computer includes a time of day clock feature which operates even when the system is in low power mode The date and time are typically displayed and updated in the top corners of the LCD screen The time of day clock may also be set and read by application programs Alarm Function A built in alarm function uses the time of day clock The user may set or check the alarm from the keyboard via utility programs or within software applications via library subroutines When the alarm times out the firmware will beep the speaker until the space bar the keyboard 15 pressed THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Programming Support The Firmware provides library subroutines for programmers to use when accessing the
45. THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CONTROL KEYBOARD PORT DESCRIPTION This subroutine allows the programmer to clear the I O buffers and configure the characteristics of the port It does not select the word length parity or number of stop bits These default to 8 bits no parity and one stop bit VECTOR 00 8059 CONTROL KEYBOARD PORT EXPECTS Keyboard port configuration code in 8 bit register A 7 0 5 4 3 2 1 0 Loo f 0 Noeffecton port operation Lo f 0 Noeffecton port operation tl 0 Noeffecton port operation p f f of Noeffecton port operation f of p port operation p of Noeffecton port operation p of port operation L0 1 port operation L0 LI Disable transmit interrupts L0 1 Disable XON XOFF handshaking 0 1 Send start message to keyboard L0 L TI SetDTR signal FALSE 1 L0 1 Disable Echomode L0 i ft f Disable UART receive 8 f 1 Clear port input buffer pt 1 Clear port output buffer 1 Enable XON
46. Warning Developers should mote that while the W65C265 micro controller has four serial ports it allows only two baud rate generators In the Mensch computer configuration the Modem port has an independent user selectable baud rate The other three serial ports including the PC link are driven by a common oscillator Changing this source will affect all three ports THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Controller The SEGA 6 button Arcade Pad game controller has been tested and can be used with the Mensch Computer When the MenschWorks software accepts controller input it assumes total compatibility with the SEGA 6 button Arcade Pad Figure 18 SEGA Game Controller Connecting the SEGA Game Controller It is connected through the game controller port on the rear panel of the Mensch Computer Controller Connector Figure 19 Mensch Computer CPU Module Rear Panel Controller Connector The controller port has been mapped as 00 DFEO in the address space of the Mensch Computer configuration Connecting Other Game Controllers Several game controller products are marked as SEGA compatible Usually this just means that they plug into the same 9 pin connector as the SEGA 6 button Arcade Pad Some of these products such as the SG ProPad have many additional switches or significantly different configurations If such a controller is attached to the Mensch the signals on the 9 pin con
47. X exceeds 239 or the coordinate in register Y exceeds 127 then this subroutine will not draw the point PRINT A BYTE Send via printer port DESCRIPTION This subroutine will queue one byte from 8 bit register A to be sent to the serial printer port The carry bit will be set if the serial printer port cannot accept data otherwise it will be clear upon return VECTOR 00 803E PRINT BYTE EXPECTS Output byte in 8 bit register A RETURNS No arguments returned ERRORS Carry bit Clear OK Set Serial printer port cannot accept data PtCode DESCRIPTION This subroutine will write an escape character ESC 1B to the printer port followed by whatever data is in 8 bit register A VECTOR 00 81A4 PtCode EXPECTS ASCII character in 8 bit register A RETURNS No arguments returned ERRORS No meaningful errors are detected 123 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _PtLn DESCRIPTION This subroutine will write a carriage return CR 0D and linefeed LF 0A sequence to the printer port VECTOR 00 81A7 PtLn EXPECTS No input arguments RETURNS No argument returned ERRORS No meaningful errors are detected _PtScreen DESCRIPTION This subroutine will dump the contents of the LCD screen to the printer DUMP flags may be configured to direct this dump to include either text or graphics or both Refer to descriptions of _SetGraph _SetGraphText a
48. XOFF handshaking pt f tf port operations pt f f tf Set DTR signal TRUE DTRO 0 pt fit Enable Echo mode li j jEnaeUARTrmciv RETURNS No arguments returned ERRORS No meaningful errors CAUTION The keyboard in the Mensch Computer configuration is driven by the common baud rate generator T4 The SELECT COMMON BAUD RATE routine may be used to change the baud rate for the printer and PC link ports but it will also affect the keyboard port as well THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CONTROL MODEM PORT DESCRIPTION This subroutine allows the programmer to manipulate the supply voltage delivered to the modem serial port connector clear the I O buffers and configure the characteristics if the port It does not select the word length parity or number of stop bits These default to 8 bits no parity and one stop bit The modem port in the Mensch Computer configuration is driven by an independent baud rate generator T3 The SELECT MODEM BAUD RATE routine may be used to change the baud rate for the modem port without affecting other serial ports VECTOR 00 8062 CONTROL MODEM PORT EXPECTS Modem port configuration code in 8 bit register A em em em em ee 1 0 0 Noeffecton port operation a __ L 0 Noeffecton port operation _
49. be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information on using these subroutines 13 The Analog Display Services Interface ADSI has been defined by Bell Communications Research to enable a visual context sensitive user interface to telephone network services THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide DOS Compatible File Support The Mensch has two slots for IC memory cards They each appear to be memory blocks to regular programs The firmware library provides subroutines which can read and manipulate DOS compatible fles on these IC memory cards This allows the exchange of data with DOS compatible laptop computers on a common physical media The DOS compatible File Allocation Table or FAT always resides at the low end of any formatted IC card The LOW IC card of the Mensch is physically mapped to begin at Bank 1 Most IC cards only decode as many address lines as the actually need This allows the Mensch to view Bank 0 of an IC card as the ast bank on the card Therefore an IC card with a proper DOS compatible file structure inserted into the LOW slot may be decoded according to the following table Card Size HB 1 10 1 20 Not usable for Lowest bank and above Larger DOS compatible files 3F lost Support Subroutines The following library s
50. character set RETURNS No arguments returned however a response will automatically be displayed on the LCD screen if the modem has been configured to return result codes ERRORS Carry bit Clear OK Set Command did not execute properly _SET_COUNT DESCRIPTION This subroutine may be used to initialize one of the five software timers The software timers are 16 bit down counters which may be read via the RD COUNT subroutine The value in each timer will be decremented at regular 1 100 Sec intervals until it reaches zero VECTOR 00 8122 SET COUNT EXPECTS Timer number 0 4 in register A Timeout value Units 1 100 Sec in 16 bit register Y RETURNS All registers are saved upon entry and restored before returning ERRORS Carry bit Clear OK Set Invalid Counter Number specified 133 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SetColor DESCRIPTION This subroutine will set the COLOR flag used by other graphics plotting subroutines The flag is used to determine whether pixel points should be plotted in white or black Clear White Set Black VECTOR 00 8186 _ SetColor EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected _SetFill DESCRIPTION This subroutine will set the FILL flag used by other graphics plotting subroutines The flag is used to determine whether or not plotting subrout
51. clarification will be returned in register A The error code may be interpreted as follows 01 No card in slot 02 Invalid card DISP_LCD_STRING DESCRIPTION This subroutine will write a character string to the LCD display at the current text cursor position if the text display has been enabled The string must be terminated with either 1 a null character or 2 the most significant bit of the last character set Programmers should note that this subroutine should not be used unless they know where the cursor is positioned If the cursor coordinates are outside the display area the string will not appear Refer to descriptions of the CLEAR LCD DISPLAY and POSITION TEXT CURSOR subroutines for additional information VECTOR 00 8038 DISP LCD STRING EXPECTS Bank address of string in 8 bit register A Pointer to string in 16 bit register X RETURNS No arguments returned ERRORS The carry bit normally will return clear There are no meaningful errors specific to this subroutine but it does call the WRITE LCD CHARACTER subroutine Any errors detected at that level will be passed back by this subroutine Refer to the description of the WRITE LCD SUBROUTINE for more information 143 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide DISPLAY_PCMCIA_ERROR DESCRIPTION This vector will display a PCMCIA error message on the LCD screen at the current text cursor position VECTOR 00 808
52. digit bank address is the offset address within the bank After valid addresses have been entered Dump_to_Printer will write a Form Feed 0C and formatted header line each of the selected output streams This will be followed by up to sixty lines of sixteen bytes each of memory dump data If the range of memory requires more than sixty lines of dump data then another form feed header will be generated before more dump data is sent This cycle will repeat until the entire specified block of memory has been dumped This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 500 Dump_to_Printer EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered 150 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Dump_to_Screen DESCRIPTION This subroutine will request the starting and ending a
53. eee eee e EIE EDIT 93 94 RR E 94 Stopwatch RE 94 CII MM 94 GHEET 94 MENSCH FORTH SUPPORT 95 APPENDICI 96 APPENDIX REPLACING THE BATTERY 96 APPENDIX B FIRMWARE SUBROUTINE LIBRARY 97 THE WESTERN DESIGN CENTER INC Library Vector Power Management Support 00000000005 97 Development Interface sess ens 97 Clock Calendar Alarm Support 97 Audio Output rn e dei Game d tu ME 97 Serial I O Baud Rate Generators 97 Serial I O 2 lt 220 lt 5 Abbe EENS 98 GE E MN eet 98 Seral NM MP 98 Serial 98 General I O Stream 98 Print Screen Support ROREM 99 Liquid Crystal Display Support General 99 LCD Support Text 99 LCD Support Graphics Mode 99
54. errors returned FDELETE DESCRIPTION This routine Deletes the specified file from the card VECTOR 00 80C2 FDELETE EXPECTS Register X Address of Filename Information Register A Bank Code of Filename Information RETURNS If File is Deleted Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 01 No Card Found in Specified Slot 21 File Not Found 155 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FGETBLOCK DESCRIPTION This routine reads a specific number of bytes from the specified file and stores the byte in a specified storage area VECTOR 00 80B3 FGETBLOCK EXPECTS All parameters to this routine must be passed on the stack SP 4 File Handle of file SP 5 Address of Storage Location 24 bits SP 7 Length of Block to Read Note It is the responsibility of the Calling routine to restore the stack pointer upon return from this function RETURNS If Block read successfully Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 24 End of File reached during read FGETC DESCRIPTION This routine Reads a single byte from the specified file VECTOR 00 80AA FGETC EXPECTS Register Y File handles to read from RETURNS If byte read successfully Carry Bit 2 Clear Register A Byte Just Read ERRORS Else Carry Bit Set Register A Error Code 24 End of File reached uuwuwLUesternDesignCentercorn 156
55. for other applications and configurations VECTOR 00 E000 Alter Memory EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if any errors were detected 137 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide ASCBIN DESCRIPTION This subroutine will convert two ASCII HEX characters into a single binary byte The ASCII hexadecimal character in register A corresponds to the least significant nibble of the result The most significant nibble is defined by the ASCII hexadecimal character in TEMP The resulting binary value will be returned in register A The carry bit will be clear upon a normal return from this subroutine Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the ASCBIN subroutine VECTOR 00 E087 ASCBIN EXPECTS The ASCII hexadecimal character in register A corresponds to the least significant nibble of the result The most significant nibble is defined by the ASCII hexadecimal character in the global variable TEMP 00 0070 RETURNS The resulting binary value will be returned in register A The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if either parameter was not an ASCII HEX digit BACKS
56. from multiple inputs may cause load errors This subroutine will begin computing a checksum when the start of an S28 record is detected Each time a record is processed this subroutine outputs a period and 4 digit record number to all of the selected output streams A is returned if checksum does not agree This is for user feedback only After receiving the final record a carry bit clear will be returned if no errors had been encountered Likewise if errors occurred a carry bit set will be returned This operation cycle will continue until an error occurs or the 58 end record is received Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the XS28IN subroutine VECTOR 00 E081 XS28IN EXPECTS No input arguments The initial load address for each block of data is the first part of each S28 record RETURNS The carry bit normally will return clear if the load operation completes without incident No register arguments are returned and no registers have been saved ERRORS The carry bit will be set if ESC Escape was detected or if checksum errors occurred Each S28 record is loaded into memory as it is processed A checksum can only reflect the integrity of the data When a checksum error is detected it means that the memory has already been loaded with contaminated data This subroutine is used by the S command Refer to that description for comments regarding
57. from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered 151 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Dump to Screen ASCII DESCRIPTION This subroutine will request the starting and ending addresses and accept input via the selected I O streams The user must enter six ASCII Hex digits to form the 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address is the offset address within the bank After valid addresses have been entered Dump to Screen ASCII will write up to twelve lines of sixteen bytes each of ASCII dump data Values which do not translate to pintable ASCII characters will appear as an apostrophe 9 If the range of memory requires more than twelve lines of dump data then the Dump to Screen ASCII subroutine will pause for input from any selected input stream The user may enter any character to acknowledge this pause Up to twelve more lines of dump data will be sent This cycle will repeat until the entire specified block of memory has been dumped The final dump will be followed by a pause Again the user may enter any character to acknowledge this pause This subroutine would not normally be used by application software on the W65C265 It has been in
58. graphics mode memory image then the combined image and finally the text MENSCH COMPUTER 12 34 56 TEST MENU KEYBOARD TEST DTMF TEST MODEM TEST TEST PRINTER GAME CONTROLLER SOFTWARE VERSION GRAPHICS TEST RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SEELCT Figure 70 GRAPHICS TEST The test will wait for any key to be pressed before returning to the TEST MENU 8 RETURN TO MAIN MENU TEST MENU Option Pressing ESC Escape or selecting this option in the TEST MENU returns control to the MAIN MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 4 PCMCIA CARD MENU MAIN MENU Option This MAIN MENU item allows the user to display a menu of available choices from the specified IC card Usually these menu items will be programs which the user may select for execution Initially the user will be prompted to select which IC card directory should be displayed Card HI or LO Figure 71 PCMCIA CARD MENU PROMPT After the user has selected an IC card the menu for that card if one exists will appear 06 18 94 MENSCH COMPUTER 12 34 56 PROGRAM LIST gt MENSCH WORKS Applications Figure 72 PCMCIA CARD MENU The user may initiate the execution of the MENSCH WORKS application program in the above example by pressing the ENTER key If the menu contained several items then the vertical arrow keys would be used to position before selecting the program for execution I
59. horizontal and 128 vertical dots Other modes are available and application programs may choose to use them This LCD module itself contains a Densitron LCD LM3229A128G240SNG and a Toshiba controller 6963 12 board This controller board is capable of driving other LCD displays Some developers may choose a different one in their configuration The firmware library subroutines support the normal Mensch configuration They may not work in other modes or with other LCD displays Accessing The Display The firmware allows programmers to check and control the configuration and availability of the LCD display from application programs Specific functions are available to set the display mode to text graphics or both In text mode and graphics mode there are options regarding how output is displayed When both modes are used there are options regarding how the images are combined Support Subroutines Library subroutines available to programmers when writing configuring or checking LCD are listed in the following table LCD Configuration Support Subroutines CONTROL DISPLAY Power RETRIEVE DISPLAY STATUS 12 The data sheet on the LM3229A128G240SNG and Application Notes for the T6963C LCD Graphics Controller from Densitron provide a detailed description of this display and its operation THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Displaying Text Basically text may be written to the disp
60. own Refer to Appendix Firmware Subroutine Library for more information on using these subroutines Programmable Alarm A built in alarm function uses the time of day clock The user may set or check the alarm from the keyboard via utility programs or within software applications via library subroutines Support Subroutines The library subroutines which support application programs in accessing the programmable alarm include Alarm Support Subroutines GET_ALARM_STATUS READ_ALARM RESET_ALARM SET_ALARM This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix Firmware Subroutine Library for more information on using these subroutines THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Interval Tracking Two kinds of interval tracking support are available in the firmware subroutine library The first uses software timers to monitor timeout events while the other uses the STOPWATCH function to measure elapsed time intervals Counter Usage There are five software timers 16 bit variables which may be initialized via the _SET_COUNT subroutine The value in each timer will be decremented at regular 1 100 Sec intervals until it reaches zero These software timers are just 16 bit down counters which may be read via the RD COUNT subroutine Stopwatch Usage The STOPWATCH function may be us
61. print screen function which automatically copies the LCD memories to the printer port Alternative I O Usage Developers may choose the Mensch as a prototyping platform for product applications which do not require a serial printer These configurations may choose to use serial port 1 for other purposes Refer to Serial Port Programming Considerations for more information WARNING Developers should note that while the W65C265 micro controller has four serial ports it allows only two baud rate generators In the Mensch Computer configuration the Modem port has an independent user selectable baud rate The other three serial ports including the printer are driven by a common oscillator Changing this source will affect all three ports Another alternate usage involves eliminating serial port 1 entirely and reconfiguring the pin 6 on the 65 2655 to use the pulse width measurement PWM feature That is beyond the scope of this manual Developers should refer to W65C265S INFORMATION SPECIFICATION AND DATA SHEET from WDC for specific details The important point to note is that using the W65C265S the Mensch Computer configuration does not exclude this option Most of these printer support subroutines rely on the X On X Off Protocol when communicating with the printer This prevents accidentally overflowing the printer s input buffer Users should be sure that their printer also has been configured for the X On X Of
62. printer and PC link ports could be preset and would probably remain constant Likewise it was assumed that the modem port would frequently need to change its baud rate to accommodate external connections such as BBS systems and on line services THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _CONTROL_OUTPUT DESCRIPTION This subroutine sets up the output paths for PUT_CHR and other stream oriented subroutines It turns output stream ports ON amp OFF VECTOR 00 80E0 CONTROL OUTPUT EXPECTS Control information in 8 bit register A Bit Bit Bit Bit Bit Bit Bit Bit M 7 86 45 4 3 2 41 0 Do not affect display output p 0 Donotaffect display output Do not affect printer port output p 0 Donotaffect printer port output p 0 Donot affect modem port output Pp 0 Donotaffect PC port output 1 Disable display output 0 1 Disable display output 0 1 Disable printer port output 0 L Disable modem port output 0 i Disable PC portoutput pi 1 Enable display output 1 1 Enable printer port output 1 1 Enable modem port output pt LL Pt
63. records for the entire memory block If the owest address is greater than the highest address then only one sixteen byte record will be dumped It will begin with the specified owest address This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operations of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E012 DumpS28 EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FCLOSE DESCRIPTION This routine Closes the specified file in the PCMCIA Dos compatible file emulation If the specified file was not open the subroutine will just return normally without problems VECTOR 00 8092 FCLOSE EXPECTS Register A File Handle of File to be Closed RETURNS If File Was Closed Carry Bit Clear Note Since the result will always be a closed file the carry bit will always return clear ERRORS No meaningful
64. response terminated by ENTER 0D or ESC Escape 1B from the selected input streams The first two characters of the response will be evaluated for the answer HI hi LO or lo VECTOR 00 80F5 Get_HiLo EXPECTS No input arguments RETURNS Normally returns with the carry bit clear and a code in register A 0 LO 1 HI ERRORS The carry bit will return set if a null string was entered or if the entry was terminated with ESC character or if the response was not acceptable The contents of register A will be invalid GET MODEM RESPONSE from modem port DESCRIPTION This subroutine will allow a programmer to input a string of response data from a Hayes compatible modem attached to the MODEM port 2 VECTOR 00 8116 GET MODEM RESPONSE EXPECTS Long pointer to a buffer for received string as follows Bank address of buffer in 8 bit register A Offset address of buffer in 16 bit register X The received string will be automatically terminated with a NULL 00 character The buffer size must be at least one byte larger than the received string 1 lt size lt 65535 RETURNS No arguments returned however the received string should be in the specified buffer The carry bit will return clear if received data was available ERRORS If no received data was available within a timeout interval approximately 1 second this subroutine will return with the carry bit set 170 T
65. signal levels on the printer This serial printer interface cable is available from WDC but may require an adaptor The printer interface cable is connected to the CPU module via the printer marked PTR serial port Refer to Mensch Schematics for more detailed information Connecting Other Printers Other serial printers may be used with the Mensch The default configuration for the printer port is 9600 baud 8 data bits no parity and 1 stop bit 26 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Programming Support The Firmware provides several library subroutines for programmers to use when accessing the serial printer This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix Firmware Subroutine Library for more information on using these subroutines Those library subroutines which support generalized input output streams may be configured to communicate with the printer port Refer to the descriptions of the CONTROL INPUT and CONTROL_OUTPUT subroutines for specific details Printer Support Subroutines PtLn CONTROL PRINTER PORT ON OFF PtCode GET PRINTER BYTE from printer port ESe bext PRINT BYTE Send via printer port _SetGraph RETRIEVE PRINTER PORT STATUS _SetGraph Text SELECT_COMMON_BAUD_RATE _PtScreen NOTE These subroutines are used to support the
66. subroutine VECTOR 00 E054 READ_DATE EXPECTS A pointer in 16 bit register X to a nine 9 character buffer located in memory bank 0 RETURNS Null terminated date string in specified buffer The string format is MM DD YY null wherein MM Month code 1 12 possible in ASCII digits 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December DD Day of month code 1 31 possible in ASCII digits YY Year code last two digits 94 1994 in ASCII digits ERRORS No meaningful errors 186 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide READ_TIME DESCRIPTION This subroutine will read the current system time as a null terminated text string into a user specified buffer Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the READ_TIME subroutine VECTOR 00 E057 READ TIME EXPECTS A pointer in 16 bit register X to a nine 9 character buffer located in memory bank 0 RETURNS Null terminated time string in specified buffer The string format is HH MM SS null wherein HH Hours code 0 23 possible in ASCII digits OO Midnight 12 Noon 23 11 PM MM Minutes code 0 59 possible in ASCH digits SS Seconds code 0 59 possi
67. the W65C265 chip It can continue to operate even in low power mode CHARGER Jack The CHARGER jack is located on the rear panel of the CPU module The external Charger Power module plugs into a standard wall outlet and provides a DC voltage to recharge the internal battery pack Refer to Power Subsystem section for more explanation CHARGING Indicator Whenever the system is charging the battery pack the CHARGING indicator LED red will glow Refer to Power Subsystem section for more explanation POWER Indicator This green LED will glow whenever power 5 volts is available to the LCD display connector Generally when this LED is dark there is not sufficient power available to operate the Mensch RESET Button The user may force a system reset at any time by pressing the RESET button on the front panel of the CPU module Refer to RESET Initialization Sequence for more information Internal Speaker amp HEAD PHONES Jack The Mensch allows application programs to generate sound via the speaker port The internal amplifier is connected to the internal speaker through a normally closed switch in the HEAD PHONES jack External headphones or an external amplifier and speaker may be plugged into the jack on the front panel of the CPU module replacing the internal speaker in the circuit VOLUME Control The output of the speaker port may be adjusted using the built in VOLUME Control This is just a potentiometer feeding th
68. 0 30 30 30 30 30 Variable Actual data bytes formatted as two ASCII Typically 32 48 hexadecimal digits each or 64 characters The data field of an EOF record will be empty Modulo 256 sum of all characters in previous Checksum 2 three fields complemented 1 s complement and formatted as two ASCII hexadecimal digits The checksum field of an EOF record will always be 77 37 37 Figure 106 S28 Memory Transfer Format THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide INDEX _Bin2BCD 145 147 _ 29 127 143 149 CHECK VOLTAGE 135 139 149 CHECK YN 126 144 150 Circle 150 ClearColor 29 127 143 151 _ClearFill 29 143 151 CLR STPWTCH 135 145 152 180 CONTROL CONTROLLER PORT 48 121 135 139 140 152 CONTROL DISPLAY 29 122 136 139 143 153 CONTROL INPUT 142 155 CONTROL KEYBOARD PORT 32 116 136 139 141 156 CONTROL MODEM PORT 40 118 136 139 141 158 CONTROL OUTPUT 142 160 CONTROL PC PORT 44 120 136 139 142 161 163 CONTROL PRINTER PORT 36 117 136 139 141 164 166 DISP LCD HEADER 29 126 144 167 MAIN MENU 29 126 144 168 ENGAGE LOW POWER MODE 139 168 A PRINTER BYTE 141 168 GET BIN NUM 126 145 170 GET CONTROLLER DATA 48 121 140 170 GET KEYBOARD CHARACTER 32 116 141 171 GET MODEM BYTE 40 118 141 171 _GetGrStatus 143 173 _GetPoint 143 173 HLine 2
69. 0 8116 MODEM ANSWER 00 8119 MODEM DIAL 00 80F8 MODEM HANG UP 00 80FB MODEM REDIAL 00 811C CONTROL MODEM PORT 00 8062 SELECT MODEM BAUD RATE 00 8047 Serial I O PC Link RETRIEVE PC PORT STATUS 00 8053 GET BYTE FROM PC 00 8033 SEND BYTE TO PC 00 8063 CONTROL PC PORT 00 811F SELECT COMMON BAUD RATE 00 E060 General I O Stream Support CONTROL INPUT 00 80DD CONTROL OUTPUT 00 80 0 BACKSPACE 00 E003 GET_3BYTE_ADDR 00 E02D GET CHR 00 E036 GET PUT CHR 00 E03C GET STR 00 E03F PUT CHR 00 E04B PUT STR 00 E04E SEND_CR 00 E066 SEND_HEX OUT 00 E06C SEND_SPACE 00 E069 00 07 Print Screen Support _PtScreen _SetText _SetGraph _SetGraphText Liquid Crystal Display Support General CLEAR_LCD_DISPLAY RETRIEVE_DISPLAY_STATUS _CONTROL_DISPLAY LCD Support Text Mode _WrDec CLEAR TO END OF LINE DISP LCD STRING MOVE PAGE TO BUFF MOVE BUFFER TO LCD POSITION TEXT CURSOR RD LCD STRNG WR LCD STRNG WRITE LCD CHARACTER LCD Support Graphics Mode Box Circle ClearColor ClearFill _GetGrStatus _GetPoint _HLine _Line _ Point _ SetColor SetHill _VLine Menu Support CHECK YN DISP LCD HEADER MAIN MENU TIME DATE Get HiLo MENU SETUP MENU POINT IC Card Support General IS CARD INSERTED THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 00 81AA 00 81B3 00 81B0 00 81AD 00 802C 00 8029 00 805C 00 81
70. 0 DISPLAY PCMCIA ERROR EXPECTS PCMCIA error code in 8 bit register A The error codes will be translated to text as follows RETURNS No arguments returned ERRORS No errors detected or reported THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide DO_LOW_POWER_PGM DESCRIPTION This vector will force the system into low power mode Basically this involves the following Steps Reset the stack pointer to 00 01FF Turn OFF all I O Shut down all chip selects e que Perform low power mode maintenance loop Service interrupts from timer 1 1 second Update time of day clock calendar and alarm Execute User Check Program subroutine located at 00 01CO Step 4 will repeat keeping the W65C265 in low power mode This will continue until one of the following events O System RESET occurs O The Alarm function times out The User Check Program subroutine initiates exit from low power mode to begin normal operation again Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of low power mode NOTE This is an entry vector not a subroutine IT WILL NOT RETURN VECTOR 00 E00C DO LOW POWER EXPECTS Not Applicable RETURNS Not Applicable ERRORS Not Applicable 145 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Dump 1 line to Output DESCRIPTION This subroutine will r
71. 00 15 16 1 2 3 4 5 6 7 8 9 Figure 55 DUMP to Screen Data Display Only twelve lines may be displayed at a time The user may press any key to display successive screens of data until reaching the end of the selected memory block After the last location of the memory block has been displayed any keypress will return to the DEBUG MENU 6 ASCII Screen Dump DEBUG Option This DEBUG MENU item allows the user to examine a block of memory by dumping its contents appropriately formatted in ASCII to the LCD screen Enter Lowest Address BB AAAA Figure 56 ASCII Screen Dump First Prompt When this option is selected it will display the above prompt for the owest address in the memory block The user may cancel this operation by pressing ESC Escape key instead of entering an address Enter Lowest Address BB AAAA 00 0000 Enter Highest Address BB AAAA Figure 57 ASCII Screen Dump Second Prompt After the user has entered a lowest address the above prompt for highest address will appear Again the user may cancel this operation by pressing the ESC Escape key instead of entering an address THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide The LCD screen will echo the characters as they are sent to the PC Link serial port The LCD screen may be difficult to read because the data is in S28 record format 00 000 tt ty ee Aes 00 0010 7 55 554 tet ett 0000205 9555
72. 06 18 94 MENSCH COMPUTER 12 34 56 SETUP MENU DISPLAY amp SET TIME DISPLAY amp SET DATE DISPLAY amp SET ALARM Reserved Reserved INITALIZE MODEM VIEW MODEM SETUP RETURN TO MAIN MENU Alarms is OFF DOWN amp ENTER TO SELECT Turn Alarm On Y N Alarm Format HH MM SS Figure 35 Alarm Entry Prompt The alarm entry format HH MM SS is shown above wherein Hours MM Minutes SS Seconds When the alarm conditions are satisfied the firmware will begin beeping the speaker The alarm sound may be terminated by pressing the space bar on the keyboard THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 4 Reserved and 5 Reserved SETUP MIENU Optiom These options are not yet assigned They have been reserved for future use When either of these menu items is selected the following screen will appear 06 18 94 MENSCH COMPUTER 12 34 56 Function not available Figure 36 SETUP MENU Options 4 amp 5 6 INITIALIZE MODEM 5 51 0 7 Nos o Option This SETUP MENU item allows the user to initialize the modem The following screen appears when this item is selected 06 18 94 MENSCH COMPUTER 12 34 56 Figure 37 INITIALIZE MODEM 1 Screen Blinks Quickly THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide It will only appear for a moment to be replaced by another Figure 38 INITIALIZE MODEM 2 Screen Approx 5 sec This screen will re
73. 30230C81700 F0460000000209442A020044 ZA5ASZ140000000Z0044ZA0200442A0200441 A0 Figure 86 DUMP 528 Records Long Press any key to return to the LOAD amp DUMP MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 4 DUMP to PRINTER LOAD amp DUMP MENU Option This LOAD amp DUMP MENU item allows the user to examine a block of memory by dumping its contents appropriately formatted to the printer port Enter Lowest Address BB AAAA Figure 87 DUMP to PRINTER First Prompt When this option is selected it will display the above prompt for the owest address in the memory block The user may cancel this operation by pressing the ESC Escape key instead of entering an address Enter Lowest Address BB AAAA 00 0000 Enter Highest Address BB AAAA Figure 88 DUMP to PRINTER Second Prompt After the user has entered a lowest address the above prompt for highest address will appear Again user may cancel this operation by pressing the ESC Escape key instead of entering an address THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide The LCD screen will echo the characters as they are sent to the Printer serial port The LCD screen may be difficult to read because the data has been formatted for the longer lines on the printer Each line displays the address and sixteen bytes of data in hexadecimal format Address 0123456789 A BCDEF 00 0000 5C 5B C5 00
74. 4 PCntr Acc Xreg Yreg Stack 00 E344 01 00 CC 00 1 01 FB DBK 0000 22 00 Status Reg M X D I Z C 0 0 1 0 0 0 1 0 gt Enter Any Command Here Figure 99 ROM Monitor Startup Prompt The following commands are available from the PC using the Mensch ROM Monitor Command Summary Command ALTER registers Set BREAKPOINT DISPLAY memory block in hexadecimal FILL memory block with constant GO to address JML execution Display HELP Menu Jump to subroutine using 24 bit address JSL execution Examine Change MEMORY location Display Change current DATE Display REGISTERS Read 528 record format Examine Change current TIME USER command prefix WRITE block of memory as 528 records Quick access Examine change registers Quick access Examine change memory Quick access Display NEXT memory location Quick access Display PREVIOUS location Quick access Display current memory location Cancel current operation Figure 100 ROM Monitor Commands This is just a summary Full details of the commands and their proper usage may be found in the Mensch Monitor ROM REFERENCE MANUAL THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 8 RUN PCMCIA SHELL VAIN MENU Option The PCMCIA Shell is a command interpreter This MAIN MENU item allows the user to enter and execute DOS like commands which relate to the PCMCIA DOS compatible file emulation
75. 43 261 SBREAK 146 261 SELECT COMMON BAUD RATE 32 36 44 113 116 117 120 140 141 142 157 163 166 263 SELECT DISK 131 145 263 SEND BYTE TO PC 44 120 SEND CR 142 265 SEND HEX OUT 142 199 265 266 SEND SPACE 142 266 SET ALARM 60 134 140 267 SET Breakpoint 146 268 STRCMP 145 270 UPPER CASE 146 272 vector 147 149 150 151 152 153 155 156 158 160 161 164 167 168 170 171 173 174 175 176 178 180 181 183 184 185 186 187 188 189 190 192 194 196 197 199 201 203 204 206 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 225 226 227 228 229 230 231 232 233 234 235 236 237 238 240 242 244 245 247 248 250 251 252 253 254 255 256 258 260 261 263 265 266 267 268 269 270 272 274 276 277 VERSION 146 272 WR 3 ADDRESS 142 274 WR LCD STRNG See See See See See WRITE LCD CHARACTER 30 124 143 207 276 WRITE PIXEL 30 127 276 FNSPLIT 145 223 FOPEN 131 145 225 FORMAT 111 131 145 208 225 FORTH 137 FPUTBLOCK 145 226 FPUTC 131 145 226 FPUTS 131 145 227 FPUTW 131 145 227 FSEEK 131 145 228 G Game Controller See also Controller 140 GAME CONTROLLER TEST MENU Item 46 47 48 50 84 90 121 170 283 Game Programming 121 GET_3BYTE_ADDR 142 229 Get_Address 146 230 GET ALARM STATUS 60 GET HEX 146 234 Get HiLo 126 144 235 GET MODEM RESPONSE 40 118 141 235 248
76. 5 66 73 74 83 84 92 93 95 96 108 109 111 168 175 Memory Map 5 11 23 286 Mensch Computer Availability 5 Mensch FORTH Support 137 Mensch Operating System 2 3 6 23 24 25 27 56 77 139 168 201 204 224 258 300 Mensch W D Jr Bill 15 282 MENU POINT 10 MENU SETUP 10 Menuing Support 6 64 126 Menus 8 13 84 96 109 144 DEBUG MENU 6 LOAD amp DUMP MENU 7 96 225 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Main Menu 6 12 MAIN MENU 6 7 SETUP MENU 12 TEST MENU 13 84 MODEM SETUP 6 72 73 MODEM TEST 6 MODEM ANSWER 10 MODEM_DIAL 10 MODEM HANG UP See MODEM REDIAL 10 MOVE BUFFER TO LCD 10 MOVE PAGE TO BUF 10 O ON OFF Switch 21 52 OS SHELL 8 131 P PC Link 43 44 45 97 109 112 120 139 147 157 159 161 163 166 184 231 263 265 PCMCIA 7 8 9 13 14 24 25 65 93 94 95 111 145 175 208 219 223 225 242 245 263 2778 280 286 287 297 298 300 PCMCIA CARD MENU 7 93 94 95 POSITION PIXEL 10 POSITION TEXT CURSOR 10 Power Consumption 21 52 61 280 Power Control 5 POWER Indicator 5 Power Management 6 7 8 62 135 139 Low Power Mode 6 Power Module 6 12 Power Subsystem 5 21 22 Power ON Reset 52 Printer 17 34 35 36 37 52 84 88 89 91 96 102 103 112 116 117 128 139 147 155 157 159 160 163 164 166 168 169 176 178 185 190 192 263 299 Printer Po
77. 56 LOAD amp DUMP MENU KEYBOARD TEST DTMF TEST MODEM TEST TEST PRINTER GAME CONTROLLER SOFTWARE VERSION GRAPHICS TEST RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SEELCT Figure 76 LOAD amp DUMP MENU This menu also allows the user to examine sections of memory by dumping their contents appropriately formatted to the LCD screen or printer serial port Load amp Dump Menu Load 528 Dump S28 Dump To Records Records Screen Reserved Dump To ASCII Return To Printer Screen Dump Main Menu Figure 77 LOAD amp DUMP Menu Tree THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 1 LOAD 528 Records LOAD amp IDUMIP MENU Option This LOAD amp DUMP MENU item allows the user to load 528 records into memory from a host computer via the PC Link serial port 06 18 94 MENSCH COMPUTER 12 34 56 LOAD amp DUMP MENU LOAD S28 Records Reserved DUMP S28 Records DUMP to PRINTER DUMP to Screen ASCII Screen Dump ALETER MEMORY RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SEELCT Figure 78 LOAD S28 Records 1 When this option is selected the Mensch is ready to accept S28 records via the PC link The screen will be cleared and the cursor will move down several lines Figure 79 LOAD S28 Records 2 The LCD screen will remain in this state until records are received from the PC link The user may cancel this operation at any time by pressing the ESC Escape key
78. 80 00 8032 00 8038 00 80FE 00 8101 00 802F 00 80DA 00 80D7 00 8035 00 8198 00 8195 00 8189 00 818F 00 81BF 00 81BC 00 819E 00 8192 00 81A1 00 8186 00 818C 00 819B 00 80F2 00 80EF 00 8107 00 80EC 00 80F5 00 80E6 00 80E9 00 808C THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Card Support PCMCIA Disk Emulation 100 OS SHELL 00 8077 DIR COMMND 00 804D FCLOSE 00 8092 FDELETE 00 80C2 FGETBLOCK 00 80B3 FGETC 00 80AA FGETS 00 80B0 FGETW 00 80AD FILELENGTH 00 80BC FINDFIRST 00 80B9 FOPEN 00 808F FORMAT 00 807A FPUTBLOCK 00 80A7 FPUTC 00 809E FPUTS 00 80A4 FPUTW 00 80A1 FSEEK 00 8098 LOG DRIVE 00 807D SELECT DISK 00 80D1 FNSPLIT 00 80B6 STRCMP 00 80C5 DISPLAY PCMCIA ERROR 00 8080 Timing and Counting CLR STPWTCH 00 8128 COUNT 00 8125 _RD_STPWTCH 00 812B _SET_COUNT 00 8122 Miscellaneous _Bin2BCD 00 8183 GET BIN NUM 00 80E3 INIT DP POINTER 00 8110 RESTORE DP POINTER 00 8113 START 00 810A THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide ROM Monitor Subroutines Alter_Memory 00 E000 ASCBIN 00 E087 BIN2DEC 00 E08B BINASC 00 08 DO_LOW_POWER_PGM 00 00 DUMPREGS 00 EOOF Dump_1_line_to_Output 00 E015 Dump_1_line_to_Screen 00 E018 Dump_to_Output 00 E01B Dump to Printer 500 01 Dump_to_Screen 00 E021 Dump_to_Screen_ASCII 00 E024 Dump It 00 E027 FILL Memor
79. 9 127 143 174 _INIT_DP_POINTER 145 174 180 Line 29 127 143 175 OS SHELL 145 175 Point 29 127 143 176 PRINT A BYTE 141 176 PtCode 36 117 141 176 PtLn 36 117 141 178 _PtScreen 29 36 117 128 143 178 190 192 RD COUNT 135 145 189 RD STPWTCH 135 145 152 180 RESTORE DP POINTER 145 174 180 RETRIEVE CONTROLLER STATUS 48 121 140 181 RETRIEVE KEYBOARD STATUS 32 116 141 181 RETRIEVE MODEM PORT STATUS 40 118 141 183 RETRIEVE PC PORT STATUS 44 120 142 184 RETRIEVE PRINTER PORT STATUS 36 117 141 185 SELECT MODEM BAUD RATE 40 113 118 140 141 186 _ SEND MODEM BYTE 40 118 141 186 SEND 129 140 187 SEND BYTE TO KEYBOARD 32 116 141 SEND DIGIT 129 140 188 SEND MODEM STRING 40 119 141 189 COUNT 135 145 178 189 _SetColor 29 127 144 190 _SetFill 29 127 144 190 _SetGraph 30 36 117 128 143 178 190 _SetGraphText 30 117 128 143 178 192 _SetText 30 36 117 128 143 178 192 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _START 145 192 _TIME_DATE_CHK 30 126 144 194 _VLine 29 127 144 194 _WrDec 29 125 143 194 A Alarm function 209 Alter Memory 108 Alter Memory 146 196 Appendices 138 Appendix A 51 55 138 Appendix B 27 32 36 40 45 48 61 64 113 116 117 119 120 121 126 127 128 129 132 133 134 136 139 Append
80. COMPUTER 12 34 56 TEST MENU KEYBOARD TEST DTMF TEST MODEM TEST TEST PRINTER GAME CONTROLLER SOFTWARE VERSION GRAPHICS TEST RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SEELCT Figure 67 GAME CONTROLLER Pressing the SPACE BAR will read the controller port and display any buttons on the controller which are currently down 06 18 94 MENSCH COMPUTER 12 34 56 Start Right Left Down Up Figure 68 GAME CONTROLLER Pressing ESC Escape key will return to the TEST MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 6 SOFTWARE VERSION esT MENU Optom This TEST MENU item will display the current version number of the EPROM firmware and also the date and time when it was generated MENSCH COMPUTER Version 3 01 Copyright 1994 1995 Assembled Mon Feb 27 12 51 55 1995 Figure 69 SOFTWARE VERSION Pressing any key will return to the TEST MENU 7 GRAPHICS TEST TEST MENU Option This option demonstrates the features of the LCD in text mode graphics mode and combined mode It begins by drawing several geometric patterns in graphics mode Then a number sequence 065535 will repeat in text mode until all character positions are full Both display modes will be enabled so the combined image will be displayed on the LCD screen While the combined image remains on the display this test will selectively copy the images to the printer It will first print only the
81. Company Inc for future products THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide TABLE OF CONTENTS MIN ROC t 14 TE MEMORY CARD 25 A 15 ORT LENT S TONS 15 MENSCH COMPUTER 16 CONFIGURA HON M 17 PVN OD qn 17 xcd 18 18 GT 18 18 52777 e 18 Internal Speaker amp HEAD PHONES Jock 18 VOLUME COOL 18 Expansion Connectors eee 18 Serial Port Conngectore 19 Memory Map 19 Plug In Memory Cards 20 Ree A 20 NOTER 20 P 21 esta 21 Cabling and CONT COI ONS EEE 22 Ia IT IT RR 22 Alternative I O so V 23 KEYBOARD P
82. Computer may be reactivated from low power mode by RESET or by pressing any key on the keyboard THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Basically the Mensch Computer enters low power mode by performing the following sequence Shut down all interrupts except Time Of Day clock Clear any pending interrupts O Reset the stack to 00 01FF Enable the power down routine Q Switch to the slow default clock and then shut off the fast clock Configure I O ports to inputs The power down routine will service the time of day interrupt The support program for low power mode resides in the on board RAM and ROM of the W65C265 micro controller Other circuitry on the board may be shut down but power should not be removed from the W65C265 chip itself These background operations in the Firmware maintain the time of day clock The support software for this resides in the masked ROM of the W65C265 chip It can continue to operate even in low power mode If a physical reset occurs while the system is in low power mode the normal reset initialization sequence will be performed Voltage Detection Circuitry The Mensch hardware includes a voltage detection circuit which may be monitored by software Application software may check to determine whether the system is operating off power from batteries or the external charger power module If the system is using batteries alone the condition of the batter
83. DATE MENU POINT MENU SETUP This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information on using these subroutines Displaying Graphics Programmers intending to use the Mensch LCD screen in graphics mode are advised to study the data sheet on the LM3229A128G240SNG LCD from Densitron and the associated application notes on the Toshiba controller board Support Subroutines Library subroutines for programmers to use when plotting graphics on the LCD screen LCD Graphics Support Subroutines Line CLEAR LCD DISPLAY _HLine POSITION_PIXEL Coordinates H V _VLine WRITE_PIXEL Graphics Cursor Position _SetFill _SetColor _ClearFill ClearColor Box Point Circle This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information on using these subroutines THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide LCD Screen Printing The contents of the Mensch LCD screen may be copied to the printer using firmware functions Options allow programmers to select only text memory only graphics memory or both when dumping the LCD screen to the printer port Support Subroutines The specific library su
84. DESIGN CENTER INC Mensch Computer Developer Guide Programming Support The Firmware provides several library subroutines for programmers to use when accessing the Mensch keyboard Keyboard Support Subroutines _RETRIEVE_KEYBOARD_STATUS CONTROL KEYBOARD PORT GET KEYBOARD CHARACTER SEND BYTE TO KEYBOARD SELECT COMMON BAUD RATE This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information on using these subroutines Those library subroutines which support generalized input output streams can communicate with the keyboard Refer to the description of CONTROL INPUT for specific details Keyboard Alternatives Developers may choose the Mensch as a prototyping platform for product applications which do not require a full ASCII keyboard These configurations may choose to use serial port 0 for other purposes The default configuration for the keyboard serial port is 9600 baud 8 data bits no parity and 1 stop bit Refer to Serial Port Programming Considerations for more information WARNING Developers should note that while the W65C265 micro controller has four serial ports it allows only two baud rate generators In the Mensch Computer configuration the Modem port has an independent user selectable baud rate other three serial ports including the keyboard
85. DISP LCD STRING 29 206 DISPLAY PCMCIA ERROR 208 DO LOW POWER PGM 209 Dump 1 line Output 210 Dump 1 line to Screen 211 Dump 10 Output 146 Dump to Printer 146 Dump to Screen 146 Dump to Screen ASCII 216 FGETBLOCK 220 FILELENGTH 221 Memory 222 FINDFIRST 223 FNSPLIT 145 223 FPUTBLOCK 131 145 226 GET_3BYTE _ADDR 142 229 230 233 237 Get_Address 146 230 GET_ALARM _STATUS 60 134 139 231 GET BYTE FROM 44 120 142 231 GET CHR 142 155 232 Get Address 146 233 GET STR 142 238 GETDFREE 131 238 HEXIN 146 240 IFASC 146 242 IS CARD INSERTED 131 144 242 ISDECIMAL 146 244 ISHEX 146 245 LOG DRIVE 131 145 245 MENU POINT 29 64 126 144 247 MENU SETUP 29 64 126 144 248 MODEM ANSWER 40 118 141 248 MODEM DIAL 40 118 141 250 MODEM HANG UP 40 118 141 250 MODEM REDIAL 40 118 141 251 MOVE BUFFER TO LCD 29 125 143 251 MOVE PAGE 252 POSITION PIXEL 29 127 252 POSITION TEXT CURSOR 29 124 143 206 253 PUT CHR See See See See See See See See See PUT_STR 142 254 RD_LCD_STRNG 29 124 143 255 READ ALARM 60 134 139 255 223 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide READ DATE 60 133 139 256 READ TIME 60 133 139 258 REMOVE DIRECTORY 258 RESET 21 24 52 53 56 60 61 134 139 146 209 260 287 RESET ALARM 260 RETRIEVE DISPLAY STATUS 29 122 1
86. ECTS Not Applicable RETURNS Not Applicable ERRORS Not Applicable 135 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _TIME_DATE_CHK DESCRIPTION This subroutine will check and update the time and date on the first line of the display VECTOR 00 80EC TIME DATE CHK EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors VLine DESCRIPTION This subroutine will plot a vertical line on the LCD screen in graphics mode VECTOR 00 819B _VLine EXPECTS Line origin coordinates in 16 bit register X and 16 bit register Y Terminal coordinate in 8 bit register A Lines are drawn from top to bottom If the coordinate in register Y exceeds 127 then a value of zero will be used If the coordinate in register A exceeds 127 then a value of 127 will be used RETURNS No arguments returned in registers Normal operation returns with the carry bit clear ERRORS If the coordinate in register X exceeds 239 then this subroutine will return with the carry bit set and the line will not be drawn _WrDec DESCRIPTION This subroutine will write a 16 bit unsigned integer as a positive number 0 65535 in ASCII Decimal digits to the LCD screen VECTOR 00 8180 _WrDec EXPECTS Output value in 16 bit register X RETURNS No arguments returned in registers ERRORS No meaningful errors are detected 136 THE WESTERN DESIGN CENTER INC Mens
87. END_CR DESCRIPTION This subroutine will output a CR Carriage Return Enter 0D character to each of the selected output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the SEND_CR subroutine VECTOR 00 E066 SEND_CR EXPECTS No input arguments RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if no output ports are enabled SEND_HEX_OUT DESCRIPTION This subroutine will output an 8 bit value as two ASCII HEX digits to each of the selected output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the SEND_HEX_OUT subroutine VECTOR 00 E06C SEND_HEX_OUT EXPECTS Value to be output in 8 bit register A RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if no output ports are enabled THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SEND_SPACE DESCRIPTION This subroutine will output a SPACE 20 character to each of the selected output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the SEND_SPACE subroutine VECTOR 00 E069 SEND_SPACE EXPECTS No input arguments RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit
88. GURE 10 MENSCH COMPUTER REXBOARD 24 FIGURE 11 MENSCH COMPUTER CPU MODULE REAR PANEL KEYBOARD CONNECTOR 24 FIGURE 12 MENSCH COMPUTER CPU MODULE REAR PANEL PRINTER CONNECTOR 26 FIGURE I PRINTER NC E EEN 26 FIGURE 14 MENSCH COMPUTER CPU MODULE REAR PANEL MODEM CONNECTOR 28 FIGURE 15 MODEM seres 28 FIGURE 16 MENSCH COMPUTER CPU MODULE REAR PANEL PC LINK 30 FIGURE 17 PC LINK CABLING rese ese sese 30 FIGURE 18 SEGA GAME CONTROLLER 32 FIGURE 19 MENSCH COMPUTER CPU MODULE REAR PANEL CONTROLLER CONNECTOR 32 FIGURE 20 SEGA GAME CONTROLLER 33 FIGURE 21 MENSCH COMPUTER CHARGER POWER 34 FIGURE 22 MENSCH COMPUTER REAR PANEL CHARGER CONNECTOR ccce 34 FIGURE 23 MENSCH COMPUTER RECHARGEABLE BATTERY 35 FIGURE 24 MENSCH COMPUTER FRONT PANEL 36 IEZGURE 255 MAIN MENU 36 FIGURE 26 SYSTEM STATUS BAR BATTERY CONDITION 37 FIGURE 27 SYSTEM STATUS BAR BATTERY CONDITION LOW NEEDS
89. HARACTER Text Cursor Position DESCRIPTION This subroutine will write one character to the current text cursor position in the text display and then advance the cursor to the next position Programmers should note that this subroutine should not be used unless they know where the cursor is positioned If the cursor coordinates are outside the display area the string will not appear VECTOR 00 8035 WRITE LCD CHARACTER EXPECTS Output byte in register A RETURNS No arguments returned ERRORS The carry bit normally will return clear but will be set if this subroutine cannot write the character as expected WRITE PIXEL Graphics Cursor Position DESCRIPTION This subroutine will write one pixel at the current graphics cursor position in the graphics display Optional ON or OFF VECTOR 00 81B9 WRITE PIXEL EXPECTS Z NZ pixel code in 8 bit register A If zero the pixel will be cleared If non zero the pixel will be written RETURNS No arguments returned ERRORS No meaningful errors 199 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide XS28IN DESCRIPTION This subroutine will read 528 records from any selected input stream and place them into memory It will wait i e not return until input is provided An ESC Escape character from any selected input stream will cancel the load operation and cause the subroutine to return with the carry bit 2 set Other characters
90. HE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide GET_PUT_CHR DESCRIPTION This subroutine inputs and outputs a character to selected ports It accepts the next available character from the selected INPUT streams Then it sends the character to all activated OUTPUT streams except the one corresponding to the specific character s source Refer to the description of CONTROL_INPUT for details about configuring the input stream and selecting input sources Refer to the description of CONTROL_OUTPUT for details about configuring the output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the GET_PUT_CHR subroutine VECTOR 00 E03C GET_PUT_CHR EXPECTS No input arguments RETURNS Returns normally with carry bit clear and the received character in 8 bit register A other registers are saved upon entry and restored before returning ERRORS Exception returns carry bit set if no input sources are enabled No other meaningful errors are detected 171 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Get S Address DESCRIPTION This subroutine writes the following prompt string to all selected output streams Enter Lowest Address BB AAAA It the performs GET 3BYTE ADDR which accepts six ASCII Hex digits from any selected input stream to form a 24 bit address The input format is BB AAAA Wherein BB
91. Link The Menschworks application and firmware library subroutines are available to support these uses Within limits the serial port subroutines can be used as generic drivers in other configurations such as two printers or two modems instead of one each Baud Rate Generation The most important consideration when using more than two serial ports on the W65C265 micro controller involves baud rate selection While there are four serial ports there are only two timers available for baud rate generation Therefore when three or four serial ports are used at least one baud rate generator must be shared The Mensch Computer is initially configured to operate the keyboard printer and PC link from a single baud rate generator This is purely a pragmatic decision which assumes that the user has control of local devices The modem may communicate with a remote system and therefore should have an independent baud source Programmers may reconfigure which port uses which timer by writing a custom configuration pattern to the Transmit Control Register TCR of the W65C265 chip The TCR is mapped to address 00 DF42 Basically each bit of the most significant nibble of the register selects either Timer 3 or Timer 4 1 as the baud source Likewise the LSB must be clear if Timer 4 is used Developers who want to use the serial port registers directly should consult the W65C265 INFORMATION SPECIFICATION AND DATA SHEET for details of operation
92. MAL 116 FIGURE 106 S28 MEMORY TRANSFER 218 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Introduction The Mensch computer is a product idea which has finally achieved reality Named after William D Mensch Jr founder chairman CEO of The Western Design Center Inc WDC it is the product of many years of discussion review and planning Bill is well known as the designer and patent holder of the W65C02 and W65C816 microprocessors which were used in early Apple computers and Super Nintendos and are being used in millions of products around the world today He was honored in 1991 at the Microprocessor Forum as one of the pioneers of the microprocessor industry It has been Bill s vision to create a true solid state computer The Mensch is not a game computer or a business computer It is not a PC nor does it compete in the PC marketplace It is not a calculator home controller or personal organizer although it could be any of these This new class of solid state computer can include a multitude of user specific applications supported by a single platform It is based upon a philosophy which believes user empowerment does not require complexity but does require simplicity and usefulness without intimidation Mensch Serial Serial PC Keyboard Printer Modem eme ee W65C265 Micro Controller Ge
93. N 5 m m 95 O ON ON Nn 95 ON Qs BB THE WESTERN DESIGN CENTER INC THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix E Keycode To ASCII Conversion Tables SCAN ALT 0l 1B 4 1 7 _ E A5 B BD THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide pP 4 70 50 0 90 1 1 ced JL 46 Da D LM 47 5 7C PageUp 48 9F DJ DF E7 Caslock 50 44411114 353 6 4 0l 8 pm 1 61 97 99 Eoo po opo o oo T NEUE Bo UpArrow 9 AI D9 E F9 En 190 9E D6 DE E6 Function 8l 2 DownAmow 89 Right Arrow 90 L 89 84 20 86 RightC 87 E3 EB THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 30 0 key 1 key 32 2 key 3 key 34 4 key 35 5 key 6 key 37 7 amp key
94. NTROL_SPEAKER_AMP DESCRIPTION This subroutine can turn the power to the speaker amplifier ON and OFF VECTOR 00 8104 CONTROL_SPEAKER_AMP EXPECTS Control value in 8 bit register A Zero Disable amplifier supply voltage Any Non Zero Enable power to amplifier RETURNS No arguments returned ERRORS No meaningful errors 141 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CONTROL_TONES DESCRIPTION This subroutine will configure timers T5 and T6 and gate either or both tone generators to the audio outputs TGO and TG1 Configuration values for the timers may need to be calculated for each implementation The value necessary to produce specific tones are dependent upon the frequency of the fast clock Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the CONTROL TONES subroutine The speaker amplifier may be enabled disabled independently Programmers should use the CONTROL SPEAKER AMP subroutine before calling this routine to make certain that the speaker amplifier output is enabled VECTOR 00 E009 CONTROL TONES EXPECTS Control code in 8 register A 0 Both tone generators disabled Tone generator TGO is enabled 2 Tone generator is enabled 3 Both tone generators enabled Other Invalid Configuration value for timer T5 in 16 bit register X Configuration value for timer T6 in 16 bit register Y
95. ONTROL DISPLAY 00 805C CONTROL KEYBOARD PORT 00 8059 CONTROL PRINTER PORT 00 805F CONTROL MODEM PORT 00 8062 CONTROL PC PORT 00 811F CONTROL SPEAKER AMP 00 8104 Development Interface Support XS28IN 00 E081 DumpS28 00 E012 Clock Calendar Alarm Support GET ALARM STATUS 00 E030 READ ALARM 00 E051 READ DATE 00 E054 READ TIME 00 E057 RESET ALARM 00 E05A SET ALARM 00 E06F SET DATE 00 E075 SET TIME 00 E078 Audio Output Support SEND BEEP 00 8074 SEND DTMF DIGIT 00 8071 CONTROL TONES 00 E009 CONTROL SPEAKER AMP 00 8104 Game Controller Support GET CONTROLLER DATA 00 8068 RETRIEVE CONTROLLER STATUS 00 8056 CONTROL CONTROLLER PORT 00 8065 Serial I O Baud Rate Generators SELECT MODEM BAUD RATE 00 8047 SELECT COMMON BAUD RATE 00 E060 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Serial I O Keyboard WR_3_ADDRESS GET KEYBOARD CHARACTER 00 8023 RETRIEVE KEYBOARD STATUS 00 8020 SEND BYTE TO KEYBOARD 00 8026 CONTROL KEYBOARD PORT 00 8059 SELECT COMMON BAUD RATE 00 E060 Serial I O Printer GET A PRINTER BYTE 00 8041 PRINT A BYTE 00 803E Pin 00 81A7 _PtCode 00 81A4 RETRIEVE PRINTER PORT STATUS 00 803B CONTROL PRINTER PORT 00 805F SELECT COMMON BAUD RATE 00 E060 Serial I O Modem GET MODEM BYTE 00 8050 RETRIEVE MODEM PORT STATUS 00 8044 SEND A MODEM BYTE 00 804A SEND MODEM STRING 00 804D GET MODEM RESPONSE 0
96. PACE DESCRIPTION This subroutine will output a BS Backspace 08 character to each of the selected output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of BACKSPACE subroutine VECTOR 00 E003 BACKSPACE EXPECTS No input arguments RETURNS The carry bit will always be clear upon completion ERRORS No errors reported P A valid ASCII hexadecimal digit is a numeric character 0123456789 2F lt char lt 3A or one of the first six letters ABCDEF 40 lt char lt 47 in uppercase or lowercase abcdef 61 lt char lt 7A 138 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide BIN2DEC DESCRIPTION This subroutine will take a binary value 00 63 in register A and convert it to packed decimal format 00 99 also in register A Values larger than 99 63 will not be properly converted Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of BINZ2DEC subroutine Example LDA HOURS current HOURS 00 17 JSL BIN2DEC make it decimal 00 23 JSL SEND HEX OUT VECTOR 00 E08B BIN2DEC EXPECTS Binary value 00 63 in register A RETURNS Equivalent value in packed decimal format 00 99 in register A Values larger than 63 will not be properly converted The carry bit will always be clear upon completion ERRORS No errors r
97. ROL OUTPUT subroutines for specific details THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide PC Link Programming The PC Link serial port may also be used to communicate with another system via a modem This port is limited because it uses the common baud rate generator in the normal Mensch configuration Application programs may choose to use this port in a variety of ways Initially it has been allocated for use as a direct connection link to a PC or other desktop portable computer This will be helpful to developers who do most of their programming and editing on an external development system Support Subroutines The Firmware support library provides several subroutines to facilitate communication via the PC link serial port in application programs PC Link Support Subroutines CONTROL PC PORT RETRIEVE PC PORT STATUS GET BYTE FROM PC SELECT COMMON BAUD RATE SEND BYTE TO PC Detailed descriptions of these library subroutines are provided in Appendix B Firmware Subroutine Library Those library subroutines which support generalized input output streams may be configured to communicate with the PC link port Refer to the descriptions of the CONTROL INPUT and CONTROL OUTPUT subroutines for specific details THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Controller Port Usage Developers may choose the Mensch as a prototyping platform for product applications wh
98. SIGN CENTER INC Mensch Computer Developer Guide S23 17H S25 005 S26 001 S27 40H STORED PROFILE 1 B1 E1 LZ M1 QO V1 X4 YO amp C1 amp D2 amp GO amp JO amp LO amp PO 00 amp RO amp X0 S00 000 S14 AAH S18 000 S21 30H S22 76H 623 17 S25 005 S26 001 S27 40H TELEPHONE NUMBERS amp Z0 amp Z1 amp Z2 Figure 42 VIEW MODEM SETUP 2 Screen If the modem setup information fills or exceeds two screens additional screens will be available This is indicated by MORE on the bottom of the display Pressing any key will cause the next screen to appear The modem setup information will usually be terminated by OK which indicates that the modem is ready for another command Figure 43 VIEW MODEM SETUP 3 Screen The final screen will remain for about three seconds and then return control to the SETUP MENU 8 RETURN TO MAIN MENU SETUP MENU Option Pressing ESC Escape or selecting this option returns control to the MAIN MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 2 DEBUG MENU MAIN MENU Option This menu provides a list of options to allow users to directly manipulate the environment in which programs execute These options include dumping and or modifying memory setting breakpoints to interrupt execution and displaying the register contents of application programs When used with other features such as loading programs or executing from a
99. SS Seconds 2 DISPLAY amp SET DATE SETUP MENU Optiom This SETUP MENU item allows the user to enter a new date value for the system time of day clock calendar feature of the Mensch Computer MENSCH COMPUTER 12 34 56 SETUP MENU DISPLAY amp SET TIME DISPLAY amp SET DATE DISPLAY amp SET ALARM Reserved Reserved INITALIZE MODEM VIEW MODEM SETUP RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SELECT Date is 03 02 95 Date Format MM DD YY Figure 33 DISPLAY amp SET DATE The date entry format MM DD Y Y is shown above wherein MM Month DD Day of Month Y Y Year 1994 94 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 3 DISPLAY amp SET ALARM SETU MENU Option This SETUP MENU item allows the user to disable or set the built in alarm feature of the Mensch Computer 03 02 95 MENSCH COMPUTER 12 34 56 SETUP MENU DISPLAY amp SET TIME DISPLAY amp SET DATE DISPLAY amp SET ALARM Reserved Reserved INITALIZE MODEM VIEW MODEM SETUP RETURN TO MAIN MENU Alarms is OFF DOWN amp ENTER TO SELECT Turn Alarm On Y N Figure 34 DISPLAY amp SET ALARM If the alarm function is not active when this item is selected then the prompt Turn Alarm On Y N will appear A response of N will cancel this operation and return to the SETUP MENU normal display If the user responds Y then another prompt will appear
100. Subroutine 63 Printing From Application Programs 63 GHEET deed deeg 63 Modem Communication 84 SUpport SUDEGUUBPS ber dodi 84 Link Progeroammtng 85 Support Subroutines 85 CONTROLLER PORT USACE 86 G nme FOCI 86 Support SUD 86 USING THELCD DISPEAY x E CU 87 NG FIC 87 Support SUDFOUUHGS ies eo Pen Cor os Mg 87 DOES FAV E 88 SUpport SUDEGUOUIS 88 Displaying Graphic 89 SUDDOFESUDFOUUFPBS i 89 LCD Screen PS 90 Silder TEE 90 SOUND GENERA TION S E 91 91 DOS COMPATIBLEE FILE SUPPORT WE 92 SUD VOTE EE 92 SYSTEM FUNCTIONS PM ee 93 Time Of Day E 93 GHEET 93 Programmable 93 Support Subroutines ee en ene ne me ono
101. T PRINTER EE 63 FIGURE 67 GAME E SNE E TE 64 FIGURE 68 GAME ECK RT e E TEE 64 FIGURE 69 SOFTWARE VERSION EE 65 BIGURE 70S GRAPHICS TEST e Pl AP Ee nM iU cates I PRISE CON DIEM 65 FIGURE 71 PCMCIA CARD MENU PROMPT eege 66 BEIGEREJ2Z PCM CIA ARD MENU 66 FIGURE 73 PCMCIA CARD MENU 66 FIGURE 74 PCMCIA CARD MENU 2 67 FIGURE 75 GOTO PROGRAM 67 FIGURE 76 LOAD amp DUMP MENU 68 FIGURE 77 LOAD amp DUMP MENU 0 0 2 0 4 44 08 68 FIGURE 78 LOAD S28 RECORDS 20 0 0 0408420 69 FIGURE 79 LOAD S28 RECORDS 2 2 2 0 40 0 0 000000000000 69 FIGURE 80 LOAD S28 RECORDS 3 esee eene hehehe se esee rese tese esee 8 69 FIGURE 81 LOAD S28 RECORDS 4 0 0 2 0 00 0 70 FIGURE 82 LOAD amp DUMP MENU OPTIONSI 70 FIGURE 83 DUMP S28 RECORDS FIRST PROMPT 71 FIGURE 84 DUMP S28 RECORDS SECOND PROMPT 71 FIGURE 85 DUMP S28 RECORDS Bpmrrt 12 FIGURE 86 DUMP S28 RECORDS 0 1
102. TE EXPECTS No input arguments RETURNS Received byte from modem serial port in 8 bit register A ERRORS The carry bit will return clear if received data is available in 8 bit register A It will be set if no received data was available 119 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _GetGrStatus DESCRIPTION This subroutine will retrieve the current status of the color and fill attributes VECTOR 00 81BF GetGrStatus EXPECTS No input arguments RETURNS Graphic status data returned in register A Color 0 OFF 1 ON 7 Fill 0 OFF 1 ON ERRORS No meaningful errors _GetPoint DESCRIPTION This subroutine will read the current value of a specific graphic point on the LCD screen VECTOR 00 81BC _GetPoint EXPECTS Horizontal coordinate in register X If this value exceeds 239 then the returned point value will be meaningless Vertical coordinate in register Y If this value exceeds 127 then the returned point value will be meaningless RETURNS Point value returned in register A 0 White NZ Black ERRORS No errors reported but invalid coordinates will yield invalid results 120 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _HLine DESCRIPTION This subroutine will plot a horizontal line on the LCD screen in graphics mode VECTOR 00 819E _HLine EXPECTS Leftmost line origin coordinates in 16 bit registe
103. THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Mensch Computer Developer Guide 1 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Copyright 2006 The Western Design Center Inc 2166 East Brown Road Mesa Arizona 85213 U S A All rights reserved Reproduction in any manner in whole or in part is strictly prohibited without the written permission of The Western Design Center Inc W65C02 W65C134 W65C816 W65C265 Mensch ROM Monitor Mensch Operating System MenschWorks and Mensch Computer are trademarks of The Western Design Center Inc Apple is a trademark of Apple Computer Inc CITIZEN and GSX 190 are trademarks of Citizen America Corporation Com Log is a trademark of The Com Log Company Inc Densitron is a trademark of Densitron Corporation SEGA and 6 Button Arcade are trademarks of SEGA SG ProPad is a trademark of Q J Toshiba 15 a trademark of Toshiba Information in this document is subject to change without notice and does not represent a commitment on the part of The Com Log Company Inc or The Western Design Center Inc THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Thank you for choosing the state of the art features of the W65C265S microprocessor from Western Design Center This manual describes the operating system library subroutines connector pinouts and other useful information about the Mensch Computer development platf
104. TO SCREEN DEBUG MENU Option This DEBUG MENU item allows the user to examine a block of memory by dumping its contents appropriately formatted in hexadecimal to the LCD screen Enter Lowest Address BB AAAA Figure 53 DUMP to Screen First Prompt When this option is selected it will display the above prompt for the owest address in the memory block The user may cancel this operation by pressing the ESC Escape key instead of entering an address Enter Lowest Address BB AAAA 00 0000 Enter Highest Address BB AAAA Figure 54 DUMP to Screen Second Prompt After the user has entered a lowest address the above prompt for highest address will appear Again the user may cancel this operation by pressing the ESC Escape key instead of entering an address The LCD screen will display the first ninety six locations of the memory block The address and eight locations will be displayed on each line in hexadecimal format THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Address 0 123 4 5 6 7 00 0000 5 D3 CE 00 5C E1 CE 00 00 0008 5C 00 82 00 5C 00 82 00 00 0010 5C 00 82 00 5C AB C2 00 00 0018 5C D1 ED 00 5C 00 82 00 00 0020 5C 21 81 00 5C 00 5C 00 00 0028 00 00 00 00 00 00 00 00 00 0030 00 00 00 00 03 00 03 00 10 00 0038 04 04 84 04 00 04 00 04 11 00 0040 03 04 81 01 00 00 00 00 12 00 0048 OD D9 00 00 48 D9 00 04 13 00 0050 DF D9 01 20 4B C6 00 04 14 00 0058 6 02 00 05 00 A7
105. TS Control code in 8 bit register A 00 Noclearing operation 01 Clear text display memory only 02 Clear graphics display memory only 03 Clear all LCD memory Other Invalid RETURNS No arguments returned ERRORS The carry bit normally will return clear but will be set if the control value in 8 bit register A was invalid CAUTION It is not meaningful to call this subroutine if the supply voltage to the LCD display has been disabled Refer to CONTROL_DISPLAY for more information NOTE Whenever the text display memory is cleared the current text cursor position will be reset to line 0 column 0 Likewise whenever the graphics display memory is cleared the current pixel coordinates will be reset to row 0 column 0 In both cases this corresponds to upper left corner of the display 140 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CLEAR_TO_END_OF_LINE Text line DESCRIPTION This subroutine will erase the LCD screen from the current text cursor position to the end of the current text line The text cursor will remain in its original position VECTOR 00 8032 CLEAR_TO_END_OF_LINE EXPECTS No input arguments RETURNS No arguments returned no registers changed ERRORS No meaningful errors CAUTION It is not meaningful to call this subroutine if the supply voltage to the LCD display has been disabled Refer to CONTROL_DISPLAY for more information CO
106. This subroutine will echo a after the 2 digit address to each of the selected output streams AAAA is the offset address within the bank Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the Get_Address subroutine VECTOR 00 E042 Get_Address EXPECTS No input arguments RETURNS No output arguments The 3 byte result is returned the global variables 2 00 0063 TMP2 1 and TMP2 2 The bytes are ordered such that TMP2 LSB and TMP2 2 MSB The subroutine will return with the carry bit clear if a proper 6 digit address has been received ERRORS The carry bit will be returned set if any non digit character is detected before all six ASCII Hex digits have been received 165 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide GET_ALARM_STATUS DESCRIPTION This subroutine will retrieve the current status of the system alarm Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the GET ALARM STATUS subroutine EXPECTS No input arguments RETURNS Alarm status returned in 8 bit register A Zero Alarm has not been set Any Non Zero Alarm has been set The carry bit will be set if the alarm has been triggered otherwise it will be clear upon return ERRORS No meaningful errors NOTE Calling this subroutine will also automatically reset the alarm if it has been triggered
107. a 135 SPARD HR 135 136 EE 136 Eu eege 136 EE 137 AS BIN cc teed 138 138 BINDE 139 BINS P 139 CHANGE DIRECTOR Y EE 140 CLEAR LCD DISPLAY ai cites das exui aed E DANI M Se Un SUL 140 CLEAR TO END OF LINE 141 CONTROL SPEAKER AMD 1 141 CONTROL TONT S 142 CREATE DIRECTORY 142 OVI EY 143 WSP CCD E 143 DISPLAY PCMCIA ERROR 222 2 22 2 244 144 145 Dump 1 line t soars 146 _1_ _ _ 147 EE 148 Dump MOI EE 149 Dinom PEE o eee 150 Dump 10 ee LR 151 Dump to Screen
108. are driven by a common oscillator Changing this source will affect all three ports THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Printer The Mensch s serial printer port and associated firmware have been tested with several EPSON compatible printers A special adaptor cable is available for connecting the serial printer to the Mensch CPU module Refer to the documentation associated with the specific printer for details on usage Connecting the Printer module The printer port the CPU module marked PTR corresponds to serial port 1 on the W65C265 micro controller Figure 12 Mensch Computer CPU Module Rear Panel Printer Connector serial ports on the Mensch CPU module use 6 pin modular connectors These provide only CMOS logic levels but can be adapted to virtually any standard serial interface i e 20mA 60mA RS 232 RS 422 RS 423 RS 485 ect Most popular printers have an RS 232 DTE interface when used as a serial device The special adaptor cable converts logic levels on the modular connector to appropriate RS 232 signals on a DB 25 male connector This can attach to the DB 25 female connector on the printer s serial interface Serial Adapter Cable H Mensch a Rear Panel d Serial Printer Figure 13 Printer Cabling The printer cable internally converts CMOS signal levels from the CPU module to the RS 232
109. as a socket for a 256K EPROM 32K bytes This has been mapped to address range 00 8000 00 DEFF The external portion the Mensch Operating System resides in the EPROM Refer to Reset Initialization Sequence for a description of how this is used There is also a socket on the board for 32K bytes of RAM Initially this RAM is reserved for use by system firmware This RAM chip has been mapped to address range 00 0200 00 7FFF in the Mensch configuration Ports Pinouts 51 Printer 2 TXD S2 Modem 3 S3 PCLink 4 RxD 5 DSR 6 DTR Mensch Computer Memory Map Address Range 00 0000 00 00FF 00 0100 00 0138 00 0139 00 01 FF 00 0140 00 02FF 00 0300 00 7FFF 00 8000 00 DEFF 00 DF00 00 DFFF 00 E000 00 FFFF 01 0000 3F FFFF 40 0000 SBF FFFF C0 0000 SFF FFFF Function WO65C265S internal RAM Page 0 RAM IRQ Vectors W65C265S internal RAM Mensch Computer Stack Variables amp buffers used by the Mensch OS in External RAM Memory WDC semaphore and Mensch Operating System in external EPROM Reserved addresses and Mapped I O WO65C2658S Internal ROM monitor firmware Low IC Card Memory High IC Card Memory Accessible via the Expansion Connector This feature may be used or disabled when the W65C265 is used in other configurations It is internal to the W65C265 chip and does not require the Mensch Computer or the external EPROM ba
110. at the keyboard printer and PC link ports could be preset and would probably remain constant Likewise it was assumed that the modem port would frequently need to change its baud rate to accommodate external connections such as BBS systems and on line services The printer port may be configured to share the same baud rate source as the modem port but care should be taken to avoid conflicts 115 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _DISP_LCD_HEADER DESCRIPTION This subroutine will display the MENSCH COMPUTER header on the top line of the LCD screen This may be useful to application programs building menus and formatted screens The header will appear as Figure 105 System Status Bar Battery Condition Normal Charged VECTOR 00 80EF _DISP_LCD_HEADER EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _DO_MAIN_MENU DESCRIPTION This vector will transfer control to the MAIN MENU of the Mensch Operating System NOTE This is an entry vector not a subroutine IT WILL NOT RETURN VECTOR 00 8107 MAIN EXPECTS Not Applicable RETURNS Not Applicable ERRORS Not Applicable ENGAGE LOW POWER MODE DESCRIPTION This vector will force the system into low power mode NOTE This is an entry vector not a
111. ations Add checksum are invalid or 8 bytes not 16 bytes per line unpredictable ONELINE ONLY Not Used by Dump It ASCII not Hex data Most significant bit Not Used Non zero number of dump data lines per page in 16 bit register X Note A header may also be printed The 3 byte starting address must be loaded into the global variable 00 005D TMP0 1 and TMP0 2 The least significant byte LSB of the 3 byte address must reside in and the MSB must be in TMP0 2 The 3 byt ending address must be locked into the global variable TMP2 00 0063 TMP2 1 and TMP2 2 The least significant byte LSB of the 3 byte address must reside in TMP2 and the MSB must be in TMP2 2 RETURNS No arguments returned ERRORS No meaningful errors are detected or reported THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Dump_to_Output DESCRIPTION This subroutine will request the starting and ending addresses and accept input via any of the selected input streams The user must enter six ASCII Hex digits to form each 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address is the offset address within the bank After valid addresses have been entered Dump to Output will write a Form Feed 0C and formatted header line to each of the selected output streams This will be
112. ble in ASCH digits ERRORS No meaningful errors REMOVE_DIRECTORY Reserved DESCRIPTION This vector currently invokes a non functional dummy subroutine It is reserved for subdirectory operations in future versions of the Mensch Operating System VECTOR 00 80CB REMOVE_DIRECTORY EXPECTS Not Applicable RETURNS Not Applicable ERRORS Not Applicable 187 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide RESET DESCRIPTION This subroutine will invoke the master start up vector in ROM effectively resetting the entire W65C265 system Refer to Mensch Monitor Assembly Listing for specific details regarding the processing and internal operations associates with the RESET library vector NOTE This is an entry vector not a subroutine IT WILL NOT RETURN VECTOR 00 E084 RESET EXPECTS No input arguments RETURNS This vector does not return ERRORS No errors reported RESET_ALARM DESCRIPTION This subroutine will reset all alarm flags to a don t care condition effectively canceling any alarm setup or active alarm Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the RESET_ALARM subroutine VECTOR 00 E05A RESET ALARM EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected 188 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide
113. broutines for programmers to use when dumping the LCD screen are listed in the following table LCD Print Screen Support Subroutines _SetText _SetGraph _SetGraphText _PtScreen This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information on using these subroutines THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Sound Generation The Mensch is built around the W65C265 which has the essential circuitry to perform PWM I O This offers an inexpensive simple low tech approach to customized digital audio in consumer products Two of the timers are configurable as digital sine wave tone generators These are suitable for or modem usage The W65C265 has already been proven in Caller ID products This system is an ideal development platform for ADSI telephones Details on using the tone generators directly is covered in the W65C265S INFORMATION SPECIFICATION AND DATA SHEET form WDC Example configuration values for the Mensch wherein the main frequency is 3 6864 MHz are shown in the following table Support Subroutines Library subroutines for programmers to use when attempting to generate sound with the Mensch Computer Audio Support Subroutines _SEND_BEEP SEND DTMF DIGIT CONTROL SPEAKER AMP CONTROL TONES This basic set may
114. cated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Mensch FORTH Support Charles Moore of the National Radio Astronomy Observatory developed the Forth Programming language in the 1960 s He intended to use it specifically in instrumentation and control applications related to radio astronomy Forth became a popular development tool during the 1970 s among a broad base of hackers and hobbyists The Forth Interest Group was formed in 1978 to encourage the interchange of ideas and experiences with Forth The first fig Forth standard was defined in 1979 and later updated in 1983 Implementations of Forth have been made available for various platforms Many Forth compilers have been released into the public domain The popularity of Forth arises from the ease of use Programs can be easily written and debugged in Forth even by beginners It is a very transportable language so programs written on one system can be executed on another The Western Design Center expects to see a 16 bit implementation of Forth executing on the Mensch within 1095 It is an adaptation of an earlier version of Forth for the W65C802 This involved the Apple IIgs configuration which differs from the Mensch Mensch Forth will be available from a third party developer and through WDC 95 THE WESTERN DESIGN CENTER INC Mensch Computer D
115. cation Notes for the T6963C LCD Graphics Controller Describes the SEGA controller 216 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix G Detailed Memory Map Address Range Function 00 0000 00 01F F 00 0000 00 00FF 00 0100 00 0138 00 0139 00 01FF 00 0200 00 7FFF 00 0140 00 02FF 00 0300 00 0380 00 038 1 00 023FF 00 0400 00 05FF 00 0600 00 06FF 00 0700 00 07FF 00 0780 00 07BF 00 07C0 00 07FF 00 0800 00 0BF 00 0C00 00 0FFF 00 1000 00 17FF 00 1800 00 1FFF 00 2000 00 27FF 00 2800 00 2A89 00 2A8A 00 2D14 00 2D15 00 2FF 00 3000 00 4FFF 00 5000 00 5CFF 00 5D00 00 77F 00 7800 00 7A8F 00 7A90 00 7FF 00 8000 00 FFFF 00 8000 00 DEFF 00 8000 00 8004 00 8005 00 DEFF 00 DF00 00 DF07 00 DF08 00 DF1F 00 DF20 00 DF27 00 DF28 00 DF3F 00 DF40 00 DF49 00 DF4A 00 DF4F 00 DF50 00 DF6F 00 DF70 00 DF77 00 DF78 00 DF7F 00 DF80 00 DF8F 00 DFC0 00 DFFF 00 E000 00 FFFF 00 FF00 00 FFFF 01 0000 3F FFFF 40 0000 SBF FFFF C0 0000 SFF FFFF W65C265S INTERNAL RAM W65C265S internal RAM Page 0 RAM IRQ Vectors W65C265S internal RAM Page 1 EXTERNAL 32K RAM IN MENSCH COMPUTER Mensch Computer Stack Variables Used by MENSCHWORKS Graphics Variables amp Buffering Available Keyboard Input From Buffer Keyboard Output To Buffer Printer Output From Buffer Modem Input Buffer PC L
116. ch Computer Developer Guide System Status Bar The system status bar is the top line of the LCD display It will show the current system date and time and the Mensch Computer title The current battery status will appear only if the battery needs to be recharged See Figure 14 The time field will appear as eight characters on the right end of the system status bar Time will be displayed in the following format hh mm ss wherein hh represents hours on a twenty four hour clock mm represents minutes and ss represents seconds 00 00 00 midnight 12 00 00 noon If the system is operating properly the time field should update every second The date field will appear as eight characters on the left end of the system status bar The date will be displayed in the following format mm dd yy wherein mm represents the month number dd represents the day of the month and yy represents the least significant two digits of the year The title Mensch Computer will appear in the middle of the system status bar The battery status field will appear in the middle of the system status bar overwriting part of the title whenever the batteries need charging If the system is operational the title should normally read MENSCH COMPUTER 05 10 94 MENSCH COMPUTER 12 34 56 Figure 26 System Status Bar Battery Condition Normal Charged THE WESTERN DESIGN CENTER INC Mensch Co
117. ch Computer Developer Guide Alter_Memory DESCRIPTION This is the subroutine invoked by typing the M command at the monitor prompt Basically Alter_Memory will request an address and accept input via the selected I O streams The user must enter six ASCII Hex digits to form a 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address is the offset address within the bank After a valid address has been entered Alter_Memory prints a single line memory dump starting at the specified address It then prints a second line repeating the address and positioning under the contents of the first location The user may input new hexadecimal character data one byte at a time This subroutine will automatically position under the next location as values are entered Entering a SPACE 20 character skips the current location without changing it and positions on the next The user may terminate this operation at anytime by typing ENTER 0D This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability
118. cluded in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E024 Dump 10 Screen ASCII EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered 152 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide DUMPREGS DESCRIPTION This is the subroutine invoked by typing the R command at the monitor prompt Basically DUMPREGS will write a formatted display of the register values as they were saved at the most recent monitor prompt These values were used to initialize the registers prior to the monitor releasing control This output will be sent to each of the selected output streams This subroutine would not normally be used by application software W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding in
119. cted output streams It will accept responses from any selected input streams The user must enter six ASCII Hex digits to form each 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo a lt after the 2 digit bank address AAAA is the offset address within the bank After a valid addresses have been entered FILL_Memory will expect a fill constant as two hexadecimal characters It will then write the fill constant value to every location in the specified memory block This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E02A FILL Memory EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if any errors were detected 158 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FINDFIRST DESCRIPTION This routine searches for a filename on a PCMCIA card The filename must
120. cts Developers should realize that the firmware library subroutines are specific to the display which is provided with the Mensch Changing displays may also require custom support software Note W65C22 chip is mapped to address range 00 DFOO through 00 DFIF The least significant four address bits select internal registers AOZRSO Al RS1 A2 RS2 and A3 RS3 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Keyboard A low profile keyboard is provided with the Mensch The keyboard features a full ASCII keyboard cursor control keys and twelve function keys There 15 W65C134 micro controller in the keyboard unit It scans the keyboard and communicates serially with the CPU module of the Mensch Computer Figure 10 Mensch Computer Keyboard Connecting the Keyboard The keyboard end of the cable is permanently wired to the keyboard The detachable end uses modular CMOS and connects to the CPU module through the keyboard marked serial port connector This corresponds to serial port 0 on the W65C265 micro controller Keyboard Connector Figure 11 Mensch Computer CPU Module Rear Panel Keyboard Connector The keyboard provided with the Mensch is specific to this product Even though the keyboard does attach to a serial port of the CPU module this is not a PC compatible keyboard Attempting to use a non Mensch keyboard may cause damage to the unit or to the Mensch THE WESTERN
121. ddress to the selected outputs in ASCII Hex characters The 3 byte address to be sent must be loaded into global variable TMPO 00 005D Refer to the description of CONTROL_OUTPUT for details about configuring the output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the WR 3 ADDRESS subroutine VECTOR 00 07 WR_3_ADDRESS EXPECTS No input arguments in registers The 3 byte address to be sent must be loaded into global variable 00 005D TMP0 1 and TMP0 2 The least significant byte LSB of the 3 byte address must reside in and the MSB must be in TMP0 2 The address to be sent must be loaded into TMPO RETURNS No arguments returned ERRORS No errors detected or reported WR_LCD_STRNG DESCRIPTION This subroutine will write a string of data to the LCD screen at the current text cursor position This routine does not process non displayable codes such as BS Backspace 08 or CR 0D VECTOR 00 80D7 WR_LCD_STRNG EXPECTS Long pointer to the string as follows Bank address of string in 8 bit register A Offset address of string in 16 bit register X The string must be terminated with either 1 a null character or 2 the most significant bit of the last character set RETURNS No arguments returned ERRORS No meaningful errors 198 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide WRITE LCD C
122. ddress usable in this slot is 3F FFFF HighICCard This slot is labeled on the front panel It is mapped into memory such that the lowest available address is 40 0000 The highest address usable in this slot is BF FFFF r 128 F CARD Figure 7 Mensch Computer IC Memory Cards DOS File Support IC cards conforming to the PCMCIA Type II standard are used on many portable palmtop and laptop computers Most of these portables are IBM compatible and therefore use some version of the DOS operating system This allows the cards to be treated as file devices like floppies when transporting data The Mensch subroutine library provides support which allows programs to access DOS compatible data files on the IC memory cards Refer to Programming The Mensch Computer Using DOS Compatible File Support for more information llesternDesignCentercorn 20 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Display The Mensch uses a liquid crystal display LCD which offers a 2 40 by 4 25 viewing area The LCD and associated electronics are mounted in a low profile case W 5 5 H x The lightweight case is attached to a swivel bracket which may hang on a wall or sit on a flat surface It supports both character mode and graphics mode It will display text as sixteen lines of forty characters each The graphics resolution is 240 horizontal and 128 vertical d
123. ddresses and accept input via the selected I O streams The user must enter six ASCII Hex digits to form the 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address is the offset address within the bank After valid addresses have been entered Dump_to_Screen will write a formatted header line to each of the selected output streams This will be followed by up to twelve lines of eight bytes each of memory dump data If the range of memory requires more than twelve lines of dump data then the Dump_to_Screen subroutine will pause for input from any selected input streams The user may enter any character to acknowledge this pause Another header will be generated before more dump data is sent This cycle will repeat until the entire specified block of memory has been dumped This subroutine would not normally be used by application software W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E021 Dump_to_Screen EXPECTS No input arguments This is an interactive subroutine which requests parameters
124. de Appendix D 3 Serial Connectors Pinouts 20 Keyboard a Oo S2 Appendix D 4 Display Cable Connector Pinouts Mensch T KEN Mensch Contrast 6963C T6963C Module Connector Module Comments Signal Name Pot Signal Name Pin Pin 12 82324 GND LI8 GND 34 9212 PA 219 02 0 5 SE 5 35 SE 6 MO 1216 MOD 10 15 DISPEN i LEM DOO DOO E E LES THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix D 5 IC Card Connectors Pinouts Signal Name PCMCIA Usage EE HighICCard CS6 Memory Mapping HighICCard 40 0000 8 Al0 JADDRIO 9 OE X OupuEnble 000 02 ldo AH ADDRM AN ADDRO O DL A8 ADDR IL DL ADDERI O 1 AM ADDRI O 15 WE WrteEnble 0 0 DL 35V Ve 9 IL Al 16 23 O 20 IL 5 JAADDRIS O A2 ADDRI 3 22 A7 1 ADDR 444 B Ap J ADDRO6 24 IL ADDR O 25 IL A4
125. dependent user selectable baud rate The other three serial ports are driven by a common oscillator Alternative I O Usage Developers may choose the Mensch as a prototyping platform for product applications which do not require a modem These configurations may choose to use serial port 2 for other purposes Refer to Serial Port Programming Considerations for more information THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide PC Link Information may be transferred between computers via physical media or through data communications The most common methods of data transfer between systems involve serial links One serial port on the Mensch has been reserved for this purpose It has been labeled because IBM PC compatibles comprise the bulk of the personal computers in use PC Link Connector COA TRL Le Figure 16 Mensch Computer CPU Module Rear Panel PC Link Connector All serial ports on the Mensch CPU module use 6 pin modular connectors These provide only CMOS logic levels but can be adapted to virtually any standard serial interface Refer to Mensch Schematics for more detailed information Connecting the Mensch Computer to a PC The PC port on the CPU module corresponds to serial port 3 on the W65C265 micro controller Normal serial ports on PC compatible computers are configured as Data Terminal Devices DTE for RS 232 usage There are two special adaptor cables whic
126. e status will also show availability and overflow conditions for the transmit and receive buffers Decoding Keyboard Input Application programs may accept keyboard input via the KEYBOARD CHARACTER subroutine Serial input subroutines in the firmware library use an option parameter This specifies whether the subroutine should return or wait when no character is available The Mensch keyboard operates in two modes The ASCII Code Mode transmits single byte ASCII characters Under this mode most keys will generate different codes when pressed with the CTRL ALT or SHIFT keys These modifier keys do not generate a code themselves One code is generated for every key in Keyscan Code Mode including each CTRL SHIFT and ALT key This mode may be useful for applications which need to redefine the meaning of keys or implement custom keyboards Complete descriptions of all keyboard codes are provided in Appendix E Keycode To ASCII Conversion Table Commanding The Keyboard The keyboard provided with the Mensch Computer recognizes several commands from the CPU module Two firmware library subroutines are available to help application programs command the keyboard The first SEND BYTE TO KEYBOARD is a generic serial output subroutine for the keyboard port It may be used to send any characters to serial device attached to that port The Mensch Computer Keyboard has several configurable parameters that control the operation of the k
127. e GET_STR subroutine VECTOR 00 E03F GET_STR EXPECTS Long pointer to string buffer as follows Bank address of string in 8 bit register A Pointer to string in 16 bit register X RETURNS No arguments returned Received data string will be specified string buffer If no inputs have been selected this subroutine will return immediately with an empty string Normally returns with the carry bit clear if the string was ended by the ENTER character or no inputs were enabled ERRORS Exception returns with the carry bit set if an ESC Escape character was detected No other errors are detected or reported GETDFREE DESCRIPTION This subroutine computes the amount of free space available on a IC card using the DOS compatible file structure VECTOR 00 80BF GETDFREE EXPECTS Card specifier in 8 bit register A 00 Low card 01 High card RETURNS Size of free space in bytes as 32 bit value wherein Register X Most significant word size Register Y Least significant word size ERRORS No error conditions reported 173 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide HEXIN DESCRIPTION This subroutine will convert an ASCII HEX character register A into its equivalent binary value The binary value is returned in the lower nibble of register A The carry bit will be clear upon a normal return from this subroutine Refer to Mensch Monitor Assembly Listing for s
128. e internal amplifier It 1s located on the rear panel of the CPU module Expansion Connectors All relevant signals from the CPU module are available on the rear expansion connectors These may be used by developers to monitor internal activity or interface new peripheral circuits to the Mensch Refer to Appendix D 6 for details of the expansion connector pinouts 2 Power is available to the W65C265 chip and slow clock circuitry whenever a battery is attached to the internal battery connector Refer to Power Subsystem for more explanation The indicator does not require that the LCD display module be attached 3 Serial Port Connectors THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide A block of four 4 serial port connectors is located in the center of the rear panel of the CPU module Refer to Appendix D 3 for details of the serial port connector pinouts Memory Map The Mensch Monitor resides in the 8K byte mask ROM from 00 E000 to 00 FFFF The Mensch ROM Monitor executes initialization sequence after reset occurs It turns on the external bus checks locations 00 8000 00 8002 and jumps to 00 8004 if a WDC is found The Mensch ROM Monitor uses this signaling to begin execution in then internal ROM of the W65C265 chip and the switch under software control to external EPROM in the Mensch Refer to RESET Initialization Sequence for more information The CPU module h
129. e must be in the most significant bytes of 16 bit register X and 16 bit register Y The ending coordinates of the line must be in the least significant bytes of the same registers RETURNS No arguments returned Normal operation returns with the carry bit clear ERRORS If either coordinate in register X exceeds 239 or either coordinate in register Y exceeds 127 then this subroutine will return with the carry bit set and the line will not be drawn _OS_SHELL DESCRIPTION This is the normal entry vector to start the OS Shell program This functions as a user command interpreter for IC card operations A list of available commands will be displayed on the LCD screen in response to the HELP entry Refer to the description of the MAIN MENU option for RUN PCMCIA SHELL This provides an overview of how the OS Shell program operates NOTE This is an entry vector not a subroutine IT WILL NOT RETURN VECTOR 00 8077 _OS_SHELL EXPECTS Not Applicable RETURNS Not Applicable ERRORS Not Applicable 122 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Point DESCRIPTION This subroutine will plot one point at specified coordinates on the display in graphics mode VECTOR 00 81A1 Point EXPECTS Point coordinates in 16 bit register X and 16 bit register Y RETURNS No arguments returned ERRORS No meaningful errors are detected NOTES If the coordinate in register
130. ed as an event timer The STOPWATCH is a 32 bit counter which counts up at regular 1 100 Sec intervals The STOPWATCH may be reset to zero via the CLR STPWTCH subroutine The current value of the STOPWATCH may be read via the RD STPWTCH subroutine Power Management A voltage detection circuit in the Mensch hardware may be monitored by software Application software may check to determine whether the system is operating off power from batteries or the external charger power module If the system is using batteries alone the condition of the batteries may be monitored to avoid problems The Firmware provides a library subroutine for programmers to use when checking the voltage detection status CHECK VOLTAGE If the battery condition is marginal the ENGAGE LOW POWER MODE subroutine allows the user software to place the system in low power mode Applications may also use some of the features and elements of the Mensch which permit programs to selectively manipulate power switching controls over subsystems Support Subroutines Several Firmware library subroutines have been provided to facilitate power management within the system Power Management Support Subroutine CHECK VOLTAGE CONTROL CONTROLLER PORT CONTROL DISPLAY CONTROL KEYBOARD PORT CONTROL MODEM PORT CONTROL PC PORT CONTROL PRINTER PORT ENGAGE LOW POWER MODE CONTROL SPEAKER AMP Programmers may use these and other library subroutines to develop more sophisti
131. eported The BIN2DEC subroutine does not detect any errors or return error codes If the calling program passes a binary value larger than 63 to this subroutine the resulting conversion value will be meaningless BINASC DESCRIPTION This subroutine will convert an 8 bit binary value in register A into two ASCII HEX characters Register A returns the least significant character in ASCII Temp 1 returns the most significant character Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the BINASC subroutine VECTOR 00 08 BINASC EXPECTS Binary value in 8 bit register A RETURNS Least significant character in ASCII in Register A Most significant character in ASCII in the global variable TEMP 1 00 0071 ERRORS No errors reported THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CHANGE DIRECTORY Reserved DESCRIPTION This vector currently invokes a non functional dummy subroutine It is reserved for subdirectory operations in future versions of the Mensch Operating System VECTOR 00 80CE CHANGE DIRECTORY EXPECTS Not Applicable RETURNS Not Applicable ERRORS Not Applicable CLEAR LCD DISPLAY Entire text and or graphics area DESCRIPTION This subroutine will erase the entire LCD display area It can selectively clear only the text or graphics memory or both or neither VECTOR 00 802C CLEAR LCD DISPLAY EXPEC
132. equest the starting address via the selected output streams and accept responses via any of the selected input streams The user must enter six ASCII Hex digits to form each 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address is the offset address within the bank After valid addresses have been entered Dump 1 line to Output will write a formatted header and one line sixteen bytes of memory dump data to each of the selected output streams This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E015 Dump 1 line to Output EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered 146 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Dump 1 line to Screen DESCRIPTION This subroutine will re
133. er Lowest Address BB AAAA 00 0000 Enter Highest Address BB AAAA Figure 92 DUMP to Screen Second Prompt After the user has entered a lowest address the above prompt for highest address will appear Again the user may cancel this operation by pressing the ESC Escape key instead of entering an address The LCD screen will display the first ninety six locations of the memory block The address and eight locations will be displayed on each line in hexadecimal format Address 0 123 4 5 6 7 00 0000 5 D3 00 5 1 00 00 0008 00 82 00 5 00 82 00 00 0010 00 82 00 5 2 00 00 0018 D1 ED 00 5 00 82 00 00 0020 21 81 00 5 00 5 00 00 0028 00 00 00 00 00 00 00 00 0030 00 00 00 03 00 03 00 00 0038 04 84 04 00 04 00 04 00 0040 04 81 01 00 00 00 00 00 0048 D9 00 00 48 09 00 04 00 0050 D9 01 20 4B 6 00 04 00 0058 00 05 00 A7 OF 00 Figure 93 DUMP to Screen Display Only twelve lines may be displayed at a time The user may press any key to display successive screens of data until reaching the end of the selected memory block After the last location of the memory block has been displayed any keypress will return to the LOAD amp DUMP MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 6 ASCII Screen Dump LOAD amp IDUMIP MIENU Optiom This LOAD amp DUMP MENU item allows the user to examine a block of memory by dumping its contents appropriately formatted in ASCII to the LCD scree
134. error detection WARNING The address fields of the S28 records are not filtered in any way ALL POSSIBLE ADDRESSES ARE ACCEPTABLE The user is responsible for assuring that records do not overwrite critical locations which may disrupt proper operation of the firmware 200 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix C Glossary ADSI Abbreviation for Analog Display Services Interface This is a new series of telephone standards from BELLCORE relating to menus and responses for smart telephones Checksum Value computed summing the contents of a file or block of memory prior to storage or transfer Sometimes the checksum may be manipulated negated inverted modulus 256 ect for specific algorithms This value is then stored or transferred with the data The computation may be repeated later and compared to the previous value to verify the integrity of the data CLOCK i e Fast Clock Slow Clock Default Clock The W65C265 may operate from either of two clock sources These can be dynamically selected The slower clock is typically used to support low power mode DTMF Abbreviation for Dual Tone Mutli Frequency Emulation Mode The W65C816 and therefore the W65C265 has the capability of operating in a mode wherein it s registers and instruction set emulate those of the earlier W65C02 design This means that programs written for the W65C02 may execute without modification under emulation
135. ese library subroutines are provided in Appendix B Firmware Subroutine Library Those library subroutines which support generalized input output streams may be configured to communicate with the keyboard Refer to the descriptions of CONTROL INPUT and CONTROL OUTPUT for specific details Printing From Application Programs It is often useful for application programs to generate hardcopy output Programs on the Mensch will use the serial printer port via library subroutines These routines allow the program check the printer port for availability poll the serial printer and send characters to the device to be printed When not needed the printer port may be turned OFF to conserve power Support Subroutines The Firmware support library provides several subroutines to facilitate printer usage in application programs Printer Support Subroutines PtLn CONTROL PRINTER PORT ON OFF PtCode GET PRINTER BYTE from printer port ESetText PRINT BYTE Send via printer port _SetGraph RETRIEVE PRINTER PORT STATUS _SetGraphText SELECT_COMMON_BAUD_RATE _PtScreen These subroutines are used to support the print screen function which automatically copies the LCD memories to the printer port Detailed descriptions of these library subroutines are provided in Appendix B Firmware Subroutine Library Those library subroutines which support generalized input output streams may be configured to communicate w
136. eveloper Guide Appendices Appendix A Replacing The Battery Pack The battery pack may be replaced by first removing the screws from the front panel of the CPU module Figure 103 Mensch Computer Front Panel Next remove the plate and frame allowing the main board to slide out of the encasement Figure 104 Replacing The Battery Pack Unplug the existing battery pack and remove it from the board The battery connector is keyed and cannot be incorrectly installed Using the guides slide the main board back into the encasement Replace the front panel frame and screws THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix B Firmware Subroutine Library The ROM Monitor and Mensch Operating System provide some subroutine vectors for basic I O and various useful functions in the Mensch Some of these subroutines allow user provided software to access the keyboard display modem printer PC link interface and controller Others relate to power management audio output timing or data conversion Library Vector Table The vector tables for these subroutines begin at specific locations in the W65C265S ROM 00 E000 and the EPROM of the Mensch 00 8010 The bases of these tables and the respective offsets of defined vectors will not move as new vectors are defined Power Management Support CHECK VOLTAGE 00 806B ENGAGE LOW POWER MODE 00 806E CONTROL CONTROLLER PORT 00 8065 C
137. eyboard Among the configurable items are Change the repeat time and the repeat rate Set the time before keyboard goes into low power operation Read out the current Firmware version and set the stat of the LED s THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide e Repeat Time The repeat time controls how soon after a single key has been pressed when the keyboard will begin processing the key as a repeating key The number sent to the keyboard is in 10 s of milliseconds For example to set the keyboard to start repeating a key after 500 ms the data sent to the keyboard would be 50 e Repeat Rate The repeat rate controls how soon after a key has begun repeating that another key code would be sent to the Mensch Again this number is in 10 s of milliseconds Repeat Time and Repeat Rate are programmed at the same time The computer must transmit an ASCII R and then the 2 digits for the repeat time value followed by 2 digits for the repeat rate value e Keyboard Idle Time This is the number of seconds that the keyboard will wait for another key to be pressed prior to going into low power mode When the keyboard is in low power operation the LED s will be turned off but keyscans will still occur but not at the higher speed during normal operation When a key is pressed the keyboard will resume the higher speed and scan the keyboard for the key that woke it up All LED s will be restored to t
138. f operation THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Modem Several 2400 baud modems have been tested for use with the Mensch Any external Hayes compatible modem which can operate as fast as 2400 baud on an ordinary telephone line should be acceptable The default configuration for the modem port is 2400 baud 8 data bits no parity and 1 stop bit Charging the configuration for the modem port does not affect the other serial ports Refer to specific modem documentation for details Connecting Modems The modem port on the CPU module corresponds to serial port 2 on the W65C265 micro controller All serial ports on the Mensch CPU module use 6 pin modular connectors These provide only CMOS logic levels but can be adapted to virtually any standard serial interface Figure 14 Mensch Computer CPU Module Rear Panel Modem Connector Most external modems have an RS 232 DCE interface The Mensch special adaptor cable converts 5 volt logic levels on the modular connector to appropriate RS 232 signals on a DB 25 male connector This can attach to the DB 25 female connector on modem s serial interface Telephone Line Mensch Rear Panel Figure 15 Modem Cabling The modem cable internally converts CMOS signal levels from the CPU module to the RS 232 signal levels on the modem This serial modem interface cable is available from WDC but may require an adaptor The modem interface cable is con
139. f the card has been properly formatted using the PCMCIA shell but no programs is in the menu the list will be empty 06 18 94 MENSCH COMPUTER 12 34 56 PROGRAM LIST Figure 73 PCMCIA CARD MENU w No Programs THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide If no menu information can be located on the specified IC card or no card has been inserted the following screen will appear 06 18 94 MENSCH COMPUTER 12 34 56 PROGRAM LIST gt Improper or Missing Card Figure 74 PCMCIA CARD MENU ERROR The ESC Escape key may be used to cancel this operation and return to the MAIN MENU 5 GOTO PROGRAM MAIN MENU Option This MAIN MENU item will allow the user to specify any address desired and transfer execution to it 06 18 94 MENSCH COMPUTER 12 34 56 MAIN MENU SETUP MENU DEBUG ROUTINES TEST MENU PCMCIA CARD MENU GOTO PROGRAM LOADs amp DUMPs ROM MONITOR RUN PCMCIA SHELL USE CURSOR UP DOWN amp ENTER TO SEELCT Figure 75 GOTO PROGRAM Obviously control should only be transferred to valid executable programs Otherwise the consequences are unpredictable THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 6 LOAD amp DUMP MENU MAIN MENU Option The LOAD amp DUMP MENU is used to interact with another computer via the PC Link serial port Typically this will involve transferring S28 records between systems 06 18 94 MENSCH COMPUTER 12 34
140. field as each value is typed Backspacing is supported however only the ENTER key will exit and return control to the DEBUG MENU The ESC Escape key may behave unpredictably and should not be used THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 2 DISPLAY REGISTERS DEBUG MENU Option This DEBUG MENU item allows the user to view the working registers available to application programs When an executing application encounters a breakpoint a BRK instruction it returns control to the Operating system First it will copy the contents of all registers into some pseudo registers in RAM These working registers will be used to restore the real registers when an application program is started It is these RAM locations which are viewed by this menu selection PCnir Acc Xreg Yreg Stack 34 0001 00 01 OA 34 00 01 34 DirRg 00 01 34 5 X D I Z 1 1 1 1 1 1 Figure 48 Display Registers When debugging an application the user may set a breakpoint at a key position in the program and then examine the register contents when that breakpoint is encountered Breakpoints may be set from option 3 of the DEBUG MENU Any key may be pressed to return to the DEBUG MENU after the registers have been displayed 3 SET BREAKPOINT DEBUG MENU Option This DEBUG MENU item allows the user to set a breakpoint at a specific location Basically this involves storing a BRK instruction 0000 at the ta
141. followed by up to sixty lines of sixteen bytes each of memory dump data If the range of memory requires more than sixty lines of dump data then another from feed header will be generated before more dump data is sent This cycle will repeat until the entire specified block of memory has been dumped This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E01B Dump to Output EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered 149 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Dump_to_Printer DESCRIPTION This subroutine will request the starting and ending addresses and accept input via the selected I O streams The user must enter six ASCII Hex digits to form each 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2
142. ger Connector The external charger power module is a generic item If necessary the user should be able to buy another off the shelf from local sources Replacement should be easy without having to place a special order with WDC The charger power module shipped by WDC with each developer s system provides 12 VDC 500 mA more power than the Mensch requires 34 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Internal Battery Pack A rechargeable battery pack is installed and connected inside of the Mensch CPU module before shipment See Figure 25 It should not need replacement If the initial checkout procedure indicates that the battery pack is not functional refer to Appendix A Replacing The Battery Pack for instructions Figure 23 Mensch Computer Rechargeable Battery Pack Alternate Power Configurations The Mensch Computer provides a development platform for applications which may use the W65C265 micro controller in quite different configurations Programs may be developed and their logic tested even if their final configuration does not require a keyboard or LCD display The W65C265 is viable in circuits wherein the supply voltage may be less than 3 volts Developers should be aware that some elements of the Mensch Computer may not operate at such lower voltages Refer to Mensch Computer Schematics for complete details 35 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide
143. gram to reconfigure the baud rate generator which drives the modem serial port VECTOR 00 8047 SELECT MODEM BAUD RATE EXPECTS Baud rate selection code in 8 bit register A 0 110 Baud E 150 Baud 2 300 Baud 600 Baud 4 1200 1800 Baud 2400 Baud T 4800 Baud 8 9600 Baud 9 14400 Baud 19200 Baud 38400 Baud C 57600 Baud D 115000 Baud RETURNS No arguments returned ERRORS Carry bit Clear OK Set Unacceptable selection code SEND MODEM BYTE Send via modem port DESCRIPTION This subroutine will queue one byte from 8 bit register A to be sent to the serial modem port The carry bit will be set if the serial modem port cannot accept data otherwise it will be clear upon return VECTOR 00 804A SEND A MODEM BYTE EXPECTS Output byte in 8 bit register A RETURNS No argument returned ERRORS Carry bit Clear 2 OK Set 2 Serial modem port cannot accept data 130 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _SEND_BEEP DESCRIPTION This subroutine will cause the speaker to beep VECTOR 00 8074 _SEND_BEEP EXPECTS No input arguments RETURNS No argument returned ERRORS No meaningful errors SEND BYTE TO KEYBOARD DESCRIPTION This subroutine will queue one byte from 8 bit register A to be sent to the serial keyboard port The carry bit will be set if the serial keyboard port cannot accept data otherwise it w
144. gure 64 DTMF TEST Screen Pressing any of the keys on the keyboard which corresponds to keys on a telephone pad will generate the appropriate DTMF combination as an audio burst from the speaker Acceptable keys are 0 1 2 5 4 5 7 6 9 A C D and Refer to the description of the SEND DTMF DIGIT subroutine for details about which tone pairs are associated with each key Pressing any other key will return control to the TEST MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 3 MODEM TEST TEST MENU Option This TEST MENU item allows the user to interact directly with the modem The following screen appears when this item is selected 06 18 94 MENSCH COMPUTER 12 34 56 MODEM Test Figure 65 MODEM TEST While not exactly a test in itself this selection may be used to command the modem to perform its own internal diagnostics Hayes compatible modems typically include the following built in tests Command String Description AT amp T4 Grant remote digital loopback request from remote mode amp 5 Deny remote digital loopback request from remote mode AT amp T6 Initiate remote digit loopback test AT amp T7 Initiate remote digit loopback with self test AT amp T8 Initiate local analog loopback with self test Users should consult the documentation for their own modem to determine what other modem tests or commands may also be used with that product Pressing ESC E
145. h may be used One converts logic levels on the modular connector to appropriate RS 232 DCE signals on a DB 25 female connector This can attach to the DB 25 male connector on a PC s XT style serial interface The other converts logic levels on the modular connector to appropriate RS 232 DCE signals on a DB 9 female connector This attaches to the DB 9 male connector on a PC s AT style serial interface Mensch Rear Panel Figure 17 PC Link Cabling The PC Link cable internally converts CMOS signal levels from the CPU module to the RS 232 signal levels on the IBM compatible s serial port This serial interface cable is available from WDC but may require an adaptor See Figure 12 The Mensch is shipped with the MenschWorks software which includes PC link support Terminal emulation software is needed in the PC Other RS 232 DTE peripherals may be interfaced using the PC cables and appropriate software THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Direct Connection To Another Mensch Computer A special cable is needed even when two Mensch Computers are directly connected via the PC serial link The transmit and receive signals must be reversed Likewise the Data Terminal Ready DTR and Data Set Ready DSR must also be reversed Connecting To Other Personal Computers The PC link may be used to connect to other personal computers given proper cables and support software Most popular comp
146. have been split up by FNSPLIT prior to calling this routine VECTOR 00 80B9 FINDFIRST EXPECTS Register X Address of File Data Structure FDS Register A Bank Code of File Data Structure FDS RETURNS If file is found Carry Bit Clear Register X Address of Directory Entry for File Register A Bank Code of Directory Entry ERRORS Else Carry Bit Set Register A Error Code 21 No File Found FNSPLIT DESCRIPTION This routine takes a string input and breaks it up into the separate pieces of a filename including card slot path string filename and extension VECTOR 00 80B6 FNSPLIT EXPECTS Pointer 24 bits to file name string to be parsed Bank of filename string in 8 bit register A Offset address of filename string in 16 bit register X Offset pointer in Bank 0 to store the parts in 16 bit register Y RETURNS Filename data is separated and stored in file structure table for use by other PCMCIA routines ERRORS No meaningful errors returned NOTE The file name string should have one of the following formats LO name extension or HI name extension Wherein name extension represent a valid MS DOS file name 7 Future versions of the Mensch Operating System will allow multiple levels of directories and will provide complete pathname support 159 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FOPEN DESCRIPTION This routine Opens the given file on the specified
147. hed by pressing the ESC Escape key before pressing ENTER Programming Support The Firmware provides a library subroutine for programmers to use when developing their own menus for the LCD screen Menuing Support Subroutines MENU SETUP MENU POINT DISP LCD HEADER TIME DATE CHK CHECK YN GET HILO GET BIN NUM Programmers may use these and other library subroutines to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Main Menu The MAIN MENU display will appear upon system reset This menu offers access to a variety of setup test and utility functions 03 02 95 MENSCH COMPUTER 12 34 56 MAIN MENU SETUP MENU DEBUG ROUTINES TEST MENU PCMCIA CARD MENU GOTO PROGRAM LOADs amp DUMPs ROM MONITOR RUN PCMCIA SHELL USE CURSOR UP DOWN amp ENTER TO SELECT Figure 28 MAIN MENU The MAIN MENU also allows the user to execute the PCMCIA Shell program the MenschWorks application example or user supplied application programs on IC cards Main Mensch Menu Setup Menu Goto Program ROM Monitor DEBUG PCMCIA Card Loads amp Run PCMCIA Shell ROUTINES Menu Dumps Menu Menu Figure 29 MAIN MENU Tree THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 1 SETUP MENU MAIN MENU Option The SETUP MENU is used to configure some of the ke
148. heir respective states prior to shut down The keyboard idle time is set by sending an ASCII T followed by 2 digits for the number of seconds before idling Because only 2 digits can be transmitted the idle time may be set from 1 second to 99 seconds e Setting LED States This function can be used to turn an LED on or turn it off The data sent via this command is bit oriented The low bit represents the Num Lock LED and the 2 bit represented the Caps Lock LED The data is sent by sending an ASCII L followed by 1 byte that contains the states for the LED s For example if you wanted to turn on the Caps Lock LED and turn off the Num Lock LED you would send L 0x02 To turn on both LED s you would send L 0x03 e Reading Firmware Version The Mensch Computer may also read out the current firmware version from the processor To do this the computer would send an ASCII V The keyboard will then begin transmitting a string of characters followed by the ACK 0x06 character The string being sent will be variable in length THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Support Subroutine The Firmware support library provides several subroutines to facilitate keyboard I O in application programs Keyboard Support Subroutines CONTROL KEYBOARD PORT GET KEYBOARD CHARACTER RETRIEVE KEYBOARD STATUS SEND BYTE TO KEYBOARD SELECT COMMON BAUD RATE Detailed descriptions of th
149. hook and hangup the telephone line It assumes that the attached modem is Hayes compatible and will accept commonly used command sequences VECTOR 00 80FB MODEM HANG UP EXPECTS No input arguments RETURNS No arguments returned If the modem has been configured to automatically return result codes a response may have been received Use the GET MODEM RESPONSE subroutine to check for a result code ERRORS Carry bit Clear OK Set Command did not execute properly 180 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide MODEM REDIAL DESCRIPTION This subroutine forces the external modem to go off hook wait for a dial tone and then redial the last telephone number stored in the modem s memory It assumes that the attached modem is Hayes compatible which will accept commonly used command sequences VECTOR 00 811C MODEM_REDIAL EXPECTS No input arguments RETURNS No arguments returned If the modem has been configured to automatically return result codes a response may have been received Use the GET MODEM RESPONSE subroutine to check for a result code ERRORS Carry bit Clear OK Set Command did not execute properly MOVE_BUFFER_TO_LCD DESCRIPTION This subroutine will move a 600 character LCD image from BUFFERI 40 doesn t move line 0 Lines 1 through 15 are moved A null is automatically inserted into buffer position 641 to be
150. ich do not require a game controller These configurations may choose to use this port for other purposes It should be noted that only seven of the eight bits are normally user definable The MSB will still control the 5 volt supply to the connector There is a jumper JMP4 which may be used to change this feature and allow the user to define the entire 8 bit port Game Programming The most significant bit of the port PB7 is used as an output to switch the supply voltage to the controller connector If the controller has been turned OFF via the CONTROL CONTROLLER PORT subroutine then the other returned status bits will be misleading Switch encoding may be interpreted from the following table Sat 0 A JDown Up C 1 B Right Let Dwn UP 2 Support Subroutines There are only several subroutines which relate directly to using the controller port within application programs Controller Support Subroutines CONTROL CONTROLLER PORT GET CONTROLLER DATA RETRIEVE CONTROLLER STATUS Detailed descriptions of these library subroutines are provided in Appendix B Firmware Subroutine Library THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Using the LCD Display The LCD display provided with the normal Mensch configuration supports both character mode and graphics mode It will display text as sixteen lines of forty characters each The graphics resolution is 240
151. ies may be monitored to avoid problems Programming Support The Firmware provides a library subroutine for programmers to use when checking the voltage detection status CHECK_VOLTAGE Another library subroutine allows the user software to place the system in low power mode It is ENGAGE_LOW_POWER_MODE Custom applications may only use some of the features and elements of the Mensch These programs may selectively manipulate power switching controls over subsystems Several Firmware library subroutines have been provided for this purpose Power Management Support Subroutines CONTROL_CONTROLLER_PORT CONTROL_DISPLAY CONTROL_KEYBOARD_PORT CONTROL_MODEM_PORT CONTROL_PC_PORT CONTROL_PRINTER_PORT CONTROL_SPEAKER_AMP THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Programmers may use these and other library subroutines to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information Menuing Support The Firmware program of the Mensch is intended to be User Friendly Whenever possible the mode changing commands require only a single keypress Some modes may display a menu of additional options The user may target a specific menu item using up arrow and down arrow V keys or the controller left button Any response will not be final until the ENTER key has been pressed If the user chooses to cancel a response this may be accomplis
152. ill clear upon return Refer elsewhere in this manual to Commanding The Keyboard for a description of how this subroutine may be used VECTOR 00 8026 SEND BYTE TO KEYBOARD EXPECTS Output byte in 8 bit register A RETURNS No arguments returned ERRORS Carry bit Clear 2 OK Set 2 Serial keyboard port cannot accept data 131 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SEND Send via tone generators DESCRIPTION This subroutine will use the tone generators T5 and T6 gated to the speaker amplifier tot produce DTMF combinations of 55 ms duration VECTOR 00 8071 SEND DTMF DIGIT EXPECTS Output byte in 8 bit register A which must be the ASCII code corresponding to the desired DTMF key Timer Tone Timer Tone Character Hex Code Generator Generator T5 Hz T6 Hz RETURNS No argument returned ERRORS Carry bit Clear OK Set Unacceptable DTMF selection code THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _SEND_MODEM_STRING DESCRIPTION This subroutine will send a string of data or setup information to a HAYES compatible modem VECTOR 00 804D _SEND_MODEM_STRING EXPECTS Long pointer to the string as follows Bank address of string in 8 bit register A Offset address of string in 16 bit register X The string must be terminated with either 1 a null character or 2 the most significant bit of the last
153. ines should fill the shapes when they draw them Set Fill Clear No Fill VECTOR 00 818C _SetFill EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected _SetGraph DESCRIPTION This subroutine will configure the DUMP flags used by _PtScreen such that the subroutine will only dump the LCD graphics to the printer port VECTOR 00 81B0 _SetGraph EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected 134 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _SetGraphText DESCRIPTION This subroutine will configure the DUMP flags used by PtScreen such that the subroutine will dump both LCD text and graphics to the printer port VECTOR 00 81AD _SetGraphText EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected _SetText DESCRIPTION This subroutine will configure the DUMP flags used by _PtScreen such that the subroutine will only dump the LCD text to the printer port VECTOR 00 81B3 _SetText EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected _START DESCRIPTION This is the normal restart point for the Mensch software previous setup conditions are lost NOTE This is an entry vector not a subroutine IT WILL NOT RETURN VECTOR 00 810A _START EXP
154. ing to each of the selected output streams Refer to the description of CONTROL_OUTPUT for details about configuring the output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the PUT_STR subroutine VECTOR 00 E04E PUT_STR EXPECTS Long pointer to the string as follows Bank address of string in 8 bit register A Offset address of string in 16 bit register X The string must be terminated with either 1 a null character or 2 the most significant bit of the last character set The maximum string input size is limited to 640 characters RETURNS No arguments returned registers are saved upon entry and restored before returning The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if no output ports are enabled 184 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide RD_LCD_STRNG DESCRIPTION This subroutine will read a text string from the LCD memory VECTOR 00 80DA RD LCD STRNG EXPECTS Long pointer to the string as follows Bank address of string in 8 bit register A Offset address of string in 16 bit register X Character count to be read in 16 bit register Y The data will be read from the LCD memory starting at the current text cursor position RETURNS The carry bit will be clear if the operation was successfully performed The string will be read into the
155. ink Input Buffer Printer Output Buffer Modem Output Buffer PC Link Output Buffer Screen Buffer 1 Global variable BUFFER1 Screen Buffer 2 H1 Application Buffers OSSHELL BUFFERS 9 PCMCIA Variables amp Buffers 9 TOTAL EXTERNAL EPROM IN MENSCH COMPUTER USABLE EXTERNAL EPROM IN MENSCH COMPUTER WDC semaphore amp startup ENTRY POINT in external EPROM memory for Firmware Mensch Operating System Not Usable External I O LCD Internal I O Reserved Register Storage Reserved Int Timers UARTs Unused Parallel Port W65C265S internal SRAM Reserved by Monitor External I O W65C265S Internal Mensch ROM Monitor firmware Interrupt Vectors Low IC Card Memory High IC Card Memory Available to custom applications via the expansion connector H1 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix S28 Record Transfer Format Prefi 1 All records in the 528 style begin with the letter 5 53 Two types 2 32 Data record Record length Address Data and Checksum Record Length 2 fields formatted as two ASCII hexadecimal digits MSB first LSB last The record length of an EOF record will always be 08 30 38 because the other fields are fixed Load Add Load address 24 bit formatted as six ASCII ES EES hexadecimal digits MSB first LSB last The address of an EOF record will always be zero 000000 3
156. is the bank address This subroutine will echo after the 2 digit bank address to each of the selected output streams is the offset address within the bank Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the Get S Address subroutine VECTOR 00 E048 Get S Adress EXPECTS No input arguments RETURNS No output arguments The 3 byte result is returned in the global variables TMP2 00 0063 TMP2 1 and TMP2 2 The bytes are ordered such that TMP2 LSB and TMP2 2 MSB The subroutine will return with the carry bit clear if a proper 6 digit address has been received ERRORS The carry bit will be returned set if any non digit character is detected before all six ASCII Hex digits have been received 172 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide GET_STR DESCRIPTION This subroutine uses GET_PUT_CHR to receive characters and store them into a specified string buffer The input string is terminated when an ENTER or ESC Escape character is detected The completed string is terminated with a NUL 00 character Refer to the description of CONTROL_INPUT for details about configuring the input stream and selecting input sources Refer to the description of CONTROL_OUTPUT for details about configuring the output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of th
157. ith the printer port Refer to the descriptions of the CONTROL INPUT and CONTROL_OUTPUT subroutines for specific details THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Modem Communications Many types of applications require communications with a remote system This usually is achieved by using modems and a telephone link The Mensch allows user application programs to do this via the serial modem port Library subroutines are available so the software can check the modem port for availability poll and configure Hayes compatible modems receive and send characters to another modem The modem port on the Mensch has an independent baud rate generator which may configure as needed When not in use the modem port may be turned OFF to conserve power Support Subroutines The Firmware support library provides several subroutines to facilitate modem communications in application programs Modem Support Subroutines CONTROL MODEM PORT GET MODEM RESPONSE GET MODEM BYTE MODEM ANSWER RETRIEVE MODEM PORT STATUS MODEM DIAL SELECT MODEM BAUD RATE MODEM HANG UP SEND MODEM BYTE MODEM REDIAL SEND MODEM STRING Detailed descriptions of these library subroutines are provided in Appendix B Firmware Subroutine Library Those library subroutines which support generalized input output streams may be configured to communicate with the modem port Refer to the descriptions of the CONTROL INPUT and CONT
158. ix C 278 Appendix D 22 23 28 283 284 286 289 Appendix E 114 291 Appendix F 21 297 Appendix G 300 Appendix H 302 Apple Computer 2 Arrow Keys 93 ASCBIN 146 197 ASCII 31 32 81 82 83 106 107 114 115 146 170 176 188 194 196 197 198 199 210 211 212 213 214 215 216 218 222 229 230 233 234 237 240 241 242 243 244 245 247 256 258 265 267 268 269 270 212 274 291 292 302 ASCII Screen Dump 81 82 83 106 107 B BACKSPACE 142 197 294 BACKSPACE key 294 Battery 17 21 22 50 51 52 54 55 61 135 138 connector pinouts 3 22 23 Battery Pack 51 55 Replacement 50 Baud Rate Generation 112 Bibliography 21 297 BIN2DEC 146 199 BINASC 146 199 Breakpoint 76 268 Buffer 37 156 158 161 164 168 170 171 181 182 183 184 185 231 235 238 251 252 255 256 258 267 269 270 C Cabling 27 Calendar 60 133 139 Carry Bit 112 147 149 150 168 169 170 171 172 174 175 176 186 194 196 197 199 201 204 206 207 210 211 213 214 215 216 217 218 219 222 229 230 231 232 233 234 235 236 237 238 240 242 244 245 247 252 253 254 255 265 266 268 276 277 CHANGE_DIRECTORY 201 CHARGER 21 50 Checksum 56 58 97 212 218 277 278 302 Citizen America Corporation 2 CLEAR_LCD_DISPLAY 29 124 127 143 201 206 CLEAR TO END OF LINE 29 124 143 203 CLOCK ie Fast Clock Slow Clock Default
159. lay Services Interface ADSI standards for telephones may be obtained from Very detailed hardware data on the BELLCORE ADSI PROJECT OFFICE TEL 908 758 2257 Detailed information on IC memory cards and applicable standards are available from Publication Personal Computer Memory PC Card Standard Card International Association Specification 2 01 11 92 PCMCIA Socket Services 1030 G East Duane Avenue Specification 2 00 11 92 Sunnyvale CA 94086 Card Services TEL 408 720 0107 Specification 2 00 11 92 Fax 408 720 9416 PC Card ATA Mass Storage Specification 1 01 11 92 AIMS Specification 1 01 11 92 Recommended Extensions 1 00 11 92 Sycard Technology The PCMCIA Developer s Guide by Michael T Mori Sunnyvale CA 94086 TEL 408 247 0703 THE WESTERN DESIGN CENTER INC Citizen American Corporation 2450 Broadway Ave Suite 600 Santa Monica California 90404 TEL 310 453 0614 FAX 310 453 2814 Mensch Computer Developer Guide Specific information on non WDC products mentioned in this manual may be obtained by contacting the supplier directly The following table identifies some of these sources Publication CITIZEN GSX 190 User s Manual Describes the GS X 190 serial printer SEGA 3335 Arden Road Hayward CA 94545 DENSITRON CORPORATION 3425 W Lomita Boulevard Torrance CA 90505 TEL 213 530 3530 FAX 213 325 8958 SEGA 6 Button Arcade Pad Appli
160. lay after positioning the cursor at the desired location As each character is written the cursor will advance to the next position When the cursor reaches the last position at line 16 and column 40 it will not advance Any additional characters will just overwrite the last location This is also true if the right arrow or down arrow character is used to advance the cursor In a similar manner the backspace left arrow and up arrow characters cannot back up the cursor beyond the upper left corner of the screen at line 1 and column 1 Support Subroutines Library subroutines for programmers to use when writing to the LCD screen in text mode LCD Text Support Subroutines CLEAR_LCD_DISPLAY POSITION TEXT CURSOR Row amp Column CLEAR_TO_END_OF_LINE Text line WRITE LCD CHARACTER Text Cursor Position DISP LCD STRING Text Cursor Position WR LCD STRNG RD LCD STRNG MOVE PAGE TO BUFF MOVE BUFFER TO LCD _WrDec Those library subroutines which support generalized output streams may also be configured to write to the LCD screen Refer to the description of the CONTROL_OUTPUT subroutine for specific details THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide A special set of library subroutines has been provided to assist developers in producing their own menus on the LCD screen Menuing Support Subroutines CHECK YN DISP LCD HEADER MAIN MENU GET BIN NUM Get HiLo TIME
161. le The W65C816 has a software switchable emulation mode which allows it to run all 6502 and 65 02 software without modification THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide WDC Abbreviation for The Western Design Center Inc of Mesa Arizona The company was founded in 1978 by William D Mensch Jr who remains president and CEO WDC designs licenses and sells CMOS microprocessors and microcomputers 203 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Appendix D Connector Pinouts Appendix D 1 Internal Battery Connector Pinouts Unregulated Charging Voltage Battery Positive Terminal Appendix D 2 Controller Connector Pinouts There are only nine pins available on the game controller connector One is used to supply the unit with 5 volts and another is ground This leaves only seven pins for everything else The most significant bit of port PB7 is used as an output to switch the supply voltage to the controller connector There is a jumper JMP4 which may be used to change this feature and allow the user to define the entire 8 bit port Refer to the Mensch Computer schematics for the exact location of this jumper Switch encoding on the SEGA Controller may be interpreted from the following table Sat 0 A U C I B Right Left Dwn ml THE WESTERN DESIGN CENTER INC Mensch Computer Developer Gui
162. ltage Detection Circuitry 6 VOLUME Control 5 22 W W65C02 Microprocessor 2 15 278 280 W65C134 Micro Controller 2 31 280 W65C265 Micro Controller 2 17 20 21 22 24 31 33 34 37 38 41 42 45 51 52 62 109 112 113 129 196 209 210 211 212 213 214 215 216 217 218 222 260 268 278 2779 280 284 W65C816 Microprocessor 2 15 17 278 281 Warnings 33 37 41 277 Western Design Center Inc 2 4 15 21 148 282 297 WR 3 ADDRESS 11 WR LCD STRNG 11 WRITE LCD CHARACTER 11 WRITE PIXEL 11 X XS28IN 11 139 277 228
163. main while the modem initialization commands are being sent Under normal conditions this should only last about five seconds After about five seconds the modem ID read from the modem will appear Figure 39 INITIALIZE MODEM 314 Screen w Modem ID This third screen showing the modem ID will remain until two keys are pressed Control will be returned to the SETUP MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide If this option is selected but no modem is attached then the following screen will be displayed Figure 40 INITIALIZE MODEM Pressing ESC Escape twice will return control to the SETUP MENU 7 VIEW MODEM SETUP 5 MENU Option This SETUP MENU item allows the user to view the modem setup information It does this by reading it back directly from the modem The following screen will appear when this item is selected ACTIVE PROFILE B1 EO L2 M1 00 V1 X4 YO 802 amp GO 840 amp LO amp PO 800 amp RO 850 amp XO amp YO 500 002 501 000 S02 043 503 013 504 010 505 008 506 002 507 030 508 002 509 006 510 014 512 050 514 00 516 00 58 000 S21 30H 522 76 523 17 525 005 526 001 S27 40H STORED PROFILE 0 B1 EO L2 M1 00 V1 X4 YO amp C1 802 amp GO 840 810 amp PO 800 amp RO 850 amp 0 500 002 514 88 518 000 S21 30H S22 76H Figure 41 VIEW MODEM SETUP 1 Screen Pressing any key will display the second page of modem setup information THE WESTERN DE
164. mming Consideration 112 SET BREAKPOINT 6 SET ALARM 10 SET Breakpoint 10 SET DATE 10 60 133 140 269 SET TIME 10 60 133 140 270 Setup Menu 12 SETUP MENU 6 66 67 69 70 71 72 73 78 107 DISPLAY amp SET ALARM 6 12 DISPLAY amp SET DATE 6 DISPLAY amp SET TIME 6 Initialize Modem 6 View Modem Setup 6 SG ProPad 2 Game Controller 5 Slow Default Clock 62 Software 4 21 24 25 30 43 44 46 47 58 59 62 112 113 118 134 135 139 147 148 178 189 192 196 210 211 212 213 214 215 216 217 218 222 261 268 280 281 SOFTWARE VERSION 6 Stack 23 300 Status Display Line 61 STRCMP 10 Support Subroutines 7 8 29 32 36 40 44 48 60 62 113 116 117 118 120 121 122 124 127 128 129 133 134 Switch ON OFF 21 22 24 48 58 61 121 283 System Functions 7 System Initialization 56 System Management 6 System Status Bar 6 12 14 54 55 167 T T6963C Toshiba LCD Contoller 26 27 30 122 123 153 284 299 TEST MENU 6 84 85 86 87 88 90 91 92 DTMF TEST 6 GAME CONTROLLER 6 KEYBOARD TEST 6 221 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide MODEM TEST 6 PRINTER TEST 6 SOFTWARE VERSION 6 TEST PRINTER 6 Time Of Day Clock Calendar 6 7 tone 17 86 129 188 204 248 250 251 Toshiba T6963C LCD Controller 2 26 122 126 U UPPER_CASE 10 V Vector Table 8 VERSION 10 VIEW MODEM SETUP 6 72 Vo
165. mmonly used AT command sequences VECTOR 00 8119 MODEM ANSWER EXPECTS No input arguments RETURNS No arguments returned If the modem has been configured to automatically return result codes a response may have been received Used the GET MODEM RESPONSE subroutine to check for a result code ERRORS Carry bit Clear OK Set Command did not execute properly 179 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide MODEM_DIAL DESCRIPTION This subroutine forces the external modem to go off hook wait for a dial tone and then dial a telephone number It assumes that the attached modem is Hayes compatible which will accept commonly used command sequences VECTOR 00 80F8 MODEM_DIAL EXPECTS Long pointer to the telephone number string as follows Bank address of string in 8 bit register A Offset address of string in 16 bit register X The string must be terminated with either 1 a null character or 2 the most significant bit of the last character set The string must be fewer than 65535 bytes long RETURNS No arguments returned If the modem has been configured to automatically return result codes a response may have been received Use the GET MODEM RESPONSE subroutine to check for a result code ERRORS Carry bit Clear OK Set Command did not execute properly MODEM_HANG_UP DESCRIPTION This subroutine forces the external modem to go on
166. mode on the W65C265 EPROM Abbreviation for Erasable Programmable Read Only Memory Interrupt A break in the normal sequence of instruction execution I O Library This is a group of subroutines located in the W65C265 internal ROM and external EPROM which is accessible to user application programs These subroutines support the standard I O operations available in the Mensch Computer configuration LCD Abbreviation for Liquid Crystal Display PCMCIA Abbreviation for Personal Computer Memory Card Interface Association This is an international organization of interested parties attempting to standardize the interface for plug in IC memory cards NOTE Then Mensch Computer configuration supports a subset of the PCMCIA Type I standard PWM as input Abbreviation for Pulse Width Measurement This is a hardware feature supported by the W65C265 chip PWM as output Abbreviation for Pulse Width Modulation This is a technique for manipulating binary output levels to control the duty cycle when used in analog applications Examples include digital sound reproduction and DC motor speed control THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide RAM Abbreviation for Random Access Memory ROM Abbreviation for Read Only Memory Shell A shell is usually a command interpreter intended to simplify user interaction with more complex subsystem The shell on the Mensch in the PCMCIA DOS compatible file e
167. mputer Developer Guide The BATTERY LOW indication in the middle of the status bar means that the batteries are in need of recharging 05 10 94 BATTERY LOW 12 34 56 Figure 27 System Status Bar Battery Condition LOW Needs Charging Continued operation is not recommended when the batteries are weak The external charger power module should be attached and the battery pack should be recharged If this problem persists then the battery pack will need to be replaced Refer to Appendix A Replacing The Battery Pack for further instructions THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Mensch Operating System The Mensch Operating System performs all necessary system initialization and background support operations It also provides a menuing system wherein the user may access utilities and application programs Initially a suite of related applications MenschWorks will be available on an IC card for use with the Mensch Operating System Its features include a text editor and a filer System Management The Mensch Operating System resides in EPROM and was designed to support the specific configuration of the Mensch Computer It uses certain features of the more generic internal Mensch ROM Monitor of the W65C265S chip The operating system also provides for interaction via the modem and support for interaction across the PC Link interface Reset Reset may be either a triggered
168. mulation allows the user to initiate complicated operations via single keystrokes or simple keyword commands W65C02 Microprocessor W65C02 has 66 instructions 180 operational codes and 15 addressing modes with one 8 bit accumulator two 8 bit index registers and an 8 bit stack pointer 256 byte stack The standard part has an 8 bit data bus and a 16 bit address bus 64K byte address space The clock input is not divided internally the memory bus runs at one clock cycle per memory cycle W65C02S is compatible with the NMOS 6502 microprocessor used in early Apple Atari Nintendo and Commodore computers W65C134 Microprocessor The W65C134S has 65 025 core microprocessor which is a fully static version of the 65 02 This part can operate at very low clock frequencies for low power consumption The W65C134S chip also includes 192 bytes of static RAM bytes of mask ROM seven 8 bit bi directional I O ports and four 16 bit timers The 56 I O pins may be reconfigured in software to provide additional functions These include external memory bus 8 bit data 16 bit address hardware interrupts 1 NMI 2 IRQ 7 positive edge 5 negative edge eight chip select outputs for external static memories and I O a UART and a serial interface bus SIB In addition the W65C134S has the following features vector interrupt system 22 priority encoded interrupts two clock inputs software switchable between low frequency
169. n Enter Lowest Address BB AAAA Figure 94 ASCII Screen Dump First Prompt When this option is selected it will display the above prompt for the owest address in the memory block The user may cancel this operation by pressing the ESC Escape key instead of entering an address Enter Lowest Address BB AAAA 00 0000 Enter Highest Address BB AAAA Figure 95 ASCII Screen Dump Second Prompt After the user has entered a lowest address the above prompt for highest address will appear Again the user may cancel this operation by pressing the ESC Escape key instead of entering an address The LCD screen will echo the characters as they are sent to the PC Link serial port The LCD screen may be difficult to read because the data is in 528 format 00 DOD 00 0010122422 222 172 00 00204 0 7 ODDS 222 ts 00 0040 kK 00 00507 7 000060 00 0070 E B K 00 0080K K K K 00 0090K K K K 00 00A0 K K K 00 00B0 K K K K Figure 96 ASCII Screen Dump Display Press any key to return to the SETUP MENU screen THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 7 ALTER MEMORY LOAD amp DUMP MENU Option This option item allows the user to change the contents of RAM locations First a prompt will appear requesting the first address to be modified Any valid address may be entered but onl
170. n address or even accessing the Mensch ROM Monitor the debug functions are powerful tools 06 18 94 MENSCH COMPUTER 12 34 56 DEBUG MENU Alter Memory Display Registers SET Breakpoint FILL Memory DUMP to Screen ASCII Screen Dump Reserved RETURN TO MAIN MENU USE CURCOR UP DOWN amp ENTER TO SELECT Figure 44 DEBUG MENU The ESC Escape key may be used to cancel these menu operations and return to the MAIN MENU DEBUG Menu SET DUMP Breakpoint Screen Reserved Display FILL ASCII Return To Registers Memory Screen Dump Main Menu Figure 45 DEBUG MENU Tree THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 1 ALTER MEMORY DEBUG MENU Option This DEBUG MENU item allows the user to change the contents of RAM locations First a prompt will appear requesting the first address to be modified Any valid address may be entered but only RAM locations can be changed Enter Address BB AAAA Figure 46 Alter Memory Prompt When a valid address response has been entered then the currents of sixteen locations beginning at the specified address will be displayed The cursor will be positioned below the first location and the user may begin entering new data into consecutive locations Address 4 5 6 7 8 9 00 1234 26 85 20 OC 00 00 01 40 00 123C 41 42 35 20 44 46 20 42 00 1234 Figure 47 Alter Memory Display The cursor will advance by spacing over the next
171. nd _SetText for more information VECTOR 00 81AA _PtScreen EXPECTS No input arguments RETURNS No argument returned ERRORS No meaningful errors are detected _RD_COUNT DESCRIPTION This subroutine may be used to check the current value of one of the five software timers The software timers are 16 bit variables which may be initialized via the _SET_COUNT subroutine The value in each timer will be decremented at regular 1 100 Sec intervals until it reaches zero VECTOR 00 8125 COUNT EXPECTS Timer number 0 4 in register A RETURNS The current 16 bit counter value is returned in register Y The state of the Zero flag in the status register may be used to test the timer Register A and register X are saved upon entry and resorted before returning ERRORS Carry bit Clear OK Set Invalid Counter Number specified 124 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _RD_STPWTCH DESCRIPTION The STOPWATCH function may be used as an event timer This subroutine will read the current value of the STOPWATCH The STOPWATCH is a 32 bit counter which counts up at regular 1 100 Sec intervals The STOPWATCH may be reset to zero via the CLR STPWTCH subroutine VECTOR 00 812B _RD_STPWTCH EXPECTS No input arguments RETURNS The 16 bit address within Bank 0 of the 32 bit STOPWATCH counter in register Y ERRORS No meaningful errors are detected RESTORE DP POINTER
172. nected to the CPU module via the modem marked serial port Refer to Mensch Schematics for more detailed information This aspect true Hayes compatibility is very important All modems are not necessarily compatible with the Hayes standard command set Some are partially compatible supporting only a subset of the commands 28 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Programming Support The Firmware provides several library subroutines for programmers to use when accessing the modem Modem Support Subroutines CONTROL MODEM PORT GET MODEM RESPONSE GET MODEM BYTE MODEM ANSWER RETRIEVE MODEM PORT STATUS MODEM DIAL SELECT MODEM BAUD RATE MODEM HANG UP SEND MODEM BYTE MODEM REDIAL SEND MODEM STRING This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information on using these subroutines Those library subroutines which support generalized input output streams may be configured to communicate with the modem port Refer to the description of the CONTROL INPUT and CONTROL OUTPUT subroutines for specific details WARNING Developers should note that while the W65C265 micro controller has four serial ports it allows only two baud rate generators In the Mensch Computer configuration the Modem port has an in
173. nector can be read Developers must provide their own software for interpretation 32 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Programming Support The Firmware provides some library subroutines for programmers to use when accessing the controller Controller Support Subroutines This basic set may be used as building block functions CONTROL CONTROLLER PORT Programmers may use them to develop more E i i sophisticated libraries of their own Refer to Appendix GET CONTROLLER DATA B Firmware Subroutine Library for more R information on using these subroutines RETRIEVE CONTROLLER STATUS Interpreting Controller Status Codes There are only nine pins available on the game controller connector One is used to supply the unit with 5 volts and another is ground This leaves only seven pins for everything else 24 1 hjSeTet 5 Sots 26 12 4 8 Ground 72 O 9 6 2 most significant bit of the port PB7 is used as an output to switch the supply voltage to the controller connector BE A Button X Start Button Button Y Button Z Mode Button Button A Directional Pad Button B Figure 20 SEGA Game Controller Button C Switch encoding may be interpreted from the following table Sat 0 A Up C 1 B Right Let Down _ THE WESTERN DESIGN CENTER INC Mensch Compute
174. nennen nnne 204 Appendix D 3 Serial Connectors esses eene EEE EEE nennen nennen 205 Appendix D 4 Display Cable Connector 205 Appendix D 5 IC Card Connectore 206 Appendix D 6 Expansion Connector 205 APPENDIX E KEYCODE TO ASCII CONVERSION eene eene 210 APPENDIX BIBLIOGRAPHY RECOMMENDED 215 APPENDIX G DETAILED MEMORY 40 2 217 APPENDIX S28 RECORD TRANSFER 2 0 1 1 0000000001 218 ISDE P 219 11 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide TABLE OF FIGURES FIGURE 1 MENSCH COMPUTER PRIMARY 14 FIGURE 2 MENSCH COMPUTER 5 20 86 15 FIGURE 3 MENSCH COMPUTER REAR PANEL 17 FIGURE 4 MENSCH COMPUTER CPU 001 17 FIGURE 5 MENSCH COMPUTER FRONT PANEL 18 FIGURE IC CARD EE A KE 20 FIGURE 7 MENSCH COMPUTER IC MEMORY 20 FIGURE 8 MENSCH COMPUTER DISPLAY 9 21 FIGURE 9 MENSCH COMPUTER CPU MODULE REAR BANEL 22 FI
175. nerators Slow Clock CPU Module Fast Clock Speaker Power Control LoCard HiCard Figure 1 Mensch Computer Primary Components THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Bill Mensch has designed the W65C265 microcomputer for his solid state computer and is the core of the CPU module This powerful chip has a CPU which is instruction compatible with the W65C816 microprocessor and has four serial ports and eight 16 bit timers on board It also has twin tone generators and internal RAM and ROM The CPU module also has 2 of WDC s VIAs Versatile Interface Adapters the W65C22S for external display and controller interfaces and power management control The Keytronics keyboard utilizes WDC s 8 bit microcomputer W65C134S The W65C134S provides low power management features and the ability to program the keyboard via a provided on board 32K EPROM Figure 2 Mensch Computer Assembled The internal CPU instruction set is 100 compatible with the W65C816 CPU used the Apple IIgs and Super Nintendo computers as well as the 6502s used in Atari and Commodore computers It is reasonable to assume that some of the first 3rd party applications on this solid state computer will be ported from these computer platforms IC Memory Cards The inclusion of IC Memory Cards into the design makes the Mensch hardware very versatile A separate slow clock low power mode and many
176. ng po i _ 0 i Set DTR signal FALSE DTRI D 0 1 f Disable Echomode 0 1 f Disable UART receive _1 1 Cea port input buffer pi 1 Clear port output buffer _1 1 Enable XON XOFF handshaking _1 1 Enable port power 1 1 Set DTR signal TRUE DTR1 0 pi 1 f f Enable Echo mode Lj Enable UVARTreceive RETURNS No arguments returned ERRORS No meaningful errors MORE THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CONTROL PRINTER PORT Continued CAUTION The printer port in the Mensch configuration is driven by the common baud rate generator T4 The SELECT COMMON BAUD RATE routine may be used to change the baud rate for the printer port but it will also affect the PC link and the keyboard ports as well NOTE Any serial port on the W65C265S micro controller including the printer port may be driven by either of the baud rate generators The decision was made to allocate one baud rate source to the modem port and share the other among the remaining ports in the Mensch configuration This was based significantly upon the assumption th
177. ng the internal operation of the SELECT_COMMON_BAUD_RATE subroutine VECTOR 00 E060 SELECT_COMMON_BAUD_RATE EXPECTS Baud rate selection code in 8 bit register A O 110 Baud l 150 Baud 2 300 Baud 3 600 Baud 4 1200 Baud 5 1800 Baud 6 2400 Baud 7 4800 Baud 8 9600 Baud 9 14400 Baud A 19200 Baud B 38400 Baud C 57600 Baud D 115000 Baud RETURNS No arguments returned ERRORS Carry bit Clear OK Set Unacceptable selection code SELECT_DISK DESCRIPTION This routine selects a PCMCIA Slot to be the Default Drive VECTOR 00 80D 1 SELECT_DISK EXPECTS Register A Device code to be the Default Drive 00 Internal No Card Selected 01 Low Card 02 High Card RETURNS No arguments returned ERRORS No errors returned 190 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SEND BYTE TO Send via PC link port DESCRIPTION This subroutine will queue one byte from 8 bit register A to be sent to the serial PC link port The carry bit will be set if the serial PC link port cannot accept data otherwise it will be clear upon return Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the SEND_BYTE_TO_PC subroutine VECTOR 00 E063 SEND_BYTE_TO_PC EXPECTS Output byte in 8 bit register A RETURNS No arguments returned ERRORS Carry bit Clear OK Set Serial PC link port cannot accept data S
178. o input arguments RETURNS Normally returns with carry bit clear indicating that a menu selection has been made The selection code will be returned in the 8 bit register A The possible codes are 31 Selection 1 Other responses are ignored 32 Selection 2 33 Selection 3 34 Selection 4 35 Selection 5 36 Selection 6 37 Selection 7 38 Selection 8 ERRORS Exception returns with carry bit set indicating that the ESC key was pressed No other exceptions or errors are detected or reported 178 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide MENU_SETUP DESCRIPTION This subroutine will 1 Clear the LCD screen 2 Write the MENSCH COMPUTER header 3 Write a specified menu string starting on line 3 of the LCD screen 4 Positions cursor on line 3 column 0 VECTOR 00 80E6 MENU SETUP EXPECTS Long pointer to the menu string as follows Bank address of string in 8 bit register A Offset address of string in 16 bit register X The string must be terminated with either 1 a null character or 2 the most significant bit of the last character set RETURNS No arguments returned ERRORS No errors detected or reported MODEM ANSWER DESCRIPTION This subroutine forces the external modem to go off hook and generate a carrier tone It assumes that the attached modem is Hayes compatible and will accept co
179. orm The Mensch ROM Monitor and Mensch Operating System were developed by the Com Log Company Inc for the Mensch Computer For best results we recommend that you please carefully read this manual completely before you attempt to develop applications on the Mensch Computer This manual contains important information on the proper use of the Mensch Operating System and its library of subroutines 3 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide NOTICE The Western Design Center Inc has made every attempt to ensure that the information in this manual is complete and accurate However WDC assumes no liability for errors or for any damages that result from the use of this document or the related products Users of the Mensch Computer especially developers should note that it is both possible and relatively simple to connect any microcomputer equipment to external devices and then to harm or destroy those devices or anything that they may control WDC assumes no liability for any connections or use of the W65C265S microprocessor the Mensch Computer and associated firmware or software Nothing herein shall be construed as a recommendation to use the W65C265S or Mensch Computer violation of existing patents or other rights of third parties Information in this document is subject to change without notice and does not represent a commitment on the part of The Western Design Center Inc or The Com Log
180. ots This module contains a Densitron LCD LM3229A128G240SNG and a Toshiba controller T6963C 5 board Figure Mensch Computer Display Module Contrast Control The readability of the display may be adjusted using the contrast potentiometer located on the right hand side of the unit 6 The data sheet on the LM3229A128G240SNG and Application Notes for the T6963C LCD Graphics Controller from Densitron provide a detailed description of this display and its operation THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Cabling and Connections A ribbon cable with 24 pin connectors connects the Mensch LCD module to the Mensch CPU module This is a symmetrical cable and the connectors are keyed for proper insertion Connect either end of the cable to the CPU module using the matching connector on the rear panel Figure 9 Mensch Computer CPU Module Rear Panel Plug the remaining end of the cable into matching connector on bottom of the LCD display module encasement See Figure 8 There is a small adaptor board between the T6963C controller and the 24 pin connector This accommodates the contrast control potentiometer Programming Support The Mensch Operating System provides several library subroutines for programmers to use when writing to the LCD screen This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to A
181. ould always branch VECTOR 00 E097 IFASC EXPECTS Input parameter byte in 8 bit register A RETURNS The carry bit will be clear of the data byte in register A corresponds to a visible ASCII character If the parameter byte passed in register A is not a valid ASCII character the IFASC subroutine will return with the carry bit set in the status register ERRORS No errors reported IS CARD INSERTED DESCRIPTION This routine tests if a RAM card is installed in the specified PCMCIA slot VECTOR 00 808C IS CARD INSERTED EXPECTS Register A PCMCIA Slot Code 00 Low Card Slot 01 High Card Slot RETURNS If RAM Card is installed Carry Bit Clear ERRORS Else Carry Bit Set 19 This manual uses the term ASCII when referring to visible characters 1F lt char 7F within the American Standard Code for Information Interchange Special characters and control characters are of course also part of the ASCII character set THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide ISDECIMAL DESCRIPTION This subroutine will check the parameter byte in register A If the byte is a valid ASCII decimal digit 30 39 it will return with the carry bit clear in the status register If the carry bit is set upon return the character was not an ASCII decimal digit Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the ISDECIMAL subr
182. outine Example LDA FA JSL ISDECIMAL BCC DEC YES Should never branch LDA 7 JSL ISDECIMAL BCS DEC Should always branch VECTOR 00 09 ISDECIMAL EXPECTS Input parameter byte in 8 bit register A RETURNS The carry bit will be clear if the data byte register A corresponds to an ASCII decimal character If the parameter byte passed in register A is not valid ASCII decimal character the ISDECIMAL subroutine will return with the carry bit set in the status register ERRORS No errors reported THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide ISHEX DESCRIPTION This subroutine will check the parameter byte in register A If the byte is a valid ASCII Hexadecimal digit 30 39 41 46 and 61 66 it will return with the carry bit clear in the status register If the carry bit is set upon return the character was not an ASCII Hexadecimal digit Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the ISHEX subroutine Example LDA FA JSL ISHEX BCC HEX YES Should never branch LDA C JSL ISHEX BCS HEX Should always branch VECTOR 00 09 ISHEX EXPECTS Input parameter byte in 8 bit register A RETURNS The carry bit will be clear if the data byte in register A corresponds to an ASCII Hexadecimal character ASCII Hexadecimal characters in the range 61 66 will be converted to upper case Therefore
183. pecific details regarding the internal operation of the HEXIN subroutine Example LDA 4 JSL HEXIN BCS Nothex3 Should never branch CMP 0D BNE Failed Should never branch LDA JSL HEXIN BCS NOTHEX3 Should always branch VECTOR 00 E093 HEXIN EXPECTS The ASCII hexadecimal character in register A corresponds to the significant nibble of the result RETURNS The resulting binary value will be returned in register A The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if the parameter was not an ASCII HEX digit Note The contents of register A may be modified even if the conversion is not performed valid ASCII hexadecimal digit is a numeric character 0123456789 2F lt char lt 3A or one of the first six letters ABCDEF 40 lt char lt 47 in uppercase or lowercase adcdef 61 lt char lt 7 A THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide IFASC DESCRIPTION This subroutine will check the parameter byte in register A If the byte is a valid ASCII character it will return with the carry bit clear The carry bit will be set upon return if the character was not ASCII Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the IFASC subroutine Example LDA F1 JSL IFASC BCC ASCII YES Should never branch LDA 41 JSL IFASC BCS NOT ASCII Sh
184. poration 2 DIR COMMD 206 DISP LCD STRING 124 143 206 Display 20 26 28 29 61 76 109 110 130 143 153 261 278 284 297 DISPLAY amp SET ALARM 69 DISPLAY amp SET DATE 67 DISPLAY amp SET TIME 67 Display Cable Connector 28 284 DISPLAY REGISTERS 76 DISPLAY PCMCIA ERROR 145 208 Displaying Graphics 126 Displaying Text 124 DO LOW POWER PGM 146 209 DOS Compatible File Support 25 DTMF TEST 86 DUMP S28 Records 100 101 DUMP to PRINTER 102 103 DUMP to Screen 104 Dump 1 line to Output 146 210 Dump 1 line to Screen 146 211 Dump It 146 212 Dump to Output 146 213 Dump to Printer 146 214 Dump to Screen 146 215 216 Dump to Screen 216 DUMPREGS 146 217 DumpS28 139 218 227 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide E ENTER Key 64 75 93 108 170 247 294 EPROM 17 20 23 24 56 57 58 84 91 112 139 278 300 ESC Escape key 64 74 75 77 78 80 81 82 85 90 95 97 100 102 104 106 108 170 247 Expansion Connectors 22 Pinouts 22 23 28 283 284 286 289 External Charger 50 55 62 135 External Memory 57 FCLOSE 131 145 219 FDELETE 131 145 219 FGETBLOCK 131 145 220 FGETC 131 145 220 228 FGETS 131 145 221 FGETW 131 145 221 228 FILELENGTH 131 145 221 FILL MEMORY 78 FILL_Memory 146 222 FINDFIRST 131 145 223 Firmware 4 23 24 30 34 56 59 69 84 91 112 114 115 122 128 131
185. power management features on the W65C265S allow it to be used effectively in portable battery powered configurations Though the IC cards appear to be memory blocks to the Mensch it can read and manipulate files on them This allows the exchange of data with DOS compatible computers on a common physical media Communications Four serial ports provide the Mensch with adaptability to many types of communication applications The low power programmable keyboard uses one of the serial ports The initial configuration additionally allocates one port each for a serial printer a modem and a direct link to another computer These are all generic serial ports which may be used for other purposes by specific application The telephone in it s various forms is rapidly becoming the most important appliance in our lives The Mensch offers a platform which supports telephone related application 15 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide MenschWorks is an application IC Card for 1 Terminal Emulation 2 E Mail Terminal 3 MenschCall textual preamble to a voice communication 4 MenschMail Mensch Computer to Mensch Computer screen to screen communication Mensch Computer Availability The Mensch is manufactured and distributed to order and a limited number are products for qualified developers 16 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Configuration The Mensch
186. ppendix Firmware Subroutine Library for more information on using these subroutines Those library subroutines which support generalized output streams may be configured to write to the LCD screen Refer to the description of the CONTROL_OUTPUT subroutine for specific details The ribbon cable is symmetrical such that there is direct one to one connection between each pin and it s corresponding identically numbered pin on other connector Refer to Appendix D 4 LCD Display Cable Connector Pinouts for signal descriptions 22 THE WESTERN DESIGN CENTER INC _Box _Circle _ClearColor _ClearFill _CONTROL_DISPLAY Power _DISP_LCD_HEADER DO MAIN Hl me _Line _ Point _PtScreen _SetColor _SetFill _SetText _SetGraph _SetGraphText _TIME_DATE_ Alternative I O Usage Mensch Computer Developer Guide Display Support Subroutines _VLine _WrDec CLEAR_LCD_DISPLAY CLEAR_TO_END_OF_LINE Text line DISP LCD STRING Text Cursor Position MENU POINT MENU SETUP MOVE PAGE TO BUFF MOVE BUFFER TO LCD POSITION PIXEL POSITION TEXT CURSOR Row amp Column RD LCD STRNG RETRIEVE DISPLAY STATUS WRITE PIXEL WR LCD STRNG WRITE LCD CHARACTER Text Cursor Position Other LCD modules may be used with the T6963C controller module providing they do not require different signals This allows the Mensch to be a development prototyping platform for many different produ
187. quest the starting address and accept input via any of the selected input streams The user must enter six ASCII Hex digits to form each 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address AAAA is the offset address within the bank After valid addresses have been entered Dump 1 line to Screen will write a formatted header and two lines of eight bytes of memory dump data to each of the selected output streams This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E018 Dump 1 line to Screen EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered NOTE The name of this subroutine may be confusing to some readers It may help to remember dump operations always begin with a header and that one dump line always includes sixteen b
188. r Developer Guide Alternative I O Usage Developers may choose the Mensch as a prototyping platform for product applications which do not require a game controller These configurations may choose to use this port for other purposes It should be noted that only seven of the eight bits are normally user definable The MSB will still control the 5 volt supply to the connector There is a jumper JMP4 which may be used to change this feature and allow the user to define the entire 8 bit port Power Subsystem The Mensch has been designed to operate either from an external power source or an internal rechargeable battery pack If both are available and connected at the same time the battery pack will be recharged from the external supply There are indicators on the front panel of the Mensch which show that the external power is available and also when the batteries are charging External Charger Power Module Each Mensch is shipped with an external charger module This UL approved power adaptor plugs into a standard AC outlet and provides power to the Mensch It attaches to the rear panel via the CHARGER jack When the charger power module is attached and providing power the lower green LED labeled POWER will glow The top red LED labeled CHARGING will glow when the batteries are charging Charger Connector Figure 21 Mensch Computer Charger Power Module Figure 22 Mensch Computer Rear Panel Char
189. r X and 16 bit register Y Terminal coordinate in 8 bit register A Lines are drawn from left to right If the coordinate in register X exceeds 239 then a value of zero will be used instead If the coordinate in register A exceeds 239 then a value of 239 will be used instead RETURNS No arguments returned in register Normal operation returns with the carry bit clear ERRORS If the coordinate is register Y exceeds 127 then this subroutine will return with the carry bit set and the line will not be drawn _INIT_DP_POINTER DESCRIPTION This subroutine maintains an internal stack of Direct Page values for later recovery by the RESTORE DP POINTER subroutine Upon entry it saves the current DP register on this internal stack It then sets the DP register to the value received in register X VECTOR 00 8110 INIT DP POINTER EXPECTS New direct page pointer value in 16 bit register X RETURNS No arguments returned ERRORS No errors detected NOTE This subroutine performs no error checking Its internal stack can only hold sixteen saved values for the DP register Attempts to store more than the maximum 16 will overflow this stack and cause unpredictable results 121 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _Line DESCRIPTION This subroutine will plot a line at any angle on the display in graphics mode VECTOR 00 8192 _Line EXPECTS The starting coordinates of the lin
190. r into an upper case ASCII A Z character The character to be converted must be passed in register A The converted result will be returned in register A If they byte is not a lower case ASCII character it will return unchanged Refer to the Mensch Monitor Assembly Listing for specific details regarding the internal operation of the UPPER_CASE subroutine Example LDA b JSL UPPER CASE CMP B BNE FAILED Should never branch VECTOR 00 E0A3 UPPER CASE EXPECTS Character to be converted in register A RETURNS Converted upper case character is returned in register A If the byte was not a lower case ASCII character it will be returned unchanged ERRORS No errors reported VERSION DESCRIPTION This subroutine will return info on the current ROM version Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the VERSION subroutine VECTOR 00 07 VERSION EXPECTS No input arguments RETURNS ROM version information Register X Pointer to 4 character string representing the version Example 2 01 Register Y Pointer to formatted ASCII string representing the last assembly date Example SAT DEC 3 12 16 05 1994 Register A 0 No particular significance ERRORS No errors reported THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide WR_3 ADDRESS DESCRIPTION This subroutine will write a 3 byte a
191. raphics Test Controller Test Test Software Return To Printer Version Main Menu Figure 61 Test Menu Tree THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 1 KEYBOARD TEST UEST Optiom This TEST MENU item allows the user to check the serial keyboard path KEYBOARD TEST _ use ESC key to exit Figure 62 KEYBOARD TEST When the above screen appears the program will echo any key pressed by the user The ESC Escape key may be used to cancel this operation and return to the TEST MENU If a normally displayable character does not echo properly reset the system and try again If the problem persists then there may be a malfunction in the keyboard module or alternative source or the cabling or the Mensch Computer itself Further isolation involves replacing the keyboard with a known good unit and retesting THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 2 DTMF TEST TEST Optiom This TEST MENU item will cause a brief burst of sound as DTMF tones are gated through the amplifier to the speaker 06 18 94 MENSCH COMPUTER 12 34 56 TEST MENU KEYBOARD TEST DTMF TEST MODEM TEST TEST PRINTER GAME CONTROLLER SOFTWARE VERSION GRAPHICS TEST RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SEELCT Figure 63 TEST MENU DTMF TEST The following screen will appear when this item is selected DTMF TEST use ESC key to exit Fi
192. reset or a power on reset There is no simple way for the firmware to differentiate which reset occurred However some semaphores in memory tell the monitor that certain aspects of the system have already been initialized These should not be changed by the reset initialization sequence There is a checksum associated with the time of day clock and baud rate If the checksum 15 correct then the time of day clock has been running If this is the case the clock value will not be re initialized Initialization Sequence The following sequence is performed when power up or triggered RESET occurs to get the Mensch Computer into a normal operating mode This description is intended as an overview only not a specific line by line analysis of the program code INITIAL CONDITION POWER OFF or any previous powered state including LOW POWER MODE RESET OCCURS This may be POWER ON or triggered RESET STAGE 1 Performed by Mensch Monitor Essential initialization Disable interrupts Reset stack Clear decimal mode Enable External Memory Check location 00 8000 00 8002 for the string WDC If the string is there Transfer control to Firmware program in EPROM memory JMP 00 8004 Else This alternate path is not applicable to this discussion of the Firmware Refer to the Mensch Monitor ROM Reference Manual for more details THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide
193. rget location Enter Address BB AAAA Figure 49 Set Breakpoint When execution resumes the program may attempt to execute the target instruction The BRK instruction will be executed instead Control will be returned to the Mensch Operating System The ESC Escape key may be used to cancel this operation and return to the DEBUG MENU instead of entering an address at the prompt THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 4 FILL MEMORY DEBUG MENU Option This DEBUG MENU item allows the user to fill a block of memory with a constant value Enter Lowest Address BB AAAA Figure 50 FILL Memory First Prompt When this option is selected it will display the above prompt for the owest address in the memory block The user may cancel this operation by pressing the ESC Escape key instead of entering an address Enter Lowest Address BB AAAA 00 0000 Enter Highest Address BB AAAA Figure 51 FILL Memory Second Prompt After the user has entered a lowest address the above prompt for highest address will appear Again user may cancel this operation by pressing the ESC Escape key instead of entering an address Enter Lowest Address BB AAAA 00 5000 Enter Highest Address 00 SFFF Enter Byte in HEX Figure 52 FILL Memory Third Prompt Press any key to return to the SETUP MENU screen THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 5 DUMP
194. rt 164 185 Programmable Alarm 7 Programming 5 6 7 25 27 32 33 36 37 40 41 44 45 48 60 62 64 112 137 297 Prt Sc Print Screen Key 291 296 PUT CHR 10 PUT STR 10 R RAM 17 20 23 24 58 62 75 76 108 133 225 242 243 246 280 300 RD_LCD_STRNG 10 READ_ALARM 10 READ_DATE 10 READ_TIME 10 Recharge i e Batteries 21 References 11 REMOVE_DIRECTORY 10 RESET 5 10 RESET Button 21 RESET ALARM 260 RETRIEVE DISPLAY STATUS 10 261 ROM Monitor 2 3 8 14 24 56 74 109 110 139 146 261 267 301 RUN PCMCIA SHELL 111 226 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 5 528 Records 96 97 100 218 277 SBREAK 10 Schematics 34 38 42 44 51 SEGA 2 5 12 46 48 170 283 299 Controller 5 7 8 11 12 13 SELECT COMMON BAUD RATE 10 32 36 44 113 SELECT DISK 10 SEND BYTE TO PC 10 142 265 SEND CR 10 SEND HEX OUT 10 SEND SPACE 10 Serial 5 7 8 11 23 33 37 41 45 112 114 140 141 176 186 187 265 284 Serial Port Connectors 5 23 Keyboard 5 7 8 12 13 23 Modem 5 7 8 12 13 23 33 37 38 40 41 45 71 112 118 158 183 284 300 PC Link 5 7 8 12 23 42 44 56 83 96 97 100 101 106 112 120 300 Printer 5 8 9 12 13 23 34 36 112 117 164 185 284 300 Serial Ports 17 18 33 34 37 38 41 42 45 58 112 113 158 263 Baud Rate Generation 7 112 Pinouts 11 283 Progra
195. ry bit normally will return clear but it will be set if the specified coordinates were unacceptable Clear 2 OK Set 2 Unacceptable 182 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide POSITION_TEXT CURSOR Row amp Column DESCRIPTION This subroutine will position the text cursor at the specified coordinates on the LCD screen VECTOR 00 802F POSITION TEXT CURSOR EXPECTS Row coordinate 0 15 8 bit in register A Column coordinate 0 39 in 16 bit register X RETURNS No arguments returned ERRORS The carry bit normally will return clear but it will be set if the specified coordinates were unacceptable Clear 2 OK Set 2 Unacceptable PUT CHR DESCRIPTION This subroutine will output a character to each of the selected output streams Refer to the description of CONTROL OUTPUT for details about configuring the output streams Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the PUT CHR subroutine VECTOR 00 E04B PUT_CHR EXPECTS Character to be output in 8 bit register A RETURNS All registers are saved upon entry and restored before returning The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if no output ports are enabled 183 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide PUT_STR DESCRIPTION This subroutine will output a str
196. s from the user as needed RETURNS The carry bit will be clear if the operation was successfully performed ERRORS The carry bit will be set if invalid address data was entered 194 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SET_DATE DESCRIPTION This subroutine will set the current system date from a null terminated text string provided in a user specified buffer Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the SET_DATE subroutine VECTOR 00 E075 SET_DATE EXPECTS A pointer in 16 bit register X to a nine 9 character buffer located in memory bank 0 The string format is MM DD YY null or MM DD YY null wherein MM Month code 1 12 possible in ASCII digits 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December DD Day of month code 1 31 possible in ASCII digits YY Year code last two digits 94 1994 in ASCII RETURNS No arguments returned ERRORS Carry bit Clear OK Set Error detected NOTE This subroutine requires a fixed size fixed format input string Therefore the null terminator character is acceptable but not really necessary 195 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide
197. scape eventually returns control to the TEST MENU There may be a delay of several seconds before the ESC key is recognized THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 4 TEST PRINTER MENU Option This TEST MENU item allows the user to test the printer path by sending a repeating stream of character data to the serial printer port If the communication link is sound this test should effectively exercise the printer hardware Serious problems the printer itself may manifest themselves when this test is run If the printer does not print as expected then check power cabling and confirm that the printer is enabled Control will return to the TEST MENU upon successful completion of this test MENSCH COMPUTER 12 34 56 TEST MENU KEYBOARD TEST DTMF TEST MODEM TEST TEST PRINTER GAME CONTROLLER SOFTWARE VERSION GRAPHICS TEST RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SEELCT Figure 66 TEST PRINTER If there is no printer attached to the port then the TEST MENU screen will just blink once when this item is selected 10 Most late model printers have internal diagnostics If this test does not operate correctly then the printer self test should be performed THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 5 GAME CONTROLLER TEST MENU Option This TEST MENU item allows the user to test the game controller and its port MENSCH
198. sed Mensch Operating System Refer to W65C2658 INFORMATION SPECIFICATION AND DATA SHEET or the Mensch Monitor ROM REFERENCE MANUAL for details own custom firmware restricts the use of other independently developed software Developers may choose to use this hardware configuration but replace the EPROM with their While such an approach may be viable for specialized applications it THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Plug In IC Memory Cards The Mensch has 32K bytes of internal RAM to be used by the firmware operating system and specific applications Most memory in the system is assumed to reside on removable IC memory cards The Mensch 15 equipped with two slots of the PCMCIA form factor supporting a subset of the Type standard Additional memory for the Mensch may reside on either or both plug in cards The LowICCard has been mapped to a base address of 01 0000 The HighICCard had been mapped to a base address of 40 0000 Figure 6 IC Card Slots Developers are encouraged to design their applications software to work with the Mensch Operating System This is most easily accomplished by locating their applications in the external memory cards and using the subroutine library to access standard features of the system LowICCard This bottom slot is labeled LO on the front panel It is mapped into memory such that the lowest available address is 01 0000 The highest a
199. sette 00 009 555 etes 00 004077 00 00 5 000060 22 00 0070 7 B K K 00 0080 K K K K 00 0090K K K K 00 00 0 K K K 00 00BO0K K K K Figure 58 ASCII Screen Dump Data Display Press any key to return to the DEBUG MENU 7 Reserved DEBUG Optiom This option is not yet assigned It has been reserved for future use When this menu item is selected the following screen will appear 08 18 94 MENSCH COMPUTER 12 34 56 Function not available Figure 59 DEBUG ITEM 7 Pressing any key will return to the DEBUG MENU 8 RETURN TO MAIN MENU DEBUG MENU Option Pressing ESC Escape or selecting this option on the DEBUG MENU returns control to the MAIN MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 3 TEST MENU MAIN Option The TEST MENU is used to conduct simple checks on some of the key elements of the Mensch Computer 06 18 94 MENSCH COMPUTER 12 34 56 TEST MENU KEYBOARD TEST DTMF TEST MODEM TEST TEST PRINTER GAME CONTROLLER SOFTWARE VERSION GRAPHICS TEST RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SELECT Figure 60 TEST MENU Besides testing the keyboard audio circuitry modem printer and game controller this menu allows the user to review what version and date are in the EPROM firmware Test Menu Keyboard Game G
200. specified buffer and terminated with a NUL 00 character at the Register Y 1 location in the buffer ERRORS The carry bit will be set if the current text cursor position plus the character count exceeds the screen size generating an invalid cursor position NOTE The string buffer should be at least one byte larger than the longest string to be read into it READ ALARM DESCRIPTION This subroutine will read the current system alarm setting as a null terminated text string into a user specified buffer Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the READ ALARM subroutine VECTOR 00 E051 READ ALARM EXPECTS A pointer in 16 bit register X to a nine 9 character buffer located in memory bank 0 RETURNS Null terminated time string in specified buffer The string format is HH MM SS null wherein HH Hours code 0 23 possible in ASCII digits OO Midnight 12 Noon 23 11 PM MM Minutes code 0 59 possible in ASCII digits SS Seconds code 0 59 possible in ASCH digits ERRORS No meaningful errors 185 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide READ_DATE DESCRIPTION This subroutine will read the current system date as a null terminated text string into a user specified buffer Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the READ_DATE
201. ssfully Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 30 File open in Read Only mode FPUTW DESCRIPTION This routine Write a Word 16 bits of data to the specified file VECTOR 00 80A1 FPUTW EXPECTS Register X Word to be written into file Register Y File Handle of file to be written to RETURNS If word was written successfully Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 30 File was opened in Read Only mode 162 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FSEEK DESCRIPTION This routine moves the file pointer to the specific location within the specified file VECTOR 00 8098 FSEEK EXPECTS File Handle in 8 bit register A Desired byte location in file as 32 bit offset Low word of position to seek to in 16 bit register X High word of position to seek to in 16 bit register Y RETURNS No output arguments ERRORS No meaningful errors returned NOTE Internally F NEXT ADDRESS 00 102B will point to the current address within the specified file This pointer will be used by FGETC FGETW FGETB and other subroutines when accessing the file 163 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide GET_3BYTE_ADDR DESCRIPTION This subroutine accepts six ASCII Hex digits from the input streams selected by the CONTROL INPU to form a 24 bit address The input formatis BB
202. subroutine IT WILL NOT RETURN VECTOR 00 806E ENGAGE LOW POWER MODE EXPECTS No input arguments RETURNS This vector does not return ERRORS No meaningful errors A PRINTER BYTE from printer port DESCRIPTION This subroutine will read the next available byte from the printer serial port input buffer If the buffer is empty then the subroutine will return with the carry bit set VECTOR 00 8041 GET A PRINTER BYTE EXPECTS No input arguments RETURNS Received byte from printer serial port in 8 bit register A ERRORS The carry bit will return clear if a received data byte is available in 8 bit register A It will be set if no received data was available THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _GET_BIN_NUM DESCRIPTION This subroutine will examine an ASCII hexadecimal digit string in a specified buffer and return the corresponding 16 bit binary number VECTOR 00 80E3 GET BIN NUM EXPECTS Buffer address for ASCII data as Bank in 8 bit register A Offset in 16 bit register X RETURNS Normally returns with carry bit clear and the binary number in 16 bit register X ERRORS Exceptions return with carry bit set and explanation code in the 8 bit register A Codes are 0D no valid digits were received before an ENTER key was detected 1B ESC Escape key was detected FF Non Hexadecimal characters were entered NOTE This is a conversion
203. subroutine which just examines data provided by the calling program It does not itself get anything or perform any kind of input operations GET CONTROLLER DATA DESCRIPTION This subroutine will read the SEGA game controller and return data about the state of the switches VECTOR 00 8068 CONTROLLER DATA EXPECTS No input arguments RETURNS Returned byte in 8 bit register A Bit Button 7 2 START 6 A 5 4 3 2 Right 2 Left 1 Down O Up ERRORS Normally returns with the carry bit clear It will return with the carry bit set if the controller port has been turned OFF 118 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _GET_KEYBOARD_CHARACTER DESCRIPTION This subroutine will read the next available byte from the keyboard serial port input buffer If the buffer is empty then the subroutine will return with the carry bit set VECTOR 00 8023 _GET_KEYBOARD_CHARACTER EXPECTS No input arguments RETURNS Received byte from keyboard serial port in 8 bit register A ERRORS The carry bit will return clear if received data is available in 8 bit register A It will be set if no received data was available _GET_MODEM_ BYTE from modem port DESCRIPTION This subroutine will read the next available byte from the modem serial port input buffer If the buffer is empty then the subroutine will return with the carry bit set VECTOR 00 8050 _GET_MODEM_BY
204. t VECTOR 00 8020 JRETRIEVE KEYBOARD STATUS EXPECTS No input arguments RETURNS Keyboard port status byte in 8 bit register A O LSB Data in input buffer ESCape or C received XON XOFF protocol mode Always zero 0 4 DSR signal is TRUE DSRO 0 Echo mode is enabled 6 Input buffer has overflowed 7 ven Output buffer has overflowed ERRORS No meaningful errors NOTES If the keyboard scanning has been turned OFF via the SEND BYTE TO KEYBOARD subroutine then the returned status bits may be misleading THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _RETRIEVE_MODEM_PORT_STATUS DESCRIPTION This subroutine will return the current status of the serial modem port VECTOR 00 8044 _RETRIEVE_MODEM_PORT_STATUS EXPECTS No input arguments RETURNS Modem port status byte in 8 bit register A O LSB Data in input buffer ESCape or C received XON XOFF protocol mode Port power is ON 4 DSR signal is TRUE DSR2 0 Echo mode is enabled 6 Input buffer has overflowed 7 ven Output buffer has overflowed ERRORS No meaningful errors NOTES If the modem port supply voltage has been turned OFF via the CONTROL MODEM PORT subroutine then the returned status bits may be misleading 127 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide _RETRIEVE_PC_PORT_STATUS DESCRIPTION This subroutine will return the current status of serial PC link port
205. ternal connections such as BBS systems and on line services The PC link port may be configured to share the same baud rate source as the modem port but care should be taken to avoid conflicts 113 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CONTROL PRINTER PORT DESCRIPTION This subroutine allows the programmer to manipulate the supply voltage delivered to the printer serial port connector clear the I O buffers and configure the characteristics if the port It does not select the word length parity or number of stop bit These default to 8 bits no parity and one stop bit The printer port in the Mensch configuration is driven by the common baud rate generator T4 VECTOR 00 805F CONTROL PRINTER PORT EXPECTS Printer port configuration code in 8 bit register A 7 0 5 4 3 2 1 0 L 0 Noeffecton port operation _ 0 Noeffecton port operation _ 0 Noeffecton port operation _ 0 Noeffecton port operation _ o Noeffecton port operation p o Noeffecton port operation _ o Noeffecton port operation 0 1 Noeffecton port operation 0 1 _ Disable transmitinterrupts 0 1 j DisaleXON XOFFhandshaki
206. ternal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E00F DUMPREGS EXPECTS No input arguments This is an interactive subroutine which requests parameters from the user as needed RETURNS The carry bit will be clear upon completion ERRORS No errors reported 153 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide DumpS28 DESCRIPTION This is the subroutine invoked by typing the W command at the monitor prompt Basically DumpS828 will request lowest and highest addresses via each selected input stream Then it will dump the specified memory block in S28 loader format to all selected output streams The last record written will begin with 58 indicating that none follow S28 Format S2LLHHMMLWDDDDDDDD CC where 52 literally the ASCII characters 52 LL length of the data 4 HH high byte of the address MM middle byte of the address LW low byte of the address DD one byte of data next byte ect CC checksum 1 s complement of the sum of the length address and data bytes The user must enter six ASCII Hex digits to form each 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address AAAA is the offset address within the bank After valid addresses have been entered DumpS28 will write S28
207. time of day clock calendar and alarm features Clock Calendar Alarm Support Subroutines READ_DATE SET_DATE READ_TIME SET_TIME SET_ALARM RESET_ALARM READ_ALARM GET_ALARM_STATUS This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix Firmware Subroutine Library for more information on using these subroutines Power Management The power management functions of the Mensch fall into two categories 1 Battery Monitoring Status Display and 2 Low Power Mode Support Battery Monitoring The condition of the battery pack in the Mensch is constantly monitored by the hardware Background functions in the Firmware regularly check and display the battery status If the battery pack is adequately charged the title MENSCH COMPUTER will appear normally in the middle of the Status Display Line If the battery condition is weak enough to jeopardize continued operation of the Mensch Computer the indication BATTERY LOW will appear in the middle of the Status Display Line replacing the title When this situation occurs operation should be suspended until the battery pack can be recharged Low Power Mode When the Mensch keyboard is inactive for several minutes the system will switch over to low power mode The LCD display will blank out This action is taken to reduce power consumption and extend the battery life The Mensch
208. tion of the feature 193 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SET_Breakpoint DESCRIPTION This is the subroutine invoked by typing command at the monitor prompt The monitor command allows the user to set a breakpoint at a specific location SET_Breakpoint will request an address and accept input via the each of the selected output streams The user must enter six ASCII Hex digits to form a 24 bit address The input format is BB AAAA Wherein BB is the bank address This subroutine will echo after the 2 digit bank address is the offset address within the bank After a valid address has been entered SET_Breakpoint will store a BRK instruction 00 at the target location When program execution reaches that address the BRK instruction will transfer control to the Mensch Monitor in ROM This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E072 SET_Breakpoint EXPECTS No input arguments This is an interactive subroutine which requests parameter
209. ubroutines are available to application programs when accessing the IC memory cards as DOS compatible file devices FCLOSE FGETW FPUTBLOCK GETDFREE FDELETE FILELENGTH FPUTC IS_CARD_INSERTED FGETBLOCK FINDFIRST FPUTS LOG_DRIVE FGETC FOPEN FPUTW OS_SHELL FGETS FORMAT FSEEK SELECT_DISK This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix Firmware Subroutine Library for more information on using these subroutines THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide System Functions Many elements of the Mensch are not typically within the domain of any particular kind of application program The time of day clock calendar selectable alarm function and power management are examples of such elements Time Of Day Clock Calendar The time of day clock feature of the Mensch Computer operates even when the system is in low power mode This is because it resides in the internal RAM and ROM of the W65C265SS itself The time of day clock may also be set and read by application programs Support Subroutines Library subroutines for programmers to use when accessing the time of day clock calendar Clock Calendar Support Subroutines READ_DATE SET_DATE READ_TIME SET_TIME This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their
210. used as a string terminator VECTOR 00 8101 MOVE_BUFFER_TO_LCD EXPECTS No input arguments RETURNS No arguments returned All other registers are saved upon entry and restored before returning The global variable BUFFERI is located 00 2800 in the Mensch Computer OS configuration ERRORS No errors detected or reported 181 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide MOVE_PAGE_TO_BUF DESCRIPTION This subroutine will move a 600 character LCD image to BUFFER1 40 doesn t move line 0 Lines though 15 are moved A null is automatically inserted into buffer position 641 to be used as a string terminator VECTOR 00 80FE MOVE_PAGE_TO_BUF EXPECTS No input arguments RETURNS No arguments returned All other registers are saved upon entry and restored before returning The global variable BUFFERI is located 00 2800 in the Mensch Computer OS configuration ERRORS No errors detected or reported POSITION PIXEL Coordinates H V DESCRIPTION This subroutine will position the next graphics operation at the specified coordinates on the LCD screen The upper left corner of the display is 0 0 The lower right corner corresponds to coordinates H2239 V 127 VECTOR 00 81B6 POSITION PIXEL EXPECTS Horizontal coordinate 0 239 in 16 bit register X Vertical coordinate 0 127 in 8 bit register Y RETURNS No arguments returned ERRORS The car
211. used by other graphics plotting subroutines The flag is used to determine whether pixel points should be plotted in white or black Clear 2 White Set 2 Black VECTOR 00 8189 ClearColor EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected ClearFill DESCRIPTION This subroutine will clear the FILL flag used by other graphics plotting subroutines The flag is used to determine whether or not the plotting subroutines should fill the shapes when they draw them Set Hill Clear 2 No Fill VECTOR 00 818F ClearFill EXPECTS No input arguments RETURNS No arguments returned ERRORS No meaningful errors are detected 105 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide CLR STPWTCH DESCRIPTION The STOPWATCH function may be used as an event timer This subroutine will reset the STOPWATCH to zero The STOPWATCH is a 32 bit counter which counts up at regular 1 100 Sec intervals The current value of the STOPWATCH may be read via the STPWTCH subroutine VECTOR 00 8128 CLR STPWTCH EXPECTS No input arguments RETURNS No arguments returned received registers are saved and restored before returning ERRORS No meaningful errors are detected CONTROL CONTROLLER PORT DESCRIPTION This subroutine allows the programmer to enable or disable the supply voltage delivered to the controller port connector
212. uters have some terminal emulation capabilities Depending upon the type of interface a special cable may be required Basically their serial communication ports must provide transmit data and receive data and handshaking signals which correspond to Data Set Ready DSR and Data Terminal Ready DTR Cables to support RS 232 communication are described in detail in Mensch Schematics These cables are available and may be obtained from WDC Programming Support The Firmware provides several library subroutines for programmers to use when using the PC link PC Link Support Subroutines CONTROL PC PORT RETRIEVE PC PORT STATUS GET BYTE FROM PC SELECT COMMON BAUD RATE SEND BYTE TO PC This basic set may be used as building block functions Programmers may use them to develop more sophisticated libraries of their own Refer to Appendix B Firmware Subroutine Library for more information on using these subroutines Those library subroutines which support generalized input output streams may be configured to communicate with the link port Refer to descriptions of CONTROL INPUT CONTROL OUTPUT for specific details Alternative I O Usage Developers may choose the Mensch as a prototyping platform for product applications which do not require interconnection to a personal computer These configurations may choose to use serial port 3 for other purposes Refer to Serial Port Programming Considerations for more information
213. veloper Guide GET_HEX DESCRIPTION This subroutine will get the next character from any selected input stream into register A If it is a SPACE 20 character then HEX will return with the carry bit set Otherwise the subroutine will accept another character If either byte is not an ASCII Hex character then this subroutine will also return with the carry bit set but register A will be cleared to 00 If both bytes were ASCII Hex characters the pair will be evaluated to produce a single binary byte of the value represented by the two hexadecimal digits The HEX subroutine will return with the value in register A and the carry bit set Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the GET_HEX subroutine VECTOR 00 E039 GET_HEX EXPECTS No input arguments RETURNS The carry bit will be set and 8 bit register A 20 if the first character was a SPACE or The carry bit will be set and 8 bit register A 00 if either input byte was not an ASCII HEX digit Or The carry bit will be clear and 8 bit register A will contain the binary value represented by the two hexadecimal digits input ERRORS No errors reported 169 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Get_HiLo DESCRIPTION This subroutine will send the following message to all selected output streams Card HI or It then waits for a
214. veloper Guide FPUTBLOCK DESCRIPTION Writes a specific number of bytes into the specified file VECTOR 00 80A7 FPUTBLOCK EXPECTS All parameters to this routine must be passed on the stack SP 4 File Handle to write to SP 5 Source Address 16 bits SP 7 Bank Address of Source 8 bits SP 8 Length to write 16 bits It is the responsibility of the calling routine to restore the stack pointer after this routine returns RETURNS If Block was written successfully Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 30 File opened in Read Only mode FPUTC DESCRIPTION This routine writes a single byte to the specified file VECTOR 00 809E FPUTC EXPECTS Register A Byte to be written into file Register Y File Handle of open file to write to This routine assumes that a file has been previously opened and will NOT check for an open file RETURNS If byte was written Carry Bit Clear ERRORS Else Carry Bit Set Register A Error Code 30 File is open as Read Only 161 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide FPUTS DESCRIPTION This routine writes a String of Bytes to the specified file The string must be terminated by a 00 byte VECTOR 00 80A4 FPUTS EXPECTS Register Y File Handle of Opened File Register X Address of String in memory Register A Bank Address of String RETURNS If string is written succe
215. will be set if no output ports are enabled 192 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide SET_ALARM DESCRIPTION This subroutine will set the system alarm time from a null terminated text string in a user specified buffer Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the SET_ALARM subroutine VECTOR 00 E06F SET ALARM EXPECTS A pointer in 16 bit register X to a nine 9 character buffer located in memory bank 0 The string format is HH MM SS null wherein HH Hours code 0 23 possible in ASCII digits OO Midnight 12 Noon 23 11 PM MM Minutes code 0 59 possible in ASCII digits SS Seconds code 0 59 possible in ASCH digits RETURNS No arguments returned ERRORS Carry bit Clear OK Set Error detected NOTE This subroutine requires a fixed size fixed format input string Therefore the null terminator character is acceptable but not really necessary RELATED The User Alarm Wakeup Subroutine Vector UALRMIRQ 00 0134 allows application programs to associate a subroutine with the alarm timeout condition This vector should be initialized prior to setting the alarm When the alarm times out all essential overhead will be handled by the Mensch ROM Monitor before transferring control to the vector Refer to Mensch Monitor Assembly Listing for specific details regarding the opera
216. y 00 E02A GET HEX 00 E039 Get Address 00 E042 Get E Address 00 E045 Get 5 Address 00 E048 HEXIN 00 E093 IFASC 00 E097 ISDECIMAL 00 E09B ISHEX 00 E09F RESET 00 E084 SBREAK 00 E05D SET Breakpoint 00 E072 UPPER_CASE 00 E0A3 VERSION 00 07 101 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Library Subroutine Descriptions The Firmware provides some subroutines to allow user provided software to perform basic I O functions with the keyboard display modem printer PC link interface and controller The user provided software will access these subroutines through a vector table in EPROM These subroutines will generally pass arguments through registers and use the carry bit as an error exception flag Normally the carry bit will return clear indicating normal execution The carry bit will be set if an error occurred or a notable condition was detected If further qualification of the error 15 appropriate a code will be returned in register A Refer to the individual description of each subroutine for specific details _Bin2BCD DESCRIPTION This subroutine will convert a 16 bit unsigned value into an equivalent BCD number VECTOR 00 8183 _Bin2BCD EXPECTS The value to be converted must appear in 16 bit register X RETURNS Least significant digits of the BCD number are returned in 16 bit register X and the most significant BCD digits in 8 bit register A Example If Value
217. y components of the Mensch MENSCH COMPUTER 12 34 56 SETUP MENU DISPLAY amp SET TIME DISPLAY amp SET DATE DISPLAY amp SET ALARM Reserved Reserved INITALIZE MODEM VIEW MODEM SETUP RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SELECT Figure 30 SETUP MENU This is the menu to select when the system date and time need to be reset It also provides a means of setting or disabling the system alarm function Setup Menu Display amp Display amp Reserved View Modem Set Time Set Alarm Setup Display amp Reserved Initialize Return To Set Date Modem Main Menu Figure 31 SETUP MENU Tree In addition there are two items by which the user may view the current setup options on a Hayes compatible modem or send it a predefined initialization sequence THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 1 DISPLAY amp SET TIME SETUP MENU Option This SETUP MENU item allows the user to enter a new time value for the system time of day clock calendar feature of the Mensch 11 14 94 MENSCH COMPUTER 12 34 56 SETUP MENU DISPLAY amp SET TIME DISPLAY amp SET DATE DISPLAY amp SET ALARM Reserved Reserved INITALIZE MODEM VIEW MODEM SETUP RETURN TO MAIN MENU USE CURSOR UP DOWN amp ENTER TO SELECT Time is 12 34 56 Time Format HH MM SS Figure 32 DISPLAY amp SET TIME The time entry format HH MM SS is shown above wherein hours MM Minutes
218. y the RAM location can be changed Enter Address BB AAAA Figure 97 ALTER MEMORY Prompt When a valid address response has been entered then the currents of sixteen locations beginning at the specified address will be displayed The cursor will be positioned below the first location and the user may begin entering new data into consecutive locations Address 4 5 6 7 8 9 00 1234 26 85 20 0C 00 00 01 40 00 123C 41 42 35 28 44 46 28 42 00 1234 Figure 98 ALTER MEMORY Edit Screen The cursor will advance by spacing over to the next field as each value is typed Backspacing is supported however only the ENTER key will exit and return control to the LOAD amp DUMP MENU The ESC Escape key may behave unpredictably and should not be used 8 RETURN TO MAIN MENU LOAD amp DUMP Optiom Pressing ESC Escape or selecting this option returns control to the MAIN MENU THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide 7 ROM MONITOR MAIN MENU Option Selecting the ROM MONITOR option allows the PC Link to gain access to the internal debugger of the W65C265 chip PC or other host must be executing a communications program such as terminal emulation in order to use the Mensch ROM Monitor When this menu item is selected the startup message and prompt will be sent via the PC link MENSCH ROM Version 2 03 Copyright 1994 Assembled Wed Dec 14 11 09 04 199
219. ytes from its starting address When dumping to the 40 column LCD screen this data must be reformatted as a header and two display lines This is a generic output subroutine which will dump in display line format to all active output streams even if the actual LCD display has been disabled 147 THE WESTERN DESIGN CENTER INC Mensch Computer Developer Guide Dump It DESCRIPTION This subroutine will perform a memory dump operation to all selected output streams The memory range and dump configuration must be provided by the caller It performs no error checking as it assumes validation will be performed before parameters are passed Refer to Mensch Monitor Assembly Listing for specific details regarding the internal operation of the Dump It subroutine This subroutine would not normally be used by application software on the W65C265 It has been included in this vector table to support anticipated needs of the extended Mensch Computer Operating System in that specific configuration Developers should consult Mensch Monitor Assembly Listing for specific details regarding internal operation of this subroutine in order to determine suitability for other applications and configurations VECTOR 00 E027 Dump It EXPECTS Dump configuration parameter in 8 bit register A Least significant bit Output S28 byte count Format for LCD 40 char line Note Some possible Add spaces between data bytes amp HEADER combin
Download Pdf Manuals
Related Search
Related Contents
TELEVISOR A CORES MANUAL DE SERVIÇO 「ファービー」 日本語版 7月25日(木)新発売! おなかすいた・・・ くすぐっ Hans-Ulrich Petermann Beratungs GasSim Lite Manual CP-S81 User manual - Wassermann Dental 取扱説明書 ヘアーアイロン ストレート Copyright © All rights reserved.