<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 12 Aug 2007 16:16:43 +0100
From   : jgh@... (Jonathan Graham Harston)
Subject: Emulating Econet hardware?

>Message-ID: <Marcel-1.53-0810230119-bc8xSBG@...>
 
Johan Heuseveldt <johan@...> wrote:
> I had the same thoughts about these more 'normal' serial applications.
 
The Torch Z80 boards use Z80-SIOs for 'normal' RS232-style serial
comms.
 
> > The chips still seem pretty common. Farnell still sell them, although it's
> > not clear what the  difference is between a SIO/0 and a SIO/2 (without
> > downloading both PDF files  and comparing, and I can't be bothered ;)
 
Do you mean SIO/1, not SIO/2? The SIO/0 has seperate transmit and
receive clocks for Channel B, the SIO/1 has a single clock for
Channel B. 
 
> I suppose the difficult part would be the interrupt structure used. Most
> likely presenting a byte on the databus?
 
The simplest way is to present a single interupt, like on the BBC,
and modify the service code. Something like the following would
work:
 
.NMI_Idle
PUSH AF                      ; Save AF
IN A,(SIO_Status)            ; Get SIO status
RRCA:JR NC,Idle_exit         ; Nothing received, ignore
IN A,(SIO_Data)              ; Get second byte from frame
AND A:JR Z,Idle_MyNet        ; net=00, continue receiving
INC A:JR Z,Idle_Broadcast    ; net=FF, continue receiving
LD A,3:OUT (SIO_Control),A   ; Select control register 3
LD A,&F5:OUT (SIO_Control),A ; Set 'Ignore this frame'
.Idle_exit
POP AF:RETN
.Idle_Broadcast
DEC A                        ; Restore A to &FF
.Idle_MyNet
LD (EcoHeader+1),A           ; Save net number
PUSH HL
LD HL,(NMI_Scout)            ; Select next NMI routine
LD (NMI_JMP),HL
POP HL
POP AF:RETN
 
Doesn't check for aborts, errors, etc.
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
The most perfect world is an imperfect world as the imperfections
give people a reason to strive to change it.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>