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>>
<<importTiddlers>>
<!--{{{-->
<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>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<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>
<div id='displayArea' role='main'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</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]];
	background:[[ColorPalette::TertiaryPale]];
	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 1.5.0.2 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>
<!--}}}-->
<<tiddler IO_BASE>>
{{{
 LED                equ IO_BASE
}}}
<<tiddler UART_BASE>>
{{{
 UART_BASE          equ IO_BASE+8
 UART_DATA          equ UART_BASE
 UART_STATUS        equ UART_BASE+1
 UART_MASK_TX_FULL  equ $02
 UART_MASK_RX_READY equ $40
}}}
CHOCHI loader expects a 4-byte header preceding the binary file.  The header is:
{{{
 ADDR LOW
 ADDR HIGH
 SIZE LOW (not including the header)
 SIZE HIGH
}}}
In assembly, the simplest way to do this is to place something like this surrounding your code:
{{{
  org START-4
  dw START
  dw FINISH-START
START
...
FINISH
}}}
[[Download 6502_45_002.mcs.zip|bitstream/6502_45_002.mcs.zip]] 
  Hardware: Arlet's 6502 45MHz core with 8bit in, 8bit out, led, uart<BR>
  Software: Loader (LED flashes while waiting)
  Notes: LED port now uses bit 0 of $C000 to set LED state.  Verilog modified to store LED value from databus instead of toggling.
!![[MemoryMap - 6502_45_002]]
<<tiddler [[MemoryMap - 6502_45_002]]>>
[[Download 6502_45_003.mcs.zip|bitstream/6502_45_003.mcs.zip]] 
  Hardware: Arlet's 6502 45MHz core with 8bit in, 8bit out, led, uart<BR>
  Software: Loader (LED flashes while waiting) in page 0
  Notes: 
- 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]]>>
[[Download 6502_45_004.mcs.zip|bitstream/6502_45_004.mcs.zip]] 
[[Source and build environment 6502_45_004.zip|bitstream/6502_45_004.zip]]
A complete build environment with Makefile to create CHOCHI bitstream
!![[MemoryMap - 6502_45_003]] (unchanged for 004)
<<tiddler [[MemoryMap - 6502_45_003]]>>
|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.
[>img[pix/CHOCHI_B_diag.png]]
[>img[pix/CHOCHI_F_SD.png]]
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|
[>img[pix/CHOCHI_F_diag.png]]
The latest model: CHOCHI F<<tiddler [[CHOCHI F diagram]]>>
Please email:

enso  at   apple2.x10.mx  (substitute @ for '  at  ')

I am also active on the 6502 forums, especially 'Programmable Logic' at [[6502.org|http://forum.6502.org]]
[[Summary]]
[[GettingStarted]]
[[Software]]
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|http://www.kingswood-consulting.co.uk/assemblers/as65_142.zip]] 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, 2 stop bits, 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.
[[Summary]]
[[GettingStarted]]
[[FAQ]]
[[Software]]
[[Bitstreams]]
[[Developing Code]]
[[Contact]]
!![[MemoryMap - 6502_45_003]]
<<tiddler [[MemoryMap - 6502_45_003]]>>
|>|>|bgcolor(lightgreen): Memory Map |
|!Start|!End|!Used as|
|$0000|$01FF|BRAM (internal)|
|$0200|$BFFF|SRAM|
|$C000|"""$C0FF"""|IO|
|$F800|"""$F9FF"""|Mapped to $0000-$01FF|
|"""$FA00"""|$FFFF|BRAM, upon bootup contains loader and vectors|
 
|>|bgcolor(lightgreen): IO Map |
|!Device|!Address|
|LED|$C000|
|Serial Port|$C008|
|Output Port (A)|$C010|
|Input Port (B)|$C018|



|>|>|bgcolor(lightgreen): Memory Map |
|!Start|!End|!Used as|
|$0000|$01FF|BRAM|
|$0200|$BFFF|SRAM|
|$C000|"""$C0FF"""|IO|
|"""$FE00"""|$FFFF|BRAM, upon bootup contains vectors and loader|


The board requires a regulated 3.3V power supply, 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.
[>img[pix/SD/sdcard_pinout.gif]] 
| !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 |
|nCS | 1 | P91 |
|MOSI | 2 | P89 |
|SCLK | 5 | P87 |
|MISO | 7 | P85 |
Chochi's serial port is based on the PicoBlaze(TM) UART.

The serial port is hardwired for 115200 bps, 2 stop bits, no handshaking.
![[SerialPortRegisters]]
<<tiddler SerialPortRegisters>>
![[SerialPortCode]]
<<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
 UART_STATUS        equ UART_BASE+1
 UART_MASK_TX_FULL  equ $02
 UART_MASK_RX_READY equ $40
}}}
|>|>| !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 |
|!Bit|!Function|
|7|"""---"""|
|6|RX data present |
|5|RX full |
|4|RX half-full |
|3|"""---"""|
|2|"""---"""|
|1|TX full |
|0|TX half-full |
a low-cost FPGA board
CHOCHI
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|http://en.wikipedia.org/wiki/Forth/]] |[[fig6502.bin|http://apple2.x10.mx/CHOCHI/software/FIGFORTH/fig6502.bin]]|[[figsrc.zip|http://apple2.x10.mx/CHOCHI/software/FIGFORTH/figsrc.zip]]|[[figdoc.zip|http://apple2.x10.mx/CHOCHI/software/FIGFORTH/figdoc.zip]] |Sep 18 2013 |A Working """FIG-FORTH""" |
|Daryl Rictor's Monitor |[[sbc.bin|http://apple2.x10.mx/CHOCHI/software/daryl_mon/sbc.bin]] |[[mon.1.0.1.src.zip|http://apple2.x10.mx/CHOCHI/software/daryl_mon/mon.1.0.1.src.zip]] |See source |Sep 18 2013 |A monitor program - thanks, Daryl! |
|Daryl Rictor's SBC2OS |[[SBC2.BIN|http://apple2.x10.mx/CHOCHI/software/daryl_mon/SBC2.BIN]] |[[SBC2OS.zip|http://apple2.x10.mx/CHOCHI/software/daryl_mon/SBC2OS.zip]]|See source |Nov 7,2013 |Entire SBC2OS with assembler,disassembler and monitor!|
|EhBASIC |[[basic.bin|http://apple2.x10.mx/CHOCHI/software/EhBASIC/basic.bin]] |[[EhBASIC.src.zip|http://apple2.x10.mx/CHOCHI/software/EhBASIC/EhBASIC.src.zip]] | ??? |Sep 18 2013 |BASIC interpreter |
|"""HelloWorld""" |[[hello.bin|software/HelloWorld/hello.bin]] |[[HelloWorld.zip|software/HelloWorld/HelloWorld.zip]] | - |Oct 2 2013 |No need to expain, a simple Makefile included |
|blinktest |[[test.bin|http://apple2.x10.mx/CHOCHI/software/blinktest/test.bin]] |[[test.as65|http://apple2.x10.mx/CHOCHI/software/blinktest/test.as65]] |See source |Sep 16 2013 |Example: LED blinker in assembly |


<<tiddler [[CHOCHI diagram]]>>
CHOCHI is a minimal """XC3S50""" FPGA board with 128K of fast SRAM and 31 IO pins
- use the preconfigured 45MHz 6502 computer immediately
- program it in 6502 assembler, BASIC, Forth or C
- fit 4 Picoblaze cores
- use as a generic FPGA board for any purpose whatsoever
- use the JTAG port to update the system or make your own 

@@Assembled boards are available for $30.@@

<<slider chkSlider Motivation Motivation "Click here to read more">>
<<slider chkSlider MinimumRequirements MinimumRequirements "Click here to read more">>
<<slider chkSlider SkillLevel SkillLevel "Click here to read more">>



[img[pix/serial_conn.png]]
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 [[chochi_cc65_support.001.zip|software/cc65_support/chochi_cc65_support.001.zip]] 

cc65 ([[cc65 web page|http://oliverschmidt.github.io/cc65/]]) is a cross-compiler.  An easy way to install it for Ubuntu users is to add the repositories [[from this webpage|http://www.trikaliotis.net/debian]] 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 
visible.

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!