Micro UK101 Build
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
It needs better I/O, and a persistent store of some sort (compact flash I think).
I don't want to dampen your enthusiasm but don't forget, when comparing speed with early 80's micros, that your system doesn't have to spend time writing data to the screen, it simply has to write a byte to the ACIA and that's it, job done. Most early 80's systems needed the CPU to calculate cursor position and write data to the screen - this takes time. And since many of them didn't have hardware scroll, scrolling the screen could take absolutely ages. A system that doesn't have to do this will naturally be much faster.
Well done for getting the unit going and don't worry too much about what the wiring looks like - the fact that it works is the important bit.
Well done for getting the unit going and don't worry too much about what the wiring looks like - the fact that it works is the important bit.
Shift to the left,
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!
micro_brain wrote:
Having a little bit of a problem with loading and saving files. Well, save's easy, just capture text and type list. But trying to load it back in, it keeps getting confused, even with lots of spaces padding the text (before / after / blank lines). I think BASIC cannot keep up with it. Any suggestions?
The ACIA has RTS/CTS tied off, and to make use of them you'd need to level-shift. Maybe that's out of bounds. If you were to try to use them, perhaps check out MartinB's findings in this thread on the StarDot forums. I've certainly seen odd things with Windows driving serial into the Beeb, where Linux behaves more predictably, but I haven't ruled out hardware differences yet.
The other flow control method is XON/XOFF - Hyperterm can do that, I'm not sure whether or not CEGMON can do it.
Finally, perhaps you can arrange to throttle the speed at which you send data. I can't see a serial program that can do that. You could do it if you sent your data using say python, but would it be worth the bother. I suspect stuffing lots of NULs in might be preferable - or rigging your ACIA for a lower baud rate.
(The CEGMON manual is here [pdf])
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
PaulF wrote:
I don't want to dampen your enthusiasm but don't forget, when comparing speed with early 80's micros, that your system doesn't have to spend time writing data to the screen, it simply has to write a byte to the ACIA and that's it, job done. Most early 80's systems needed the CPU to calculate cursor position and write data to the screen - this takes time. And since many of them didn't have hardware scroll, scrolling the screen could take absolutely ages. A system that doesn't have to do this will naturally be much faster.
Quote:
Well done for getting the unit going and don't worry too much about what the wiring looks like - the fact that it works is the important bit.
TTo be honest, the look of the wiring is not as important as ensuring its longevity; that is what I am interested in. There are several temporary bodges on there I need to fix, and tying the wires down will prevent them getting snagged on something when I am moving the board about. It'll end up in some sort of case at some point but for now it's a bare board (as they were sold in the 70's).
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
BigEd wrote:
micro_brain wrote:
Having a little bit of a problem with loading and saving files. Well, save's easy, just capture text and type list. But trying to load it back in, it keeps getting confused, even with lots of spaces padding the text (before / after / blank lines). I think BASIC cannot keep up with it. Any suggestions?
The ACIA has RTS/CTS tied off, and to make use of them you'd need to level-shift. Maybe that's out of bounds. If you were to try to use them, perhaps check out MartinB's findings in this thread on the StarDot forums. I've certainly seen odd things with Windows driving serial into the Beeb, where Linux behaves more predictably, but I haven't ruled out hardware differences yet.
The other flow control method is XON/XOFF - Hyperterm can do that, I'm not sure whether or not CEGMON can do it.
Finally, perhaps you can arrange to throttle the speed at which you send data. I can't see a serial program that can do that. You could do it if you sent your data using say python, but would it be worth the bother. I suspect stuffing lots of NULs in might be preferable - or rigging your ACIA for a lower baud rate.
(The CEGMON manual is here [pdf])
Another possibility lies in turbo boosting (ha ha) the processor so it's quick enough to deal with the incoming torrent of text from the ACIA. The Motorola CPU is rated at 2Mhz - if the memory is fast enough it ought to work. I already asked how to speed it up (use the 2Mhz clock output from the counter). I foresee a "turbo" button like those old 33/66Mhz PCs..
I notice the ACIA is run in the CLK/16 mode - you could POKE it to run at CLK/64 mode, which would turn it down a bit.
So you'd want to POKE the value 16 to location 15*4096 to run at a quarter the baud rate.
Ah, I also notice Grant says he's NOPped out the code to write NULs to the output stream. So you have to replace them anyhow.
Do you have Activestate python installed? You could reinstate the NULs fairly readily with that, I think. Something a little like this perhaps:
Code: Select all
FCA6 RSACIA:
FCA6 LDA #3
FCA8 STA byte_1F000
FCAB LDA #$11
FCAD STA byte_1F000
FCB0 RTS
Ah, I also notice Grant says he's NOPped out the code to write NULs to the output stream. So you have to replace them anyhow.
Do you have Activestate python installed? You could reinstate the NULs fairly readily with that, I think. Something a little like this perhaps:
Code: Select all
f=open('input.txt')
for l in f.readlines():
print l.strip()+'\r' + 15 * '\0'
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
BigEd wrote:
I notice the ACIA is run in the CLK/16 mode - you could POKE it to run at CLK/64 mode, which would turn it down a bit.
So you'd want to POKE the value 16 to location 15*4096 to run at a quarter the baud rate.
Code: Select all
FCA6 RSACIA:
FCA6 LDA #3
FCA8 STA byte_1F000
FCAB LDA #$11
FCAD STA byte_1F000
FCB0 RTS
Quote:
Ah, I also notice Grant says he's NOPped out the code to write NULs to the output stream. So you have to replace them anyhow.
Quote:
Do you have Activestate python installed? You could reinstate the NULs fairly readily with that, I think. Something a little like this perhaps:
Code: Select all
f=open('input.txt')
for l in f.readlines():
print l.strip()+'\r' + 15 * '\0'
Hmm. If 10 NULs were needed at 300 baud, then at 19200 you'd need 640 NULs (which should be enough for anyone.) This seems absurd!
Are you saying that BASIC fails to capture any of the LOADed program? So it's a case of severe data overrun? The input routine doesn't seem to apply any buffering at all, or have any check for overrun.
The normal story for flow control, I think, is that RTS (or XOFF) is used by the receiver to tell the transmitter to shut up. The transmitter will then shut up, at its discretion, at some future point. So you need to have a system which reads characters into a buffer, and which applies RTS before that buffer fills up. It's the interrupt routine which fills the buffer, and the OS call which reads from it (under disabled interrupts, to avoid a race.) This is tricky stuff, and I think it's just missing from CEGMON - running at a lower baud rate, compared to the CPU speed, or adding NULs, is the workaround.
Are you saying that BASIC fails to capture any of the LOADed program? So it's a case of severe data overrun? The input routine doesn't seem to apply any buffering at all, or have any check for overrun.
The normal story for flow control, I think, is that RTS (or XOFF) is used by the receiver to tell the transmitter to shut up. The transmitter will then shut up, at its discretion, at some future point. So you need to have a system which reads characters into a buffer, and which applies RTS before that buffer fills up. It's the interrupt routine which fills the buffer, and the OS call which reads from it (under disabled interrupts, to avoid a race.) This is tricky stuff, and I think it's just missing from CEGMON - running at a lower baud rate, compared to the CPU speed, or adding NULs, is the workaround.
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
Unfortunately, executing POKE 15*4096,16 didn't work. I stopped responding, and when I reconnected at 4800 baud I got nothing. Had to hit the (newly installed) reset button, which bought it back to 19200. Seems I need a sending program that puts a delay between each line. A delay before hitting enter seems to work - pasting a line into the terminal sends it correctly to the MUK101. Of course, the problem is that the terminal owns the rs232 port so it needs to be disconnected during the send. Hmmmm.
Since I'm now using OSX I should be able to just take the program and cat it to /dev/tty[whatever] with a delay between each line. Thus:
By the way it doesn't work, presumably because the port's not setup.
Since I'm now using OSX I should be able to just take the program and cat it to /dev/tty[whatever] with a delay between each line. Thus:
Code: Select all
#!/bin/ksh
#--- Get the right port (assumes there is only one plugged in)
tty=`ls /dev/tty.PL2303-*`
echo "$1 ->" $tty
#--- Righty ho...
cat $1 | while read line; do
echo $line
echo -n $line > $tty
sleep 1
echo > $tty
done
That's much the sort of thing I was doing, in linux talking to my beeb, before I figured out how to set the buffer size right so the flow control worked.
But - in OSX, if you're using Zterm, there's an option called 'text pacing' which just might be worth a try. In our case, it was just slowing things down, but that's what you want.
I wonder - you could perhaps patch the ROM to send XOFF when it sees a CR and then XON when it sees a NL, if inbetween times BASIC goes away and tokenises and stores the lines, and allows any NULs to get dropped.
But - in OSX, if you're using Zterm, there's an option called 'text pacing' which just might be worth a try. In our case, it was just slowing things down, but that's what you want.
I wonder - you could perhaps patch the ROM to send XOFF when it sees a CR and then XON when it sees a NL, if inbetween times BASIC goes away and tokenises and stores the lines, and allows any NULs to get dropped.
in python you can do this kind of thing
not sure how you do it in shell
Code: Select all
import serial
ser = serial.Serial( "/dev/tty.usbserial-A2001nK2", 19200, timeout=1)
ser.write( chr(0x53) )
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
Well, apparently like this
.. but it does not seem to work.
Code: Select all
stty -f /dev/tty.PL2303-00002006 19200 -clocal -crtscts cs8 -cstopb speed 19200
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
This script replaces LF in the input file to CR/LF which the UK101 expects.
Sending converted files in ZTerm (OSX) with character pacing set to "wait for echo" and line delay of 20 (sixtieths of a second) appears to work.
But... the UK101's BASIC implementation appears to limit the line size to 72 chars, so longer lines are truncated. Or maybe it's CEGMON. Is there a way round this?
[EDIT] Nope, it's the UK101's BASIC. The manual says "up to 71 characters on any line". That's a pity. I have a text based adventure game written in BASIC that I'm trying to resurrect - will have to cut the longer lines up...
Code: Select all
# crlf
#
# Quick script to convert newlines to cr/newlines
# Use to prepare BASIC programs for sending to the Micro UK101
#
# usage : crlf file1 [file2..]
#--- Scan args
for x; do
#--- Tell 'em what you're doing
echo Converting $x to $x.crlf
#--- Do the magic - to type the ^M in vi editor enter ctrl-v ctrl-m
sed "s/$/^M/" < $x > $x.crlf
#--- End loop
done
But... the UK101's BASIC implementation appears to limit the line size to 72 chars, so longer lines are truncated. Or maybe it's CEGMON. Is there a way round this?
[EDIT] Nope, it's the UK101's BASIC. The manual says "up to 71 characters on any line". That's a pity. I have a text based adventure game written in BASIC that I'm trying to resurrect - will have to cut the longer lines up...
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
See viewtopic.php?t=1819 for the adventure game I mentioned. I have got it up & running on the UK101 at last..
-
micro_brain
- Posts: 85
- Joined: 31 Mar 2011
Just a brief note to let you know I overclocked it to 2Mhz (by moving the processor's clock in signal from Qd to Qc on the 74LS93) this morning and it is working fine.
Wow. TURBO power or what?
[EDIT : Actually, tell a lie, it just crashed running my adventure game. BACK TO THE DRAWING BOARD to check the memory access speed... ]
Wow. TURBO power or what?
[EDIT : Actually, tell a lie, it just crashed running my adventure game. BACK TO THE DRAWING BOARD to check the memory access speed... ]