Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser

Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])

<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]

Also see [[AdvancedOptions]]
<div class='header' role='banner' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
<div id='mainMenu' role='navigation' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' role='navigation' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' role='complementary' refresh='content' force='true' tiddler='SideBarTabs'></div>
<div id='displayArea' role='main'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected {color:[[ColorPalette::PrimaryDark]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:alpha(opacity=60);}
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0; top:0;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0 3px 0 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0; padding-bottom:0;}

.fieldsetFix {border:0; padding:0; margin:1px 0px;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox where print preview displays the noscript content */
<div class='toolbar' role='navigation' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
Spartan3 chips use 3.3V logic.  Please do not connect 5V devices to any CHOCHI ports directly.

It should be possible to interface to TTL 5V logic.  CMOS logic specifies 3.8V for high signal (although the threshold voltage is 2.5V), so it may or may not work.  Spartan3 devices include a clamping diode internally so adding a 390 ohm current-limiting resistor in series (between the CHOCHI pin and your logic) should work.
<<tiddler IO_BASE>>
 LED                equ IO_BASE
<<tiddler UART_BASE>>
 UART_BASE          equ IO_BASE+8
 UART_DATA          equ UART_BASE
CHOCHI loader expects a 4-byte header preceding the binary file.  The header is:
 SIZE LOW (not including the header)
In assembly, the simplest way to do this is to place something like this surrounding your code:
  org START-4
  dw START
  Hardware: Arlet's 6502 45MHz core with 8bit in, 8bit out, led, uart<BR>
  Software: Loader (LED flashes while waiting) in page 0
- Loader is in page 0 upon startup.  This allows 'rom-like' images to be loaded at the top.
- Address decoding has been cleaned up.  BRAM is mapped to top 2 pages and bottom 2 pages, there is no 'shadowing' of pages 0 and 1 (that created problems)
!![[MemoryMap - 6502_45_003]]
<<tiddler [[MemoryMap - 6502_45_003]]>>
[[Source and build environment|bitstream/]]
A complete build environment with Makefile to create CHOCHI bitstream
!![[MemoryMap - 6502_45_003]] (unchanged for 004)
<<tiddler [[MemoryMap - 6502_45_003]]>>
  Hardware: Arlet's 6502 40MHz core with 8bit in, 8bit out, led, uart, 4 IO ports<BR>
  Software: Loader 
!![[MemoryMap - 6502_45_002]]
<<tiddler [[MemoryMap - CHOCHI_K_6502_1]]>>
|Nov 23, 2015 |<<slider chkSlider [[Bitstream CHOCHI_K_6502_1]] "CHOCHI K bitstream" "Click here to read more">> |
|Oct 10, 2013 |<<slider chkSlider [[Bitstream 6502_45_004]] 6502_45_004 "Click here to read more">> |
|Sep 18, 2013 |<<slider chkSlider [[Bitstream 6502_45_003]] 6502_45_003 "Click here to read more">> |
|Aug. 27, 2013 |<<slider chkSlider [[Bitstream 6502_45_002]] 6502_45_002 "Click here to read more">> |
A complete build environment is available for version 004 and above.
<<tiddler [[CHOCHI diagram]]>> Actually, K is the newest board revision...

@@CHOCHI is an experimental """XC3S50""" FPGA board with 128K of fast SRAM and 28 IO pins pre-configured as a 6502 computer.@@

- preconfigured 40MHz 6502 computer
- program it in 6502 assembler, BASIC, Forth or C
- fit 4 Picoblaze cores
- use as a generic FPGA board for any purpose
- use the JTAG port to update 
- or make your own FPGA designs 

CHOCHI powers up as a self-contained 6502 system.  Using the built-in bootloader you can start Forth, BASIC or run your own 6502 software via the serial port.  You can also use the JTAG port to reconfigure the FPGA with your own bitstream.

@@Prototypes are available.  Disclaimer: CHOCHI is an experimental project, and no warranties of any kind are offered on the prototypes.  CHOCHI boards are for entertainment purposes only.  Please email if you need more information@@

To use the CHOCHI you will need at least a """mini-USB""" cable for power, and a 3.3V serial connection.  You may use your own or buy one here or elsewhere (EBay, Amazon, etc).  If you plan to use IO ports, you will need to populate the IO connectors in a way that makes sense to you (male, female, etc.).  Some connectors are available below (or use your own)

<<slider chkSlider Motivation Motivation "Click here to
<<slider chkSlider MinimumRequirements MinimumRequirements "Click here to
<<slider chkSlider SkillLevel SkillLevel "Click here to

The SD Port is a simple interface designed for bit-banging SPI.  If desired, connect the port using jumpers or wire-wrap
![[CHOCHI F SD Port Registers]]
Supported by Bitstream 6502_45_005
<<tiddler [[CHOCHI F SD Port Registers]]>>
|>|>| !SD Port Registers |
|!Register |!Address |!Notes |
|"""SD_MISO"""|"""SD_BASE+0""" |Read-only, bit 0|
|"""SD_CLK"""|"""SD_BASE+1""" |Write-only|
|"""SD_SEL"""|"""SD_BASE+2""" |Write-only|
|"""SD_MOSI"""|"""SD_BASE+3""" |Write-only, bit 7|
CHOCHI H bitstream has support for an 8-bit output port connected to PMOD1 mapped to $C010 and an 8-bit input port on PMOD2 mapped to PMOD2 at $C018.  PORT_BASE is $C010.  [>img[pix/CHOCHI_H_bottom.jpg]]

|>|>| !Parallel Port Registers |
|!Register |!Address |!Notes |
|"""PORTA"""|PORT_BASE+0 |Write-only, PMOD1|
|"""PORTB"""|PORT_BASE+8 |Read-only, PMOD2|

|>| !Parallel Output Port  on PMOD1|

|>| !Parallel Input Port  on PMOD2|

CHOCHI J bitstream has support for 4 bidirectional parallel ports:

|>|>| !Parallel Port Registers |
|!Register |!Address |!Notes |
|"""PMOD1"""|PORT_BASE+0 | Bidirectional 8 bit |
|"""PMOD2"""|PORT_BASE+8 | Bidirectional 8 bit |
|"""PMOD3"""|PORT_BASE+16 | Bidirectional 4 bit |
|"""PMOD4"""|PORT_BASE+24 | Bidirectional 3 bit |

The ports names are correct on the front of the board; on the back silkscreen, the port marked PMOD4 is actually PMOD3

|>|>|>|>| !FPGA Pin Connections |
| 7| P53| P72| -| -|
| 6| P55| P79| -| -|
| 5| P60| P80| -| -|
| 4| P62| P85| -| -|
| 3| P54| P71| P86| -|
| 2| P59| P74| P87| P97|
| 1| P61| P75| P88| P96|
| 0| P63| P81| P89| P92|

| !Address | !Register | !Description |
| PORT+0 | DATA | Write for output, read pin values |
| PORT+1 | DIR | For each bit, 0 means input and 1 means output |

For example, CHOCHI J PMOD1_DATA is at $C008 and PMOD1_DIR is $C009.
The latest model: CHOCHI J
Please email:

enso  at  (substitute @ for '  at  ')

I am also active on the 6502 forums, especially 'Programmable Logic' at [[|]]
This is a brief guide to writing code for the 6502 CHOCHI boards.

Familiarize yourself with the <<slider chkSlider MemoryMap [[Memory Map]] "Click here to read more">> and the IO registers.

Download one or more relevant examples from the  <<slider chkSlider Software [[Software]] "Click here to read more">> page.  Use [[Kingswood assembler|]] to generate binaries.  CHOCHI examples come with a simple Makefile.

Use the <<slider chkSlider AssemblerConstants [[Assembler Constants]] "Click here to read more">> and don't forget the <<slider chkSlider BinaryHeader [[Binary Header]] "Click here to read more">>

!!!Why such a small FPGA?
Mainly bottomfishing to keep down the costs.  The XC3S50 is small, but it is large enough to contain an entire 6502 computer with more than half the resourses still available.
!!!How fast is it?  Is 60MHz the maximul speed?
CHOCHI has an on-board 60MHz crystal oscillator, but the FPGA can synthesize other frequencies.  Current bitstreams create a 45MHz 6502 system, but using only internal FPGA memory (8K) the 6502 can operate at 100MHz.  The FPGA is the faster Speed Grade 5 model.
The CHOCHI board comes pre-configured as a 6502 system.  
This entry assumes that you have an [[up-to-date revision of the firmware |Bitstreams]].  Update your system if it's not up-to-date.
!!! [[Initial Test Procedure]]
<<tiddler [[Initial Test Procedure]]>>
!!! [[Initial Serial Port Connection]]
<<tiddler [[Initial Serial Port Connection]]>>
 IO_BASE            equ $C000
1) Attach a 3.3V-capable USB-serial connection to your PC and open a terminal, such as GTKterm. Configure the terminal for 115200 baud, 1 stop bits (sometimes 2 is better), no parity, no handshake. Verify that the host serial connection is up by shorting the rx/tx pins on the USB-serial card: typing anything should echo to the terminal.

2) Disconnect power. Connect CHOCHI to the serial board. Usually you will have to connect CHOCHI's rx to the USB-Serial board's tx and vice versa. Now connect power again. The LED should flash and the terminal should display "6502". The binary loader is now waiting for 6502 code upload.

3) Get some 6502 binaries [[here|Software]]. Upload a binary to CHOCHI; use Fig FORTH for example. Use your terminal's 'send binary file' or 'send raw file' command, or send it any other way that makes sense.  On Linux, you can even
cp fig6502.bin /dev/ttyUSB0
In the case of FIG-FORTH, you should see a prompt (hit <ENTER> to continue).
Connect __regulated__ 3.3V power to the power pins.  The 6502 system should start up and the LED should flash.  A flashing LED indicates that the 6502 is running (the flashing is done in the loader software.
 [[Developing Code]]  
!![[MemoryMap - 6502_45_003]]
<<tiddler [[MemoryMap - 6502_45_003]]>>
|>|>|bgcolor(lightgreen): Memory Map |
|!Start|!End|!Used as|
|"""$FE00"""|$FFFF|BRAM, upon bootup contains vectors and loader|

|>|>|bgcolor(lightgreen): Memory Map |
|!Start|!End|!Used as|
|$0000|$03FF|BRAM (internal)|
|"""$FC00"""|$FFFF|BRAM, upon bootup contains loader and vectors|
|>|>|bgcolor(lightgreen): IO Map |
|LED|$C000|Low bit lights the LED |
|Serial Port|$C008|[[SerialPort details|SerialPort]] |
|"""PMOD1""" |$C010|[[Parallel Port details|Parallel Port]] |
|"""PMOD2""" |$C018|[[Parallel Port details|Parallel Port]] |
|"""PMOD3""" |$C020|[[Parallel Port details|Parallel Port]] |
|"""PMOD4""" |$C028|[[Parallel Port details|Parallel Port]] |

The board requires a mini-USB connection for power, and a 115,200 serial port connection to your PC. A terminal program capable of sending binary files directly is also needed (I use gtkterm on linux).
CHOCHI was driven by the desire for a minimal, inexpensive 6502 controller that is more capable than the original """DILDAR50""" (more than 8K of RAM). CHOCHI, in its minimalism, matches the spirit as well as the requirements for retrocomputing. It is big enough to fit a full 6502 system (including serial, parallel, and in the future, SD card and video interfaces). Working with it requires a minimal mindset that retrocomputing fans are familiar with and the rest of the world finds confusing. And it helps that it is inexpensive enough to be nearly disposable.
All CHOCHI models contain 3.3V Parallel Ports.  For 5V compatibility see [[5V Logic Compatibility]]
![[CHOCHI J Parallel Port]]
<<tiddler [[CHOCHI J Parallel Port]]>>
| !SD | !uSD | !Name | !I/O | !Description |
| 1 | 2 |nCS | I |Card Select (low) |
| 2 | 3 |DI | I |Data In (MOSI) |
| 3 | |VSS | S |Ground |
| 4 | 4 |VDD | S |Power |
| 5 | 5 |CLK | I |Clock (SCLK) |
| 6 | 6 |VSS | S |Ground |
| 7 | 8 |DO | O |Data Out (MISO) |
| 8 | 8 | | | |
| 9 | 1 | | | |

| !Name| !SD | !CHOCHI H|
|nCS | 1 | P98 |
|MOSI | 2 | P97 |
|SCLK | 5 | P96 |
|MISO | 7 | P92 |
|SWITCH | | P1 |
Chochi's serial port is based on the PicoBlaze(TM) UART.

The serial port is hardwired for 115200 bps, 2 stop bits, no handshaking.
<<tiddler SerialPortRegisters>>
<<tiddler SerialPortCode>>
!Serial Port Constants
<<tiddler SerialPortConstants>>
!Serial Port Transmit
ACIA1_Output    pha                       ;save registers
ACIA1_Out1      lda   UART_STATUS         ;serial port status
                and   #UART_MASK_TX_FULL  ;is there room in tx buffer?
                bne   ACIA1_Out1          ;no, will try again
                pla                       ;character to be output
                sta   UART_DATA           ;put character to Port
                rts                       ;done
!Serial Port Receive
ACIA1_Input     lda   UART_STATUS         ;Serial port status
                and   #UART_MASK_RX_READY ;mask data present bit
                beq   ACIA1_Input         ;no char to get
                lda   UART_DATA           ;get chr
                rts                       ;
 UART_BASE          equ IO_BASE+8
 UART_DATA          equ UART_BASE
|>|>| !Serial Port Registers |
|!Register |!Address |!Notes |
|"""UART_STATUS"""|UART_BASE+0 |Read-only|
|"""UART_DATA"""|UART_BASE+1 |Read-write|

|>| !Serial Port<br>Status Register |
|6|RX data present |
|5|RX full |
|4|RX half-full |
|1|TX full |
|0|TX half-full |
a low-cost FPGA board
To use this board you need to be reasonably comfortable hooking up and configuring a serial port on your computer, and download pre-built 6502 applications.  Minimal soldering skills are required to connect to IO ports. Advanced users may
-make their own 6502 applications in assembly, C, Forth or BASIC
-reconfigure the FPGA to fine-tune the system to their liking, or do something completely different.
You can now write C code using the opensource cc65 compiler.  The support files are [[here|cc65 Support]]

| !Name | !Binary | !Source | !Docs | !Last update | !Description |
|[[FIG-FORTH|]] |[[fig6502.bin|]]|[[|software/FIGFORTH/]]|[[|]] |Sep 18 2013 |A Working """FIG-FORTH""" |
|Daryl Rictor's Monitor |[[sbc.bin|]] |[[|]] |See source |Sep 18 2013 |A monitor program - thanks, Daryl! |
|Daryl Rictor's SBC2OS |[[SBC2.BIN|]] |[[|]]|See source |Nov 7,2013 |Entire SBC2OS with assembler,disassembler and monitor!|
|EhBASIC |[[basic.bin|]] |[[|]] | ??? |Sep 18 2013 |BASIC interpreter |
|"""HelloWorld""" |[[hello.bin|software/HelloWorld/hello.bin]] |[[|software/HelloWorld/]] | - |Oct 2 2013 |No need to expain, a simple Makefile included |
|blinktest |[[test.bin|]] |[[test.as65|]] |See source |Sep 16 2013 |Example: LED blinker in assembly |

Note: Users of early CHOCHI boards (marked DILDAR X1) should connect the top pin of the serial port to ground (top pin of the power connection).  Soldering a small wire from the bottom works well. <p>Of course, if your USB-serial board's pinout is different, wire it accordingly.  Generally, CHOCHI's rx goes to USB-serial boards's tx and vice versa.
You can now develop C code using the opensource cc65 compiler.  Download [[|software/cc65_support/]] 

cc65 ([[cc65 web page|]]) is a cross-compiler.  An easy way to install it for Ubuntu users is to add the repositories [[from this webpage|]] and just 'apt-get install cc65'.

Copy """CHOCHI1.cfg""" from cc65_support directory into the cc65's cfg directory.
On my system, that is /usr/lib/cc65/cfg/ 

Copy (you may need to recompile) CHOCHI1.lib from cc65_support/libsrc to
cc65's lib directory.  Mine is /usr/lib/cc65/lib/

Compile the header generation program "chochihead".  Put it somewhere 

Now you should be able to compile the test program in 'blinktest' using
make.  My usb-serial setup maps to /dev/ttyUSB0, so I just use
'make send' to send the compiled binary to CHOCHI!