README.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. README.txt
  2. ==========
  3. Z20X is a simple expandable DIY computing system, built around the eZ80
  4. microprocessor. The eZ80 was chosen due to its native simplicity and full
  5. backward code compatibility with the great and very popular Z80 and Z180.
  6. The design goal of Z20X is to offer a good DIY/LIY (Do-It-Yourself/Learn-
  7. It-Yourself) kit for system built with through-hole components, simple
  8. enough for assembly and learning in deep details, but without the
  9. constraints of using only old technology ICs. In order to maintain full
  10. exposure to technical details, the system also avoids using secondary
  11. MCUs or programmable logic, and sticks only with true hardware solutions.
  12. System Summary
  13. eZ80 running at 20 MHz (default on board)
  14. 128 KB flash ROM (internal for eZ80)
  15. 520 KB total RAM on board (512K external plus 8K internal)
  16. 4 MB non-volatile storage (optional, can be upgraded by changing the IC)
  17. Real-time clock
  18. SSD1963-powered 7.0 inch TFT display with resolution 800 x 480 pixels
  19. and touch panel
  20. SD card slot
  21. YM2413 programmable sound generator with amplifier
  22. PS/2 connectors for industry standard keyboard and mouse
  23. Additionally installable processor modules
  24. 72-pin expansion header with Z20X bus
  25. Optional expander board with Z20X bus sockets and bonus support for
  26. RC2014 bus
  27. Contents
  28. ========
  29. o ZDS-II Compiler Versions
  30. o Environments
  31. o Memory Constaints
  32. o Serial Console
  33. o LEDs and Buttons
  34. - LEDs
  35. - Buttons
  36. o Configurations
  37. - Common Configuration Notes
  38. - Configuration Subdirectories
  39. ZDS-II Compiler Versions
  40. ========================
  41. Version 5.3.3
  42. As of this writing, this is the latest version available. This is the
  43. default configured for all ez80 boards.
  44. Compilation using version 5.3.3 was verified on February 20, 2020.
  45. Version 5.3.0
  46. Compilation using version 5.3.0 was verified on February 19, 2020.
  47. Other Versions
  48. If you use any version of ZDS-II other than 5.3.0/3 or if you install ZDS-II
  49. at any location other than the default location, you will have to modify
  50. three files: (1) arch/arm/z80/src/ez80/Kconfig, (2)
  51. boards/z80/ez80/z20x/scripts/Make.defs and, perhaps, (3)
  52. arch/z80/src/ez80/Toolchain.defs.
  53. Environments
  54. ============
  55. Cygwin:
  56. All testing was done using the Cygwin environment under Windows.
  57. MinGW/MSYS
  58. One attempt was made using the MSYS2 environment under Windws. That build
  59. correctly until the very end, then it failed to include "chip.h". this
  60. was traced to arch/z80/src/Makefile.zdsiil: The usrinc paths created by
  61. Makefile.zdsiil contained POSIX-style paths that were not usable to the
  62. ZDS-II compiler.
  63. Native
  64. The Windows native build has not been attempt. I would expect that it
  65. would have numerous problems.
  66. Memory Constaints
  67. =================
  68. The eZ80F92 has a smaller FLASH memory of 128Kb. That combined with the
  69. fact that the size of NuttX is increasing means that it is very easy to
  70. exceed the ROM address space.
  71. The sdboot configuration will fit into the ROM address space, but NOT if
  72. you enable assertions, debug outputs, or even debug symbols.
  73. Serial Console
  74. ==============
  75. The eZ80 has two UART peripherals:
  76. UART 0: All of Port D pins can support UART0 functions when configured
  77. for the alternate function 7. For typical configurations only RXD and TXD
  78. need be configured.
  79. eZ80 PIN
  80. ===============
  81. PD0/TXD0/IR_IXD
  82. PD1/RXD0/IR_RXD
  83. PD2/RTS0
  84. PD3/CTS0
  85. PD4/DTR0
  86. PD5/DSR0
  87. PD6/DCD0
  88. PD7/RIO0
  89. PD0 and PD1 connect to the PS/2 keyboard connector.
  90. UART 1: All of Port C pins can support UART1 functions when configured
  91. for the alternate function 7. For typical configurations only RXD and TXD
  92. need be configured.
  93. eZ80 PIN
  94. ========
  95. PC0/TXD1
  96. PC1/RXD1
  97. PC2/RTS1
  98. PC3/CTS1
  99. PC4/DTR1
  100. PC5/DSR1
  101. PC6/DCD1
  102. PC7/RIO1
  103. PC0 and PC1 connect both to the MCP2221 UART-to-USB converter and also to
  104. the PS/2 mouse connector.
  105. UART1 is the default serial console in all configurations unless
  106. otherwise noted in the description of the configuration.
  107. LEDs and Buttons
  108. ================
  109. There are no on-board user LEDs or buttons.
  110. Configurations
  111. ==============
  112. Common Configuration Notes
  113. --------------------------
  114. 1. src/ and include/
  115. These directories contain common logic for all z20x
  116. configurations.
  117. 2. Variations on the basic z20x configuration are maintained
  118. in subdirectories. To configure any specific configuration, do the
  119. following steps:
  120. tools/configure.sh [OPTIONS] z20x:<sub-directory>
  121. make
  122. Where <sub-directory> is the specific board configuration that you
  123. wish to build. Use 'tools/configure.sh -h' to see the possible
  124. options. Typical options are:
  125. -l Configure for a Linux host
  126. -c Configure for a Windows Cygwin host
  127. -g Configure for a Windows MYS2 host
  128. Use configure.bat instead of configure.sh if you are building in a
  129. native Windows environment.
  130. The available board-specific configurations are summarized in the
  131. following paragraphs.
  132. When the build completes successfully, you will find this files in
  133. the top level nuttx directory:
  134. a. nuttx.hex - A loadable file in Intel HEX format
  135. b. nuttx.lod - A loadable file in ZDS-II binary format
  136. c. nuttx.map - A linker map file
  137. 3. ZDS-II make be used to write the nuttx.lod file to FLASH. General
  138. instructions:
  139. a. Start ZDS-II
  140. b. Open the project, for example, nsh/nsh.zdsproj
  141. c. Select Debug->Connect To Target
  142. d. Select Debug->Download code
  143. There are projects for the ZiLOG Smart Flash Programmer as well but
  144. these are not functional as of this writing.
  145. 4. This configuration uses the mconf-based configuration tool. To
  146. change this configurations using that tool, you should:
  147. a. Build and install the kconfig-mconf tool. See nuttx/README.txt
  148. see additional README.txt files in the NuttX tools repository.
  149. b. Execute 'make menuconfig' in nuttx/ in order to start the
  150. reconfiguration process.
  151. Configuration Subdirectories
  152. ----------------------------
  153. hello:
  154. This is a minimal "Hello, World!" program that runs out of RAM. It is
  155. a small program that is really useful only for testing the bootloader.
  156. NOTES:
  157. 1. Debugging from RAM
  158. You can debug from RAM version using ZDS-II as follows:
  159. a. Connect to the debugger,
  160. b. Reset, Go, and Break. This will initialize the external RAM
  161. c. Break and Load the nuttx.lod file
  162. c. Set the PC to 0x050000
  163. d. Single step a few times to make sure things look good, then
  164. e. Go
  165. nsh:
  166. This configuration builds the NuttShell (NSH). That code can be
  167. found in apps/system/nsh and apps/system/nshlib.. For more
  168. information see: apps/system/nsh/README.txt and
  169. Documentation/NuttShell.html.
  170. To be usable, this configuration should: (1) Use the same BAUD
  171. as the bootloader and (2) switch from the MMC/SD card to the second
  172. partition in the W25 part.
  173. NOTES:
  174. 1. This configuration builds for execution entirely from RAM. A
  175. bootloader of some kind is required to support such execution from
  176. RAM! This is reflected in a single configuration setting:
  177. CONFIG_BOOT_RUNFROMEXTSRAM=y # Execute from external SRAM
  178. Why execute from SRAM? Because you will get MUCH better performance
  179. because of the zero wait state SRAM implementation and you will not
  180. be constrained by the eZ80F92's small FLASH size.
  181. 2. The eZ80 RTC, the procFS file system, and SD card support in included.
  182. The procFS file system will be auto-mounted at /proc when the board
  183. boots.
  184. The RTC can be read and set from the NSH date command.
  185. nsh> date
  186. Thu, Dec 19 20:53:29 2086
  187. nsh> help date
  188. date usage: date [-s "MMM DD HH:MM:SS YYYY"]
  189. nsh> date -s "Jun 16 15:09:00 2019"
  190. nsh> date
  191. Sun, Jun 16 15:09:01 2019
  192. When the system boots, it will probe the SD card and create a
  193. block driver called mmcsd0:
  194. nsh> ls /dev
  195. /dev:
  196. console
  197. mmcsd0
  198. null
  199. ttyS0
  200. nsh> mount
  201. /proc type procfs
  202. The SD card can be mounted with the following NSH mount command:
  203. nsh> mount -t vfat /dev/mmcsd0 /mnt/sdcard
  204. nsh> ls /mnt
  205. /mnt:
  206. sdcard/
  207. nsh> mount
  208. /mnt/sdcard type vfat
  209. /proc type procfs
  210. nsh> ls -lR /mnt/sdcard
  211. /mnt/sdcard:
  212. drw-rw-rw- 0 System Volume Information/
  213. /mnt/sdcard/System Volume Information:
  214. -rw-rw-rw- 76 IndexerVolumeGuid
  215. -rw-rw-rw- 12 WPSettings.dat
  216. You can they use the SD card as any other file system.
  217. nsh> ls /mnt/sdcard
  218. /mnt/sdcard:
  219. System Volume Information/
  220. nsh> echo "This is a test" >/mnt/sdcard/atest.txt
  221. nsh> ls /mnt/sdcard
  222. /mnt/sdcard:
  223. System Volume Information/
  224. atest.txt
  225. nsh> cat /mnt/sdcard/atest.txt
  226. This is a test
  227. Don't forget to un-mount the volume before power cycling:
  228. nsh> mount
  229. /mnt/sdcard type vfat
  230. /proc type procfs
  231. nsh> umount /mnt/sdcard
  232. nsh> mount
  233. /proc type procfs
  234. NOTE: The is no card detect signal so the microSD card must be
  235. placed in the card slot before the system is started.
  236. 3. Debugging from RAM
  237. You can debug from RAM version using ZDS-II as follows:
  238. a. Connect to the debugger,
  239. b. Reset, Go, and Break. This will initialize the external RAM
  240. c. Break and Load the nuttx.lod file
  241. c. Set the PC to 0x050000
  242. d. Single step a few times to make sure things look good, then
  243. e. Go
  244. 4. Optimizations:
  245. - The stack sizes have not been tuned and, hence, are probably too
  246. large.
  247. w25boot
  248. This configuration implements a very simple boot loader. In runs from
  249. FLASH and simply initializes the external SRAM, mounts the W25 FLASH
  250. and checks to see if there is a valid binary image at the beginning of
  251. FLASH. If so, it will load the binary into RAM, verify it and jump to
  252. 0x50000. This, of course, assumes that the application's entry point
  253. vector resides at address 0x050000 in external SRAM.
  254. The boot loader source is located at boards/z20x/src/w25_main.c.
  255. When starting, you may see one of two things, depending upon whether or
  256. not there is a valid, bootable image in the W25 FLASH partition:
  257. 1. If there is a bootable image in FLASH, you should see something like:
  258. Verifying 203125 bytes in the W25 Serial FLASH
  259. Successfully verified 203125 bytes in the W25 Serial FLASH
  260. [L]oad [B]oot
  261. .........
  262. The program will wait up to 5 seconds for you to provide a response:
  263. B to load the program program from the W25 and start it, or L to
  264. download a new program from serial and write it to FLASH.
  265. If nothing is pressed in within the 5 second delay, the program will
  266. continue to boot the program just as though B were pressed.
  267. If L is pressed, then you should see the same dialog as for the case
  268. where there is no valid binary image in FLASH.
  269. 2. If there is no valid program in FLASH (or if L is pressed), you will
  270. be asked to :
  271. Send HEX file now.
  272. NOTES:
  273. 1. A large UART1 Rx buffer (4Kb), a slow UART1 BAUD (2400), and a very
  274. low Rx FIFO trigger are used to avoid serial data overruns. Running
  275. at only 20MHz, the eZ80F92 is unable to process 115200 BAUD Intel Hex
  276. at speed. It is likely that a usable BAUD higher than 2400 could be
  277. found through experimentation; it could also be possible to implement
  278. some software handshake to protect the eZ80f92 from overrun (the
  279. eZ80F92 does not support hardware flow control)
  280. At 2400 BAUD the download takes a considerable amount of time but
  281. seems to be reliable
  282. Massive data loss occurs due to overruns at 115200 BAUD. I have
  283. tried the bootloader at 9600 with maybe 30-40% data loss, too much
  284. data loss to be usable. At 9600 baud, the Rx data overrun appears
  285. to be in the Rx FIFO; the data loss symptom is small sequences of
  286. around 8-10 bytes often missing in the data. Apparently, the Rx FIFO
  287. overflows before the poor little eZ80F92 can service the Rx
  288. interrupt and clear the FIFO.
  289. The Rx FIFO trigger is set at 1 so that the ez80F92 will respond as
  290. quickly to receipt of Rx data is possible and clear out the Rx FIFO.
  291. The Rx FIFO trigger level is a trade-off be fast responsiveness and
  292. reduced chance of Rx FIFO overrun (low) versus reduced Rx interrupt
  293. overhead (high).
  294. Things worth trying: 4800 BAUD, smaller Rx buffer, large Rx FIFO
  295. trigger level.
  296. 2. Booting large programs from the serial FLASH is unbearably slow;
  297. you will think that the system is simply not booting at all. There
  298. is probably some bug contributing to this probably (maybe the timer
  299. interrupt rate?)