Skip to content
Tags

,

State of Play 15-10-28

October 28, 2015

As of this afternoon,

  • The simple 25 uS pulse timer interrupt works fine
  • I can compile a version of Josh’s monitor which does not insist on the front panel and which does not do output to port 40 except in the RS232 routines
  • I have tried to modify the RS232 output routine to respect the bottom bits of port 40 but no luck(very tricky code, interleaved with led display refresh and rs232 input)
  • I can compile and run a simple blink program(1stblink.c) and load it via :hex
  • loading a largeish program via :hex fails with timeout but works with xmodem
  • Making 1stblink bigger by adding an initialized global results in failure(branch to location 0?) – this feels like a compiler problem.

Next Steps

  • stabilize the hardware on the protoboard (allow for reprogramming the avr)(this is a mixed blessing since the rom would be harder to get at)
  • stabilize the programmer on the arduino
  • troubleshoot the compiler/filler issue
  • Hope josh can help with the rs232 routine or:
    • consider adding a dedicated latch for my digital i/o
unsigned char port40=0x80; //output port 40 with bit 7 reserved for serial input
char filler[]=".........1.........2.........3.........4.........5";
void setledon(){
__asm
 ld a,#129
 out (64),a
__endasm ;
}
void setledoff(){
__asm
 ld a,#0x80
 out (64),a
__endasm ;
}
void delay(unsigned int howlong){
	unsigned int i;
	for (i=0;i<howlong;i++){
		__asm nop __endasm;
	}
}
void main(){
	while(1){
		setledon();
		delay(50000);
		setledoff();
		delay(50000);
	}
}
:07 8000 00 CD3B80 CD2280 C7 BB call init(803b), call main(8022), restart
:10 803B 00 01010078B12808110080213A80EDB0C9 08
:20 8007 00 3E81D340C93E80D340C9110000210200397B967A239ED0001318F2
    8022    CD0780 2150 B9 call setledon,ld hl,5000
:14 8027 00 C3 E5 CD1180 F1 CD0C802 150C3E5CD1180F118E880 0D push hl, call delay, pop af, call setledoff
:00 0000 01 FF
                              1 ;--------------------------------------------------------
                              2 ; File Created by SDCC : free open source ANSI-C Compiler
                              3 ; Version 3.5.0 #9253 (Jun 20 2015) (MINGW32)
                              4 ; This file was generated Wed Oct 28 15:22:49 2015
                              5 ;--------------------------------------------------------
                              6 	.module 1stbigger
                              7 	.optsdcc -mz80
                              8 	
                              9 ;--------------------------------------------------------
                             10 ; Public variables in this module
                             11 ;--------------------------------------------------------
                             12 	.globl _main
                             13 	.globl _delay
                             14 	.globl _setledoff
                             15 	.globl _setledon
                             16 	.globl _filler
                             17 	.globl _port40
                             18 ;--------------------------------------------------------
                             19 ; special function registers
                             20 ;--------------------------------------------------------
                             21 ;--------------------------------------------------------
                             22 ; ram data
                             23 ;--------------------------------------------------------
                             24 	.area _DATA
                             25 ;--------------------------------------------------------
                             26 ; ram data
                             27 ;--------------------------------------------------------
                             28 	.area _INITIALIZED
   0000                      29 _port40::
   0000                      30 	.ds 1
   0001                      31 _filler::
   0001                      32 	.ds 51
                             33 ;--------------------------------------------------------
                             34 ; absolute external ram data
                             35 ;--------------------------------------------------------
                             36 	.area _DABS (ABS)
                             37 ;--------------------------------------------------------
                             38 ; global & static initialisations
                             39 ;--------------------------------------------------------
                             40 	.area _HOME
                             41 	.area _GSINIT
                             42 	.area _GSFINAL
                             43 	.area _GSINIT
                             44 ;--------------------------------------------------------
                             45 ; Home
                             46 ;--------------------------------------------------------
                             47 	.area _HOME
                             48 	.area _HOME
                             49 ;--------------------------------------------------------
                             50 ; code
                             51 ;--------------------------------------------------------
                             52 	.area _CODE
                             53 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:3: void setledon(){
                             54 ;	---------------------------------
                             55 ; Function setledon
                             56 ; ---------------------------------
   0000                      57 _setledon::
                             58 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:7: __endasm ;
   0000 3E 81         [ 7]   59 	ld a,#129
   0002 D3 40         [11]   60 	out (64),a
   0004 C9            [10]   61 	ret
                             62 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:9: void setledoff(){
                             63 ;	---------------------------------
                             64 ; Function setledoff
                             65 ; ---------------------------------
   0005                      66 _setledoff::
                             67 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:13: __endasm ;
   0005 3E 80         [ 7]   68 	ld a,#0x80
   0007 D3 40         [11]   69 	out (64),a
   0009 C9            [10]   70 	ret
                             71 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:15: void delay(unsigned int howlong){
                             72 ;	---------------------------------
                             73 ; Function delay
                             74 ; ---------------------------------
   000A                      75 _delay::
                             76 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:17: for (i=0;i<howlong;i++){
   000A 11 00 00      [10]   77 	ld	de,#0x0000
   000D                      78 00103$:
   000D 21 02 00      [10]   79 	ld	hl,#2
   0010 39            [11]   80 	add	hl,sp
   0011 7B            [ 4]   81 	ld	a,e
   0012 96            [ 7]   82 	sub	a, (hl)
   0013 7A            [ 4]   83 	ld	a,d
   0014 23            [ 6]   84 	inc	hl
   0015 9E            [ 7]   85 	sbc	a, (hl)
   0016 D0            [11]   86 	ret	NC
                             87 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:18: __asm nop __endasm;
   0017 00            [ 4]   88 	nop 
                             89 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:17: for (i=0;i<howlong;i++){
   0018 13            [ 6]   90 	inc	de
   0019 18 F2         [12]   91 	jr	00103$
                             92 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:21: void main(){
                             93 ;	---------------------------------
                             94 ; Function main
                             95 ; ---------------------------------
   001B                      96 _main::
                             97 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:22: while(1){
   001B                      98 00102$:
                             99 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:23: setledon();
   001B CDr00r00      [17]  100 	call	_setledon
                            101 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:24: delay(50000);
   001E 21 50 C3      [10]  102 	ld	hl,#0xC350
   0021 E5            [11]  103 	push	hl
   0022 CDr0Ar00      [17]  104 	call	_delay
   0025 F1            [10]  105 	pop	af
                            106 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:25: setledoff();
   0026 CDr05r00      [17]  107 	call	_setledoff
                            108 ;C:\Users\Bill\Desktop\olduinoZ\1stbigger.c:26: delay(50000);
   0029 21 50 C3      [10]  109 	ld	hl,#0xC350
   002C E5            [11]  110 	push	hl
   002D CDr0Ar00      [17]  111 	call	_delay
   0030 F1            [10]  112 	pop	af
   0031 18 E8         [12]  113 	jr	00102$
                            114 	.area _CODE
   0033                     115 ___str_0:
   0033 2E 2E 2E 2E 2E 2E   116 	.ascii ".........1.........2.........3.........4.........5"
        2E 2E 2E 31 2E 2E
        2E 2E 2E 2E 2E 2E
        2E 32 2E 2E 2E 2E
        2E 2E 2E 2E 2E 33
        2E 2E 2E 2E 2E 2E
        2E 2E 2E 34 2E 2E
        2E 2E 2E 2E 2E 2E
        2E 35
   0065 00                  117 	.db 0x00
                            118 	.area _INITIALIZER
   0000                     119 __xinit__port40:
   0000 80                  120 	.db #0x80	; 128
   0001                     121 __xinit__filler:
   0001 2E 2E 2E 2E 2E 2E   122 	.ascii ".........1.........2.........3.........4.........5"
        2E 2E 2E 31 2E 2E
        2E 2E 2E 2E 2E 2E
        2E 32 2E 2E 2E 2E
        2E 2E 2E 2E 2E 33
        2E 2E 2E 2E 2E 2E
        2E 2E 2E 34 2E 2E
        2E 2E 2E 2E 2E 2E
        2E 35
   0033 00                  123 	.db 0x00
                            124 	.area _CABS (ABS)

maybe there’s something wrong in the init section of the hex file
:10 803B 00 01010078B12808110080213A80EDB0C9 08
per https://www.onlinedisassembler.com/odaweb/OAhryS7C/0 it looks like that would copy a bunch of stuff over top of my code – something to do with sections I bet
15-10-28 disassem

Advertisements

From → Olduino/Z

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: