Home
picoFlash User`s Manual
Contents
1. JK microsystems Inc All rights reserved Printed in U S A Document Part No 94 0030 Published February 2004 JK microsystems picoFlash User s Manual Limited Warranty JK microsystems Inc warrants each picoFlash to be free from defects in material and workmanship for a period of 90 days from the date of purchase This warranty shall not apply to any unit which has been subject to misuse neglect accident or abnormal conditions of operation JK microsystems obligation under this warranty is limited to repairing or replacing at JK microsystems option any unit returned to the factory within 90 days of the date of purchase provided that JK microsystems determines that the unit is defective and has been used in compliance with the terms of this warranty If the failure has been caused by misuse neglect accident or abnormal conditions of operation repairs will be billed at a nominal cost The foregoing warranty is exclusive and in lieu of all other warranties expressed or implied including but not limited to any warranty of merchantability or fitness for any particular purpose JK microsystems shall not be liable for any special incidental or consequential damages whether in contract tort or otherwise Important Notice Life Support Mission Critical Applications This product is not fault tolerant and is not designed manufactured or intended for use or resale as on line control equipment in hazardous environments re
2. usej4ovid picoFlash User s Manual JK microsystems Unless otherwise noted this document and the information herein disclosed are proprietary to JK microsystems Inc Any person or entity to whom this document is furnished or having possession thereof by acceptance assumes custody thereof and agrees that the document is given in confidence and will not be copied or reproduced in whole or in part to meet the purposes for which it was delivered The information in this document is subject to change without notice and should not be construed as a commitment by JK microsystems Inc JK microsystems Inc will make every effort to inform users of substantive errors JK microsystems Inc disclaims all liability for any loss or damage resulting from the use of this manual or any software described herein including without limitation contingent special or incidental liability JK microsystems Inc recognizes our customer s need for a consistent product and will make every effort to provide one In order to provide the best possible product for all of our customers we reserve the right to make incremental improvements in our product designs picoFlash is a trademark of JK microsystems Inc MS DOS is a registered trademark of Microsoft Corporation XDOS is a copyright of HBS Corporation All other brand and product names are trademarks or registered trademarks of their respective companies picoFlash User s Manual Version 1 1 Copyright
3. and no parity A tutorial for hyperterminal users is available on the DevKit CD and from the documentation page of our website Apply power to the picoFlash using our A C adapter PN 88 0004 or a source of regulated 5 volt DC capable of supplying 2 Watts Observe the polarity indicated on the board silkscreen O 0 al a a oo I8 0 x o GND RESET 5V ETHERNET f A A A 4 A A A A ia mo E1 ink ou mu par e J4fo oo noo o oo O Elli oR O SERIAL 0 MADE IN USA PCB 60 0035 CONSOLE The picoFlash should respond with a welcome message and a B prompt Enter DIR to look at the directory of drive B If you do not get a welcome message or echo of the characters that you type you need to check your serial port setup To test everything but the picoFlash remove the serial cable from J5 and short pins 3 and 5 If characters sent to the picoFlash are not echoed the problem is with your setup You must resolve the problem before you can continue If you were able to do a DIR take a few minutes to explore the contents of the picoFlash s file system You will find all of the essential utilities on drive A and some optional programs on
4. ERASE Function Deletes erases one or more files from a disk Format DEL or ERASE d path filename ext 18 DOS picoFlash User s Manual JK microsystems DIR Function Format Switches MD MKDIR Function Format PATH Function Format PROMPT Function Format Text Lists directory entries DIR d path filename ext switches a display file attributes b sort by file size in bytes d sort entries by date and time f display entries by alphabetic file name order n display entries in directory order do not sort s include system and hidden files in output p stop at end of each page w display only the file name h display Help screen any invalid key Creates a subdirectory MD or MKDIR d path Specifies directories DOS will search when trying to locate executable files PATH d path d path Sets the DOS system prompt PROMPT text Resulting Character s t The current time stored by DOS d The current date stored by DOS p The current directory v The version of DOS being used n The default drive g The character gt 1 The character lt b The character q The character The character 5 Carriage return plus line feed DOS 19 JK microsystems picoFlash User s Manual REN Function Format RD RMDIR Function Format TIME Function Format TYPE Function Format VER Function Form
5. drive B Drive A is write protected and cannot be altered Drive B is read write and can be changed or reformatted After you have looked at the programs on the picoFlash the next step is to try to upload a file This is the procedure for getting a file from your PC to the picoFlash On the picoFlash type the command UP followed by the name of the file you wish to upload The picoFlash will begin sending characters to your PC polling it for the file On your PC start the transfer usually by pressing the PgUp key The telecomm program should respond by requesting the file name and protocol Enter the file name and select X Modem for the protocol The transfer should start and when it is complete you should get a new B prompt Getting Started 3 JK microsystems picoFlash User s Manual on the screen If the transfer does not work there are two things to check First verify that the terminal program does not have handshaking or flow control enabled Second the Carrier Detect signal pin 1 on the DB 9 connector into the PC could be sensed as low or false Make sure that the signal is at least 3 volts into your PC if you are not able to transfer files If the transfer terminated without problems you have a working development environment for the picoFlash controller To transfer files from the picoFlash to the development PC use the Down command described in the Utilities section of this manual Depending on your application all of th
6. of driving small loads or interfacing to TTL logic devices These ports can only source sink a few milliamps In order to interface with many loads additional circuitry such as a transistor or relay will be required Designing the interface between an output pin and a higher current load can present a challenge especially if high speed is required or the load is inductive in nature 6 Hardware picoFlash User s Manual JK microsystems Switching inductive loads such as relays solenoids and motors can generate transient voltages many times larger than the steady state operating voltage of the load For example turning off a 12 volt solenoid can easily create a negative spike of 200 volts Worst case these transients can destroy your controller In milder cases they can cause program failures and flash memory corruption In the case of high current high inductance devices the spike need not even be directly connected to the controller to cause damage or program failure Controllers damaged by inductive spikes are considered to be abused and are not eligible for warranty repair A detailed study of dealing with inductive spikes is beyond the scope of this manual For more information a good starting point is The Art Of Electronics 2nd Ed Horwitz and Hill 1989 pages 52 53 The following items should be considered when driving inductive loads A When driving a DC inductive load place a diode in parallel with the load In most cases
7. the diode can be a general purpose power diode such as a 1N4002 The cathode banded end of the diode should connect to the positive side of the load Locate the diode as physically close to the load as possible This applies to a small relay driven by a port pin as well as a larger inductive load connected to the contacts of a relay B If you are using a relay to switch an AC powered inductive load put a varistor in parallel with the load The varistor voltage rating should be about 2 times the RMS 1 5 times the peak to peak steady state voltage of the load C Relays switching an inductive load may require a capacitor placed across their contacts 0 1uF to 1 0uF is a good starting point If the relays are switching an AC load place a 100 ohm resistor in series with the capacitor D Do not use the controller s ground or power conductors to carry current from switched inductive loads Isolate these signals and route then directly to and from the power supply and as far away from the controller as possible A separate power source for large inductive loads is strongly recommended In the case of very large inductive loads a separate enclosure for the controller may be required Programming the I O Ports The I O ports are located in the processor I O space Using the ports requires the use of functions unique to the x86 family of processors Creating a pointer to the location may seem logical but that reference would be in memory space
8. 0000000000 O 2 a Ng d f e 0000000000000000 EF Ta JB e de 3 k 2 50 alis i E qb oo a 4 oa oO a seo pang PU laa al Pl oe SERIAL 0 SERIAL 1 MADE IN USA PEB 60 0035 gal 015 0 116 DIA 4 PLCS Specifications 21 JK microsystems picoFlash User s Manual Contact Information JK microsystems Inc 1403 Fifth Street Suite D Davis CA 95616 Telephone 530 297 6073 Fax 530 297 6074 Email sales jkmicro com sales inquiries support jkmicro com technical support Web http www jkmicro com M Systems DiskOnChip 39899 Balentine Drive Suite 335 Newark CA 94560 Telephone 510 413 5950 Fax 510 413 5980 Email info m sys com Web http www m sys com Rev Date Author Changes 30NOV03 EW First Issue 30JAN04 EW Add note on flash writes Revise I O tables Add memory map config table 22 Contact Information
9. Power PIO NES 13 Tabled Serial O PINOUT ni iarri AA ANA NAN GN 13 Table 4b Port A amp B Pinout icc ai A NE 13 Table de Scala tortas 13 Table 4c Debug amp PortC Pinos asain elie Sane Meets aes 13 Table he Ethernet Phan A int ete 13 Table dt TAG 8 Port D Pm i 13 Table ARRE do 13 AK an 14 puppertcd PC BIOS FOCOS ia 14 DAVE AD 14 PO o o AA 14 OnickBASIC PowerBASIC Console MO ii as 15 A 16 UP CON eS Pee Ga aa a nel 16 DOWN OM nama hh St eee Eo 16 FORMABLECOM 2A ll aa Oil a hae eo Sala hee De 17 EDITCOM Deere iii E TANU Setar 17 Table of Contents ill JK microsystems picoFlash User s Manual DOS a b E 18 XDOS Command Referente sie Si hia cia ati Bean 18 BPS CURT Ce UI NTN Sc A a Na a a 21 Contact NOT MANON sh EA A EG Sad a a Sic A Oa BAGA DA 22 picoFlash User s Manual JK microsystems Overview The picoFlash single board computer is based on the RDC R8822 microcomputer The R8822 is a high performance 16 bit single chip microcomputer that is software compatible with the 80C186 family of microprocessors DOS compatibility allows development in a familiar environment with a wide range of tools High endurance flash memory eliminates EPROM programming without worry of damaging the onboard non volatile memory with repeated program cycles Applications are uploaded directly into the flash disk Expansion options provide high capacity flash storage eliminating the size and reliability problems associated with electro mechanica
10. at VOL Function Format 20 Renames a file REN d path filename ext filename ext Deletes a subdirectory RD or RMDIR d path Displays or changes the current DOS time TIME Ah mm ss xx Display the contents of a file TYPE d path filename ext Displays the DOS version number VER Displays the volume label of specified drive VOL d DOS picoFlash User s Manual JK microsystems Specifications Power Supply 5 VDC 5 regulated 2W nominal Operating Temperature 20 to 85 C Humidity 5 90 non condensing Port A B C D Symbol Parameter MIN MAX Units Condition Vi Input Low 0 0 8 V Vis Input High 2 0 5 5 V VOL Output Low 0 4 V 5 8mA Vou Output High 2 4 V Io 4MA Mating Connectors Connector Mfg MFG P N Mfg MFG P N JK micro P N 2x5 Housing J2 J6 Molex 22 55 2101 Oupiin 4072 2X05H 28 0030 Pins Molex 16 02 0096 Oupiin 404 PIN 10K 28 0033 1x3 Housing Friction Lock J1 7 Molex 22 01 2031 Oupiin 4071 03H 28 0012 1x8 Housing Friction Lock J8 Molex 22 01 2081 Oupiin 4071 08H 28 0037 Pins Friction Lock Housings Molex 08 50 0114 Oupiin 4071 PIN T 28 0013 Mechanical Dimensions 3 75 x 2 50 x 0 65 95mm x 63 5mm x 16 5mm Weight 1 80z 51gm 0 65 0 14 4 3 75 A 09 U O00000
11. atchdog timer outport WDTCON 0x5555 outport WDTCON 0x3333 unlock the control register outport WDTCON OxCCCC outport WDTCON 0xC080 set timeout of 1 67 seconds Ethernet The Ethernet port is a 8 bit design that supports direct connection to a IOBASE T network jumperless configuration and NE2000 software compatibility The controller has a base address of 300h and processor interrupt 0 using full duplex twisted pair wiring supporting link detect The Ethernet controller requires a software driver to interface with network software or other programs The supplied packet driver PICOPKT com configures the chip interrupt base address and other necessary parameters To install the packet driver type B gt PICOPKT The driver will install using INT 0 I O base address 300h and will locate the MAC Media Access Control number stored in the on board configuration EEPROM Aceess to the driver will be through software interrupt 60h When the driver has loaded it will indicate the MAC number port address hardware and software interrupts B gt PICOPKT PicoFlash Ethernet Packet Driver v1 0 MAC 00 90 C2 40 13 C3 IO 300 Hwint 0 Swint 0x60 After the driver has been installed network software will be able to communicate with the Ethernet adapter and the network Users will probably want to modify their STARTUP BAT file to automaticallv load the packet driver The board has two LEDs that indicated the sta
12. d DCD control lines Serial 1 is wired as Data Communications Equipment DCE for direct connection to a computer or terminal This port is configured as a 3 wire RS 232 port implementing RxD and TxD The Serial Debug port does not make use of a hardware UART It is intended for console and debugging purposes only and should not be used in a design requiring high data throughput Its design generates an interrupt for each bit of serial data and puts a large load on the processor when data is being received The port speed is fixed at 9600 baud Driver functions are available for Serial 0 and Serial 1 in the cspp com TSR and related CSPDxxx LIBand h files located in the picoFlash drivers subdirectory on the utilities CD Please refer to the RDC R8822 data sheet for specific information on the serial ports and their configuration RS 485 Configuration The Serial 0 port of the picoFlash can be configured and used for RS 485 communications To configure Serial 0 as RS 485 move the jumper on JP1 to the 5 6 location RS 485 signals are present on J7 The RTS line on Serial 0 is used to control the RS 485 transmitter Library functions are available for use with RS 485 in the supplied driver The RS 485 driver is internally looped back Characters transmitted will appear in the UART receiver This condition is inerrant to the RS 485 implementation and may present user application implications 8 Hardware picoFlash User s Manual JK microsyst
13. e memory regions enabled for the onboard flash and the DIP socket are controlled by the Memory Map register located at I O port 607h The table below outlines the bits of the map register Memory Map Configuration Register I O Port 607 hex BITS 1 amp 0 Onboard Flash DIP Socket F0000h FFFFFh E0000h EFFFFh Table 1 Memory Map Configuration Register In I O space the CPLD ports are located between 600h and 607h the Ethernet controller is at 300h 30Fh R8822 configuration and control registers are located from FFOOh to FFFFh The PicoFlash uses Timer0 for the DOS timer tick and Timer2 as the timer tick prescaler Timer is available for user applications VO Configuration The R8822 internal peripherals UARTs counter timers and interrupt controller are not PC compatible nor are they located at their traditional I O port addresses For addressing and programming the peripherals specific to the R8822 please refer to the RDC R8822 Microcontroller User s Manual The manual is available in PDF format on the Development Kit CD or from our web site at http www jkmicro com documentation Digital VO Ports The picoFlash has a total of 16 bits of I O generated by a CPLD The board is also equipped with an LED that can be used as a status indicator Hardware 5 JK microsystems picoFlash User s Manual Ports A D 16 bits of I O are controlled by a CPLD The I O from the CPLD is grouped into 4 bit ports Each of the four
14. e files on the B drive are optional The only file in addition to your application and STARTUP BAT that may be needed in a production environment is the ethernet packet driver All of the remaining files are pre loaded in the hope that they will be useful development tools The files present on the B drive are archived on the development CD in the NIKmicro picoFlash Drive B Files directory The picoFlash has a hardware clock calendar The time and date can be set from the DOS prompt with the following commands B gt TIME 13 30 00 Sets the time to 1 30 pm B NSDATE 11 29 2003 Sets the date to November 29 2003 When power is applied to the picoFlash one of the first things the BIOS initialization code does is check for a CNTL C character received by either the Console serial port or the Debug serial port If this character is typed as soon as the board is powered up or reset a flag is set which overrides some of the initialization process When DOS runs its AUTOEXEC BAT file on drive A the state of the CNTL C flag is also checked and any user application set to run on drive B is not loaded This insures that a hung application or quiet console can always be interrupted When the console is on a hardware port Serial 0 or Serial 1 CNTL C character s should be sent to the port at the configured baudrate for the console If the console is on the Debug port CNTL C character s must be sent at 9600 baud 8 N 1 This method allows for conven
15. ed Items in italics are parameters Those in boldface italics must be entered those in are optional All switches are optional They are shown as X Spaces and punctuation are to be included An ellipsis following items means that you may repeat the items as often as needed Do not enter the ellipsis or the square brackets Most XDOS commands allow the use of wildcards in filenames and extensions When wildcards one character any character or characters are used the command is executed once for each matching file Common parameters are d path drive specification a letter followed by a colon e g A if no drive is specified the default drive is used the path DOS must take in traveling from one directory to another directory names are separated by a backslash filename up to 8 characters used to name a file ext a three character extension may be added to a filename an extension is separated from a filename by a period CD CHDIR Function Changes the current directory Format CD or CHDIR d path COPY Function Copies a file combines two or more files into one file Format COPY d path filename ext switches H d path filename ext switches d path ilename ext switches Switches V verify the contents of new file JA copy file in ASCII format B copy file in binary format DATE Function Displays or changes the current DOS date Format DATE mm dd yyyy DEL
16. ems Console Serial Port As shipped the default console port is Serial 1 at 9600 baud To allow maximum flexibility the console can be located on either of the 2 hardware serial ports at a number of baudrates or the Debug port When developing applications that require both hardware serial ports it may be helpful to move the console functions to the Debug Serial port The Debug port as described previously is implemented in software and has a fixed speed of 9600 baud To relocate the Console or change it s baudrate use the console com utility and specify the desired port and if applicable the baudrate After a power cycle or reset the BIOS will use the new console settings See the examples below B gt console 1 19200 Changes will take effect when board is rebooted or B gt console D Changes will take effect when board is rebooted To see a usage message do not specify any arguments B gt console PicoFlash Console Configuration V1 0 Usage console port baudrate Valid port s 01 D Valid baudrates 5 300 600 1200 1800 2400 4800 For Ports 7200 9600 19200 28800 38400 0 and 1 57600 76800 115200 153600 Baudrate for debug port is fixed at 9600 B gt Debug port signals are on J3 and require a special cable PN 86 0040 for connection to a PC data there is a high interrupt load Other drivers that use interrupts CSPD serial The debug serial port is intended only for use as a development tool While i
17. erwise specified the file is placed in the active directory of the current drive A write protect error will occur if UP tries to write to the read only A drive B gt up Upload file with X MODEM Protocol Usage up file Version 3 0 for JK microsystems 186 products B gt up test exe Ready start X modem upload now Press CNTL C to abort CECE B gt DOWN COM This utility facilitates downloading files from the picoFlash via the console port using the X MODEM transfer protocol The utility requires the user to supply the name of the file to transmit B gt down Download file with X MODEM Protocol Usage down file Version 3 0 for JK microsystems 186 products B gt down test exe Ready start X modem download now B gt 16 Utilities picoFlash User s Manual JK microsystems FORMAT COM If it becomes necessary to reformat the B drive FORMAT provides this function CAUTION all information on the drive will be lost during the formatting process B gt format picoFlash FLASH Drive Format Program Version 3 0 System will reboot after successful format Press 1 to initialize Drive B as 418 KB disk Press ESC to exit with no changes gt 1 Flash Drive is now formatted Rebooting system EDIT COM A simple line editor is included to allow quick creation and modification of batch files or other text files EDIT is similar to Microsoft s EDLIN provided in earlier versions of MS DOS It allows list
18. ience during development as well as a fail safe break method The most reliable method of breaking the boot process using CNTL C is to connect the console and start your communications program Press and hold CNTL C Then apply power to the controller Using this approach a stream of break characters will be received by the controller as it powers up The Debug port will always be checked for the break character If console functionality has been moved to the Debug port Serial 1 will not be checked for the break If the CNTL C flag is not set the AUTOEXEC file will attempt to transfer control to a file named STARTUP on drive B DOS also looks for and if present loads conFIc sys from drive B 4 Getting Started picoFlash User s Manual JK microsystems Hardware Memory Configuration The R8822 processor is configured in real mode with a physical address space of 1 megabyte The DRAM is located between 00000h and 7FFFFh the flash is between 80000h and FFFFFh A 32 pin DIP socket is provided for additional flash RAM or EPROM This memory can be accessed by reprogramming the chip select unit During the boot process the BIOS is copied from flash into the top of RAM The BIOS then executes out of RAM When a request for data on drive A or B is processed the flash is mapped into the top 512k of memory the drive access is performed then mapped out again If present the DiskOnChip occupies a 64k block of memory starting at segment E000h Th
19. igured with two disk drives A and B Drive A contains DOS the BIOS and utility programs essential to the operation of the picoFlash Drive A is read only Drive B is read write and contains optional utility programs and is available for user files and applications The default serial console port for the picoFlash is the Serial 1 port on the R8822 wired to J5 The port is configured for 9600 baud 8 data bits 1 stop bit and no parity This is the primary mode of communicating with the picoFlash DOS and the BIOS treat this port as the logical devices STDIN and STDOUT in place of a keyboard and monitor The console can be relocated to Serial 0 or the Debug port freeing up both hardware serial ports When the console is located on a hardware serial port the default baudrate can be also be changed Configuring the console port is described later in this manual When power is applied to the picoFlash or when it is reset the board goes through its initialization procedure and then starts DOS A simple read only AUTOEXEC BAT file is executed and then the board is ready to use The batch file performs several functions before the user is given control The DOS search path is set the DOS prompt is set the CNTL C flag discussed later in this manual is checked and finally an attempt is made to execute a file named STARTUP on the B drive This provides a convenient way for user applications to execute immediately after initialization of
20. insert delete and modify Upon exit a backup of the original file is created filename BAK and the edits are saved If a backup file with the same name already exists it is overwritten A list of commands and their usage is available by entering h at the edit prompt gt gt The name of the file to edit must be supplied following the command EDIT on the command line B gt edit test bat FlashLite Line Editor v1 0 Enter h for help New File test bat gt gt iz 0 echo Batch file being processed 1 mytsr 2 myapp 3 Z gt gt 1 0 echo Batch file being processed 1 mytsr gt 2 myapp gt gt q Save before exit Y n y File Saved B gt Utilities 17 JK microsystems picoFlash User s Manual DOS JK microsystems controllers use XDOS a compact operating system for embedded applications The XDOS command structure is nearly identical to MS PC DOS version 3 3 The switches for the DIR command have been changed and expanded XDOS does not support redirected input or output with the use of lt and gt but does support pipes None of the external DOS commands are available due to size constraints XDOS does not support installable file system functions XDOS Command Reference In the list below XDOS commands are followed by a function description and their format including available parameters and switches Items in boldface type must be entered Capitals or lowercase letters may be us
21. l storage devices Software development for the picoFlash is remarkably simple and quick Programs are written on a PC compatible computer in the language of your choice After your application has been compiled or assembled and linked into EXE or COM form it is uploaded to the picoFlash s flash disk with your favorite telecommunications program using the X Modem protocol The application can then be tested and debugged through the serial console When the application is running to your satisfaction the startup batch file can be modified so that the application will load and execute upon reset or powerup Features 40MHz RDC R8822 Processor x186 Compatible 5V regulated DC power 512k Bytes DRAM Memory 16 bit data path 512k Bytes Flash Memory 10 BASE T Ethernet NE2000 Compatible High Speed Serial Ports 2 115200 baud with RS 232 output levels 1 RS 232 Port with Handshake TxD RxD DCD RTS CTS GND Jumper Configurable as RS 232 TTL RS 232 or RS 485 1 RS 232 Port 3 wire Debug Serial Port 3 wire RS 232 9600 baud console only 16 Digital I O Lines Hardware Clock Calendar 2 16 bit timer channels Watchdog timer generates internal processor reset 32Pin Dip Socket to accept M Systems DiskOnChip Compact Size 3 75 x 2 5 95mm x 63 5mm 1 80z 51gm Driver Library C and Basic Serial ports PIO and alpha numeric LCD Overview 1 JK microsystems picoFlash User s Manual Operation The picoFlash is conf
22. le 4b Port A amp B Pinout Table 4c Debug amp PortC Pinout TxD out PULLUP TxD out Isle CTS in TTIE oo ef Table 4d Serial 0 Pinout Table 4e Serial 1 Pinout CONE ke ife po mr pepe 12 Hardware picoFlash User s Manual JK microsystems mock 5 6 r02 mars feos Table 4g RS 485 Pinout pa Pla Table 4f JTAG amp Port D Pinout Straight Through to Hub picoF lash Cross Over to PC Signal Name Laas 45 Pin Color 86 0018 Table 4h Ethernet Pinout Pin numbering on RJ45 cable plug To locate pin one of a connector look for the following identifiers Pin one has a square PCB pad and the others are round This should be visible on the bottom of the PCB Pin one will also be identified on the board silkscreen with a 1 and or a dot Dual row headers have ODD numbered pins on one side and EVEN numbered pins on the other The dual row header numbering scheme follows the numbering for an IDC style ribbon cable This may not be identical on connectors with discrete wires Use caution when connecting cables to the picoFlash Hardware 13 JK microsystems picoFlash User s Manual Software Supported PC BIOS Functions The picoFlash BIOS supports the following functions software interrupts common to PC compatible computers Please refer to a DOS PC reference for more information on DOS and BIOS software interrupts Int 10h Video Driver functions 9 and OEh Int 11h Get E
23. not I O space The Borland C functions inport port and outport port value are 16 bit word instructions inportb port and outportb port value are 8 bit byte instructions These functions are part of the dos h header file Similar functions and header files are available for other C compilers and languages The following code illustrates the use of inportb and outportb Hardware 7 JK microsystems picoFlash User s Manual unsigned char port port inportb PORT DIR get value of dir reg port PORT DIR MASK set dir bit for input outportb PORT DIR port write value to dir reg printf PORT 0x X n int inportb PORT read amp print port value other bit values be preserved You must read the 16 bit register modify the desired bit s When changing any bit value in the R8822 PIO registers it is essential that all of the and write the new value to the register Asynchronous Serial Ports The picoFlash has 2 serial ports Serial 0 and Serial 1 Both ports are internal to the R8822 These UARTs are not compatible with the 16450 UARTs on a PC The maximum data rate is 115k Baud at RS 232 levels Serial 0 is wired as Data Terminal Equipment DTE for connection to a peripheral such as a modem This port is jumper configurable to be either RS 232 TTL level RS 232 RxD TxD or half duplex RS 485 When configured to use RS 232 levels this is port implements the RTS CTS handshaking an
24. ports may be configured as either inputs or outputs The following tables show the port registers addresses and configuration bits Register Address 600h Port A 601h Port B 602h Port C 603h RESERVED 604h Port D 605h Clock Calendar 606h I O Config Register I O Configuration Register READ WRITE I O Port 606 hex Bit is Clear eN Enable 1 0 0 yy Port C on default Clock Port D bit 2 Port D bit 3 Access J3 Enable Connect Bit i Set m p h RESERVED J6 8 to i CPU INT2 Access Table 2 I O Configuration Register Ports A through D each have a single data register that is read write Data read from the port represents the current state of the port data written to the port will be present on the port pins 1f the port is configured as an output Each port may be configured as either an input or an output Write a 0 to the appropriate bit in the direction register to configure the port as an input write a 1 to configure it as an output All ports default to inputs tolerant care must be taken to avoid exceeding the current specifications for the device The CPLD is a low power device that operates from 3 3 Volts Although the inputs are 5V Shorting an input to 5V will damage the CPLD LED the LED at location DS1 is controlled by bit 10 of the PDATA 1 register at OFF7Ah Set the bit to turn the LED off Clear the bit to turn the LED on Driving Loads with the VO Ports The ports on the picoFlash are capable
25. quipment Configuration Int 12h Get Memory Size Int 13h Disk Driver Functions 0 4 Int 14h Serial Port Driver Functions 0 3 Int 16h Keyboard Driver Functions 0 and 1 Int 19h Boot System Int 1Ch Hook Timer Tick Interrupt Driver Library Drivers for the hardware serial ports and alphanumeric LCDs are supplied on the utilities CD in the picoFlash Drivers subdirectory For implementation details see the README TXT files and the driver source code for the respective drivers Programming Languages The picoFlash can be programmed in the language of your choice as long as the compiler will generate 16 bit DOS executables exe or com A tutorial for getting started with the Borland 4 52 IDE is available on the development CD see QuickStart htm1 or from our website http www jkmicro com documentation The WatTCP networking libraries are written in C and compiled with Borland 4 52 If you wish to use a different version of Borland C the libraries will need to be regenerated using that compiler linker library manager 14 Software picoFlash User s Manual JK microsystems QuickBASIC PowerBASIC Console I O Some of the code produced by Microsoft QuickBASIC compiler does not execute properly on the picoFlash In the case of console I O we believe that QuickBASIC is generating code for specific hardware and software not present on the picoFlash There are two problems with console I O The first is that a PRINT statemen
26. quiring fail safe performance such as in the operation of nuclear facilities aircraft navigation or communication systems air traffic control direct life support machines or weapons systems in which the failure of our hardware or software could lead directly to death personal injury or severe physical or environmental damage 11 Limited Warranty picoFlash User s Manual JK microsystems Table of Contents Limited Warranty Sis cau he a anes Sic Sula AA hk Se hci hd Si tel catia Sark Selle Seth neat d il Tabl e of COMES NN acl eee oe aa iii Mb BG l AA 1 A DOMT S 1 Operations o a e a de a o dd MENT 2 Getting Stalted ax O 3 NN AN PAO AA 5 Memory Config ration a 5 O Configuration di de une AN tel nt nat a EN 5 O a E E a ie E EREE 5 Table 1 Memory Map Configuration Register a AA aladas 5 Driving Loads with the I O Ports ia te a a 6 Table 2 I O Configuration Register ad 6 Programming th VO Pots ns NA 7 Asynchronous Seral Ports A id 8 RS 485 Configuratio ses AA NANANA a a gis 8 Console Serial AA 9 Watchdog a 9 l ja A MET OP RA 10 Table 3 Watchdog timeout Configuration ss seessennenenzzonninzenzzaneznmazzentinnzzazzranazzaa 11 DI e a NGA AA 11 Md es ad aa 11 JP1 Serial Port 0 Select RS 485 Terminati0N cccccnnnnonanonenininnnanananononoccnnonnananinaninic ns 11 JP2 Socket Memory Type Boot Memory Location ss eennennenenznnnnzznnnzznnenanzna 12 Cables and COMAS o e a e 12 Table 4as
27. t is receiving Ethernet etc may cause disruptions with or be disrupted by the debug port Watchdog Timer The R8822 is equipped with a watchdog timer that can be configured to generate either an NMI or a processor reset When enabled software must keep the watchdog from timing out indicating proper operation If the watchdog timer expires the configured action will be taken The watchdog signal is not available external to the R8822 so a full board reset is not possible The watchdog control register is a word located at FFE6h To Initialize the watchdog first reset the counter register by writing two words to the configuration register Write an AAAAh followed by a 5555h to the control register Next unlock the register by writing a 3333h followed by a CCCCh to the control register Finally write the enable command to the watchdog configuration register The enable command is one word with the high byte of COh enable watchdog to generate system reset and a low byte from the table below that represents the Hardware 9 JK microsystems picoFlash User s Manual oto Jo Joas oro E CC Table 3 Watchdog timeout configuration timeout interval Software will then periodically reset the timer by writing two words to the configuration register AAAAh followed by 5555h More details are available in the RDC R8822 Users Manual Watchdog Configuration Example define WDTCON OxFFE6 outport WDTCON OxAAAA reset the w
28. t will not send output to the console port To output text to the console open cons as a file and print to it The second problem is that an INPUT statement will not echo the data entered by the user Workarounds for both of these problems can be found in the program BAS INP BAS on the utilities CD Example subdirectory and shown here start OPEN o 1 cons PRINT 1 PRINT 1 Quickbasic PowerBasic Input Program PRINT 1 Enter a string gt MG GOSUB linein InputStrings lineins PRINT 1 InputString PRINT 1 Enter a numeric value gt GOSUB linein InputNumber VAL linein PRINT 1 InputNumber CLOSE 1 END linein lineins linemore as INKEYS IF aS THEN GOTO linemore IF as CHR 13 THEN GOTO linedone IF as lt gt CHRS 8 THEN GOTO getchar PRINT 1 CHRS 8 CHRS 32 CHRS 8 lineins left lineins len lineins 1 GOTO linemore getchar PRINT 1 a lineins lineins as GOTO linemore linedone PRINT 1 RETURN Software 15 JK microsystems picoFlash User s Manual Utilities The picoFlash comes preloaded with several utilities to aid system development These utilities are located on drive A of the picoFlash and or the development CD UP COM This utility facilitates uploading files to the picoFlash via the console port using the X MODEM transfer protocol The utility requires the user to supply the name of the incoming file Unless oth
29. the picoFlash If you wish to have your application start automatically create a batch file named STARTUP BAT that invokes the program Renaming your application STARTUP EXE Or STARTUP COM is not recommended If this is done and the program locks up typing CNTL C at bootup may not break the program and exit to the DOS prompt cycles it is possible for an application to quickly wear them out The flash memory is intended to store programs and setup data which is normally not changed Avoid storing data or frequently changed information on the flash disk Although the flash memory devices used have a guaranteed lifetime of over 10 000 write To reduce the possibility of an unexpected powerdown corrupting the flash disk it is strongly recommended that flash file writes be done as quickly as possible After the file write close the file and issue a Disk Reset Int 21h function 0Dh For more information see the Application Note on Flash Disk Reliability http www jkmicro com documentation app_notes 6 a 2 Operation picoFlash User s Manual JK microsystems Getting Started To begin development with the picoFlash you will need a PC compatible computer with a telecommunications program and a free serial port Connect the picoFlash s Debug Console Port to the PC s serial port with a 9 pin serial cable straight through wiring Run the telecommunications program and configure the serial port for 9600 baud 8 data bits 1 stop bit
30. tus of the Ethernet link The LNK LED indicates the status of the Ethernet When illuminated the picoFlash is receiving the Ethernet heartbeat and is connected to a live network If this LED is not illuminated there is a problem with the Ethernet wiring or the network The ACT LED indicates activitv on the network The LED will flash when a data packet is received or transmitted 10 Hardware picoFlash User s Manual JK microsystems DiskOnChip M Systems DiskOnChip is a high performance single chip Flash Disk The DiskOnChip has become the standard Flash Disk module for Embedded Single Board Computers The DiskOnChip is a Flash Disk in a standard 32 pin DIP package that has built in TrueFFS True Flash File System technology allowing full read write disk emulation The picoFlash currently supports the 8Meg Millennium DiskOnChip MD2800 D08 with version 4 2 or earlier firmware Other DiskOnChip capacities will function if they are loaded with the correct firmware however M Systems will not guarantee that the older firmware will continue to be supported on parts other than the MD2800 Install the DiskOnChip module in the memory expansion socket U6 Note the location of pin 1 Set the Memory Type jumpers JP2 for Flash memory If the DiskOnChip is installed and functioning there will be an installation message that is displayed during the boot process and a C drive will be available to DOS picoFlash Bios Version 1 0 DOC Socket Ser
31. ult position 1 2 amp 3 4 RS 485 termination enabled 9 10 RS 232 Levels on J4 NOTE Only 1 jumper may be installed on JP1 pins 5 10 Hardware 11 JK microsystems picoFlash User s Manual JP2 Socket Memory Type Boot Memory Location This jumper selects the type of memory in the expansion socket Available choices are SRAM or Flash Other memory types may be supported if their pinout is compatible with standard SRAM or Flash chips Jumper pins 1 2 and 3 4 for SRAM or pins 1 3 and 2 4 for Flash This jumper also allows the board to boot from the expansion socket This is useful when performing field updates of the on board Flash memory or when using an operating system other than DOS Jumper pins 5 7 and 6 8 to boot from the on board memory or jumper pins 7 9 and 8 10 to boot from the expansion socket Default position 1 3 and 2 4 Flash memory expansion 5 7 and 6 8 Boot from on board flash Cables and Connectors The following tables show the signal name direction for each connector pin NOTE N C indicates no connection and PULLUP indicates a 1k ohm pullup resistor to Vec Outputs are driven by the board and received by a peripheral Inputs are driven by a peripheral and received by the board Serial 0 is configured as a DTE port and is generally used to communicate with a peripheral device Serial 1 is configured as a DCE port generally being used to connect the picoFlash to another computer Debug amp Port C Tab
32. vices Version 0 2 C Copyright 1992 1996 M Systems Ltd TrueFFS BIOS Version 3 3 9 for DiskOnChip 2000 V4 2 Copyright C M Systems 1992 2000 DOS Version 3 3e for JK microsystems Products C HBS Corp and JK microsystems 1991 2002 B gt If after the installation of a DiskOnChip DOS fails to return a prompt the DiskOnChip probably has incompatible firmware and must be reformatted and it s firmware reloaded Remove the DiskOnChip reboot the board and upload the file Doc EXE from the utilities CD Power down the board reinstall the DiskOnChip and apply power while holding CNTL C down Find the file Doc EXE and execute it It will extract 3 files Execute the batch file FMT Doc BAT and answer the prompts This will format your DiskOnChip and load compatible firmware You may delete the 3 files after the operation is complete Jumpers JP1 Serial Port 0 Select RS 485 Termination This jumper selects the drivers and header that will be used for the Serial 0 signals and enables or disables the RS 485 termination and biasing resistors RS 485 termination is controlled by the jumpers on pins 1 2 and 3 4 Install the jumpers to terminate the RS 485 signals and bias them to the space state Serial 0 can be jumpered as half duplex RS 485 TTL RS 232 Rx and Tx or RS 232 Rx Tx RTS CTS DCD Install the jumper at location 5 6 for RS 485 signals on J7 7 8 for TTL RS 232 signals on J3 or 9 10 for RS 232 signals on J4 Defa
Download Pdf Manuals
Related Search
Related Contents
Smeg MDQ5-CR faucet M-7002 User Manual JT0ー3ー5 オイルバンシールカッター取扱説明書 取扱説明書 - オットーボックジャパン Stretching/shrinking selected portions of a signal Printer-friendly Version Descargar manual Copyright © All rights reserved.
Failed to retrieve file