Skip to content

Adding A Narrow ROM To the 1802 Olduino – III

June 21, 2017

I’ve tried a couple of things accessing the ROM.  First, although I was warned, I forgot that the ROM address lines are scrambled to make the layout practical.  A0 goes to the ROM’s A4, A3 goes to the ROM’s A0, and A4 goes to the ROM’s A3.  Nothing I can’t fix in software but the ROM image I got Josh to burn is no good.

For determining power consumption I tried running the Olduino with the ROM in place but not accessed and then with various duty cycles. With no ROM access the Olduino is using about 60ma.  With the heaviest duty cycle I could manage it’s about 170ma(!).  So my plan to use it as a boot device is fine but you probably wouldn’t put your monitor in it.

It’s possible that there is something else going on because i am fighting some kind of issue that might be memory-related.  If I run the program below the output from the dump() routine is fine for addresses below 0x8000 but it’s corrupt for the addresses in the ROM.  If I move the dump code into main() it works fine. I can only think of some kind of memory overlap but I don’t know what. The ROM contents as printed is “correct” and the dump showing address 003F does in fact report what’s at 3F so this may not really be mysterious – just some sort of finger problem.

UPDATE: I dinked around with this for hours with no satisfactory result. Certainly the problem goes away if i remove the rom but i’m not sure if it’s the RAM not making good contact or some more straightforward electrical issue.

 #include <olduino.h>
#include <nstdlib.h>
#include <cpu1802spd4port7.h>
void dump(unsigned char* data, unsigned int len){
	unsigned int i=0;
	printf("dumping %d bytes at %x",len,data);
	for(i=0;i<len;i++){
		if (0==(i%8)) printf("\n%x ",data);
		printf("%cx ",*data++);
	}
	printf("\n");
}
void main(){
	unsigned char*ptr=(unsigned char *)32768;
	unsigned int i=0;
	printf("dumper here 3\n");
	for(i=0;i<64;i++){
		if (0==(i%8)) printf("\n%x ",ptr);
		printf("%cx ",*ptr++);
	}
	printf("\ndone inline dump\n");
	dump((unsigned char *)0x8000,64);

	printf("\ndone\n");
	while(1);
}
#include <olduino.c>
#include <nstdlib.c>
/*
16:35:30.322> run1802.7.1(2000) for Hardware Loader
16:35:30.322> dumper here 3
16:35:30.322>
16:35:30.432> 8000 37 30 F8 C0 AE 00 80 7A
16:35:30.432> 8008 12 09 00 80 F8 7B BE 30
16:35:30.432> 8010 EE 15 09 30 C4 80 37 FF
16:35:30.615> 8018 3F D8 6E 19 67 00 0E FF
16:35:30.615> 8020 FF FF FF FF FF FF FF FF
16:35:30.615> 8028 FF FF FF FF FF FF FF FF
16:35:30.615> 8030 FF FF FF FF FF FF FF FF
16:35:30.615> 8038 FF FF FF FF FF FF FF FF
16:35:30.615> done inline dump
16:35:30.615> dumping 64 bytes at 003F
16:35:30.922> 003F A1 B1 C0 00 75 81 FA 07
16:35:30.922> 0047 AB 91 FA 00 BB 8B CA 00
16:35:30.922> 004F 61 9B CA 00 61 F8 A4 AC
16:35:30.922> 0057 F8 0E BC 87 AD 97 BD D4
16:35:30.922> 005F 09 CB F8 9F AC F8 0E BC
16:35:30.922> 0067 87 AB 97 BB 17 0B AD F8
16:35:30.922> 006F 00 BD D4 09 CB 11 22 86
16:35:30.922> 0077 52 81 F7 96 52 91 77 12
16:35:30.922>
16:35:30.922> done
*/

UPDATE: I dinked around with this for hours with no satisfactory result. Certainly the problem goes away if i remove the rom but i’m not sure if it’s the RAM not making good contact or some more straightforward electrical issue.

UPDATE: I did a memory test of the RAM with the ROM in circuit and it looked fine. I made a simpler program that exhibits the fault:

#include <nstdlib.h>
#include <cpu1802spd4port7.h>
void dump(unsigned char* data){
    unsigned int i=0;
    printf(" %x",data);
}
void main(){
	printf("dumper here 6\n");
	dump((unsigned char *)0x8fff);
	while(1);
}
#include <nstdlib.c>
********************partial assembly text follows ****************
_dump:		;framesize=8
	reserve 6
	st2 R12,'O',sp,(8); flag1 
;void dump(unsigned char* data){
;    unsigned int i=0;
	ld2z R11
	st2 R11,'O',sp,(4); ASGNU2(addr,reg)
;    printf(" %x",data);
	ldaD R12,L2; reg:acon
	ld2 R13,'O',sp,(8) ;reg:INDIRP2(addr)
	Ccall _printf
;}
L1:
	release 6
	Cretn

_main: ;copt is peeping your size 6 frame with oct 23 rules
	reserve 4
;void main(){
;	printf("dumper here 6\n");
	ldaD R12,L4; reg:acon
	Ccall _printf
;	dump((unsigned char *)0x8fff);
 	ldaD R12,0x8fff; reg:acon
	Ccall _dump

********************output follows ********************
15:32:08.807> run1802.7.1(2000) for Hardware Loader
15:32:08.807> dumper here 6
 0D34

The address is passed to dump() in R12 and what is received is, in fact, the value that’s loaded into R12 by the printf() preceding the dump() call. Looking at the assembly code i just have no idea how this is happening!

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: