Skip to content

Hello From The 1806 Side

March 15, 2017

I’m now pretty happy with the 1806 proof of concept setup. I have a software loader that I load into low memory using an 1802 processor.  The software loader looks like the 1802 in load mode but it writes to memory starting at 0x800 or, if there’s nothing to load, runs the code that’s already there. With the software loader installed i can swap out the 1802 chip for an 1806 and run code that uses the enhanced instruction set.

I’ve got an 1806 target for LCC1802 that compiles C using some of the 1806 enhanced instructions.  It gets a modest (20%) performance improvement and frees up a couple of registers.

When I get back to Ottawa I’m going to install an eprom to hold the loader and install the 1806 permanently.  I’ll then look at incorporating serial drivers directly in the 1802 and redoing the SPI circuit with a goal of eliminating the AVR completely.

This is the output from the”Hello” program loaded at location 0x800 compiled for the 1802 and then the 1806.
17-03-13 hellofromtheotherside

 //fakeloader simulates 1802 load mode in run for 1806
#define nofloats
void main(){
	asm(" 		b4 run\n"			//bypass bootloader if IN pressed
		" 		ldAD 14,0x800\n"	//starting address
		" 		sex 14\n"			//in X register
		"noEF4:	bn4 noEF4\n"		//loop til IN pressed
		"		inp 6\n"			//load memory
		"   	nop\n"
		"		out 7\n"			//and echo
		"yEF4:	b4 yEF4\n"			//wait til switch released
		"		br noEF4\n"			//back for more
		"run:	lbr 0x800\n");	//finally - off we go
}

#include <nstdlib.h>
#include <cpu1802spd4port7.h>
void fun(int i){}

void main()
{
	char* dummy=(void*) &fun;
	printf("Hello World!\n");
	printf("main() is at %x\n",&main);
	printf("Code for a null function starts with %cx\n",dummy[0]);
	if (dummy[0]==0xD5)
		printf("Compiled as an 1802\n");
	else if (dummy[0]==0x68)
		printf("Compiled as an 1806\n");
	else
		printf("I don't know what this is!\n");
}
#include <nstdlib.c>
Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: