Richard Gray | 1 Mar 2009 04:23

Re: Z80180 PIO question - cured!

I even went as far as replacing the PIO chips with some new ones, so convinced 
was I that I was doing things correctly. I wasn't, of course.

The designers of this circuit (I'm doing a reverse engineering job) arranged 
the C/'D and A/'B lines the opposite way around to Zilog's suggestion of 
connecting them to A0 and A1, so in effect I was addressing the ports 
entirely wrongly. Only when I came to verify my assumptions with some simple 
continuity testing did it become clear where I had made my blunder. A quick 
change to the #define macros for the ports and everything sprung into life 
exactly as it should after a recompile and blowing a new EPROM.

I've spent four days wrestling with this problem, including looking at the 
timing of M1 to make sure that it wasn't continually resetting the PIO (M1 
without 'RD or 'IOREQ causes a reset, apparently) - all a complete waste of 
time in retrospect. Now maybe I'll get some decent sleep, I've been so 
preoccupied!

Hey-ho.

On Saturday 28 February 2009 23:37:20 Jacques Pelletier wrote:
<snip>
> > Can anyone suggest where I might be going wrong? The generated assembly
> > code shows in0 and out0 instructions, but they still address the correct
> > port address so I don't really see a problem with that, and the same
> > principle is used for the Zilog CTC and that works fine.
> >
> > I'm completely baffled. Any suggestions would be welcome.
>
> You should add M1 to your logic analyser; the Z80 PIO chip generates its
> own write signal. Here's the equation from the specs of the PIO:
(Continue reading)

candido lopez rodriguez | 1 Mar 2009 16:58
Favicon

still having problems

Hello all:

I hope that somebody can provide me with help understanding the behavior of 
SDCC. I did a open source project (with tools and money provided by a private 
company) in this job I used the z80 processor (the Audio processor has a Z80 
core, so  my job was to do the device driver for Linux)

Well back to my problem, I am testing a board (STD bus, z80 with CTC  8151 
UART) my problem is that the code that SDCC generates is not correct, I 
returned the commercial toolset (avocet) but before to returned I compiled 
the sample code I generated and it works. I am attaching all the files, 
hoping that somebody can shed light in this issue.

Thanks

Candida 

P.S.

The test programs sets the channel 1 of the CTC to 1200 baud, initializes the 
UART and then says hello in an infinite loop (I know you guys can figure that 
out, just making your life easy :)
Attachment (test.tar.gz): application/x-tgz, 3869 bytes
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
(Continue reading)

candido lopez rodriguez | 1 Mar 2009 17:03
Favicon

sorry forgot to include the compiler info

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.9 
#5379 (Feb 15 2009) (UNIX)
z80dasm: Portable Z80 disassembler
Copyright (C) Marcel de Kogel 1996,1997
    ld     a,$02           ; 000000 3E 02 
    rst    08h             ; 000002 CF 
    ret                    ; 000003 C9 
    ld     a,$00           ; 000004 3E 00 
    rst    08h             ; 000006 CF 
    halt                   ; 000007 76 
    jr     $0007           ; 000008 18 FD 
    ld     sp,$3e80        ; 00000A 31 80 3E 
    ld     hl,$0034        ; 00000D 21 34 00 
    push   hl              ; 000010 E5 
    call   $01c5           ; 000011 CD C5 01 
    pop    af              ; 000014 F1 
    ld     hl,$00cd        ; 000015 21 CD 00 
    push   hl              ; 000018 E5 
    call   $003b           ; 000019 CD 3B 00 
    pop    af              ; 00001C F1 
    ld     hl,$0015        ; 00001D 21 15 00 
    push   hl              ; 000020 E5 
    call   $0067           ; 000021 CD 67 00 
    pop    af              ; 000024 F1 
    call   $0148           ; 000025 CD 48 01 
    jr     $0025           ; 000028 18 FB 
    ld     a,$00           ; 00002A 3E 00 
    out    ($f5),a         ; 00002C D3 F5 
(Continue reading)

Philipp Klaus Krause | 1 Mar 2009 17:06
Picon

Re: still having problems

candido lopez rodriguez schrieb:

> my problem is that the code that SDCC generates is not correct,

Could you be a bit more specific about that?

Philipp

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
candida lopez rodriguez | 1 Mar 2009 17:38
Favicon

Re: still having problems

On Sunday 01 March 2009 11:06:46 am Philipp Klaus Krause wrote:
> candido lopez rodriguez schrieb:
> > my problem is that the code that SDCC generates is not correct,
>
> Could you be a bit more specific about that?
>
> Philipp
>
>
> ---------------------------------------------------------------------------
>--- Open Source Business Conference (OSBC), March 24-25, 2009, San
> Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing
> the Enterprise -Strategies to boost innovation and cut costs with open
> source participation -Receive a $600 discount off the registration fee with
> the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@...
> https://lists.sourceforge.net/lists/listinfo/sdcc-user

I attached a second email with a dump of the binary code generated by SDCC, 
there is a halt instruction in the dump, I do not think that SDCC is 
generating the HALT but it seems that the instruction stream is not correct, 
which makes the instruction to be interpreted as HALT (please note the 
beginning of the code with the ret statements)

Thanks

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
(Continue reading)

Philipp Klaus Krause | 1 Mar 2009 17:52
Picon

Re: still having problems

Can you post the .map file, too?

Philipp

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
candida lopez rodriguez | 1 Mar 2009 18:52
Favicon

Re: still having problems

On Sunday 01 March 2009 11:52:53 am Philipp Klaus Krause wrote:
> Can you post the .map file, too?
>
> Philipp
>
>
> ---------------------------------------------------------------------------
>--- Open Source Business Conference (OSBC), March 24-25, 2009, San
> Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing
> the Enterprise -Strategies to boost innovation and cut costs with open
> source participation -Receive a $600 discount off the registration fee with
> the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@...
> https://lists.sourceforge.net/lists/listinfo/sdcc-user

Thanks as you requested attached the map file, please let me know what else 
you need

Thanks again

Hexadecimal

Area                               Addr   Size   Decimal Bytes (Attributes)
--------------------------------   ----   ----   ------- ----- ------------
.  .ABS.                           0000   0000 =      0. bytes (ABS,CON)

(Continue reading)

Philipp Klaus Krause | 1 Mar 2009 19:08
Picon

Re: still having problems

Try changing --code-loc 0 in your makefile to something like --code-loc
0x40.

Philipp

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
candida lopez rodriguez | 1 Mar 2009 20:19
Favicon

Re: still having problems

On Sunday 01 March 2009 01:08:31 pm Philipp Klaus Krause wrote:
> Try changing --code-loc 0 in your makefile to something like --code-loc
> 0x40.
>
> Philipp
>
> ---------------------------------------------------------------------------
>--- Open Source Business Conference (OSBC), March 24-25, 2009, San
> Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing
> the Enterprise -Strategies to boost innovation and cut costs with open
> source participation -Receive a $600 discount off the registration fee with
> the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@...
> https://lists.sourceforge.net/lists/listinfo/sdcc-user

I will try, Thanks

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
candida lopez rodriguez | 1 Mar 2009 20:31
Favicon

Re: still having problems

On Sunday 01 March 2009 01:08:31 pm Philipp Klaus Krause wrote:
> Try changing --code-loc 0 in your makefile to something like --code-loc
> 0x40.
>
> Philipp
>
> ---------------------------------------------------------------------------
>--- Open Source Business Conference (OSBC), March 24-25, 2009, San
> Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing
> the Enterprise -Strategies to boost innovation and cut costs with open
> source participation -Receive a $600 discount off the registration fee with
> the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@...
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
After changed the code-loc I get this

Internal error: validateOpType failed in 
OP_SYMBOL(IC_LEFT(_G.head->next->next->ic))  <at>  peep.c:85: expected symbol, got 
null op
Caught signal 11: SIGSEGV
CTC.o: cannot open.

Thanks

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
(Continue reading)


Gmane