Myelin's fast serial port/SD card adapter for the 1MHz Bus

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Myelin's fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Fri Nov 10, 2017 11:03 pm

Another new project... this is something I started on ages ago and finally got some PCBs made. It's a CPLD/MCU board that provides a (very) fast USB serial connection for anything with a 1MHz Bus (BBC B/B+/Master, or Electron+AP5). On my Electron, using the prototype of this, I managed to get 39 kB/s (the equivalent of 390 kbaud in a real serial port) in MODE 6

The PCBs just arrived in the mail, so I should have them tested sometime in the next couple of weeks.

serial_front.jpg

It's open source (Apache 2.0 license) like all my other Acorn hardware, and the latest designs live on GitHub here: https://github.com/google/myelin-acorn- ... sd_adapter
Last edited by myelin on Tue Jan 30, 2018 11:14 pm, edited 1 time in total.
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
tricky
Posts: 2370
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby tricky » Sat Nov 11, 2017 7:23 am

Very nice, I was thinking about something similar in the week. I was thinking MMC but with options for some combination of user port/ADC/speech/D2A. The main difference is that I would g never have got mine made.
Well done =D>

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Fri Nov 17, 2017 5:53 pm

... and it works!

I have it running JGH's HostFS, with the only changes being the port addresses (I have TxData and RxData on &FCA0, and TxStatus and RxStatus on &FCA1), and it works beautifully. With my WaitLoadIO fast path, it gets 29 kB/s on pretty much all transfers. Not sure why it's slower than the Electron version, but it's still very quick.

2017-11-installed_in_bbc.jpeg

(Pictured with USB cable disconnected)

I haven't tried out the SD port yet, but I should be able to get MMFS working without too much trouble, using the Electron Plus 1 interface (and maybe the fast shift register interface, although the CPLD is getting pretty full).
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Sat Dec 02, 2017 1:12 am

I just posted one of these off to Dominic Beesley, and it appears that a single PCB just counts as a "letter" to the USPS, which means I can post them out pretty cheaply to anyone who wants one. I don't have time to assemble them, but if anyone wants a bare PCB, PM me an address and I'll post you one!
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
danielj
Posts: 5974
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby danielj » Sat Dec 02, 2017 7:24 am

=D> very impressed! I'd love one, and if anyone wants some putting together, I'm happy to oblige (you can ping them directly to me and I'll construct and pass on). Will drop PM shortly :)

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Thu Dec 14, 2017 7:42 pm

Let's talk about construction here! Daniel has his boards, which means Dominic's probably arrived a week or so ago.

Firstly: the details are always at http://myelin.nz/acorn/bbcserial -- that'll always redirect to the best location for the board.

I'll update that with a proper bill of materials sometime, but for now here's what you need:

- 1 x XC9572XL-*VQG44* (44-pin 0.8mm TQFP. Speed rating doesn't matter. I've been using Digikey part number 122-1448-ND, but that's out of stock right now, so 122-1981-ND is the next cheapest. Just search for XC9572XL VQG44 and anything there should be good.)
- 1 x 2x5 header for CPLD programming (Digikey ED1543-ND), or you can just use bare pin headers
- 1 x MCP1700T-3302E/MB regulator (Digikey MCP1700T3302EMBCT-ND)
- 1 x right angle 2x17 female connector for the 1MHz bus (Digikey S5570-ND)
- 1 x micro SD socket (digikey HR1941CT-ND)
- 3 x 0805 100nF capacitors
- 2 x 0505 1uF capacitors
- 1 x Pro Micro board (from ebay/aliexpress -- make sure you get the one that looks like the pic above, with the micro USB socket; I've seen another kind that doesn't include USB)
- 1 x 3-pin 0.1" spacing header (you probably have this lying around already)
- 2 x 12-pin 0.1" spacing header + 2 x 12-pin 0.1" spacing receptacle for the Pro Micro

Assembly tricks:

- Pin 1 of the CPLD is marked with a little bubble on the PCB; it's in the bottom left corner. There's a matching mark on the chip.
- Refer to the picture above / on the project site for orientation for the JTAG header and Pro Micro.
- You can either solder the Pro Micro right onto the board by soldering two 12-pin headers onto the board, then dropping the Pro Micro on top and soldering it on, or you can make it removable by soldering the headers onto the underside of the Pro Micro board, and soldering two 12-pin receptacles onto the board. I have it set up this way because I'm experimenting with different microcontrollers, but it's safe enough to solder the Pro Micro board right in there if you prefer.

Programming the CPLD:

- I use a J-Link and a hacked up version of XC3SPROG. Once anyone gets to this point I'll figure out how to get this working for them. Let me know what programming tools you have sitting around... if you have something that's already XC3SPROG-compatible like a generic FT2232-based JTAG adapter or a Bus Blaster, that's easiest, but also any JTAG adapter that works with OpenOCD is fine, because it can program a chip given an SVF file.
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Wed Jan 03, 2018 1:22 am

A quick update - and kudos to Phil (myelin).

I finally got my boards from California on the second attempt, the first lot got lost, not helped by my giving phil the wrong postcode!

I got the solder station out this afternoon and put the thing together. So far I've only tried the serial port and it is working nicely! It is very fast, lovely to see a screenfull of Mode 0 popping up on the beeb in the flicker of an eye!

20180103_005615-s.jpg

[The LEDs on the Arduino board are a bit fierce! Why does everyone set their LEDs so eye wateringly bright these days, just because if can go that bright....]

I've not tried the SD card reader yet, I can't find my micro SD card reader....I had it somewhere recently, I'm sure I did

I've also soldered up Phil's cpu board but I'm not quite ready to test that, I still need to add headers and sockets and my cpu socket is already taken up with a DE0 nano at the moment!

20180103_005641-s.jpg

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Wed Jan 03, 2018 2:02 am

dominicbeesley wrote:I got the solder station out this afternoon and put the thing together. So far I've only tried the serial port and it is working nicely! It is very fast, lovely to see a screenfull of Mode 0 popping up on the beeb in the flicker of an eye!

Nice work! It's really exciting to see this up and running; I believe you're the first to get one of my boards working. Very much looking forward to seeing what you manage to make in combination with your blitter/DMA system :)

Time for me to fix up the holes in the documentation, and write an assembly guide!
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Sun Jan 07, 2018 8:02 pm

I've still not tried the SD adaptor yet but the serial port is brilliant! I got half an hour earlier and hacked together a driver for the very useful NoIce debugger. At 19,200 this was usable but a bit hesitant when single-stepping with a lot of watches set up, now even when its fetching a load of memory back after each step it feels responsive.

Phil, did you gather together the hostFS stuff?

D

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Mon Jan 08, 2018 2:20 am

dominicbeesley wrote:I've still not tried the SD adaptor yet but the serial port is brilliant! I got half an hour earlier and hacked together a driver for the very useful NoIce debugger. At 19,200 this was usable but a bit hesitant when single-stepping with a lot of watches set up, now even when its fetching a load of memory back after each step it feels responsive.

Phil, did you gather together the hostFS stuff?

Excellent! BTW how big is the driver code? There's a bit of room in the CPLD to put some ROM in the &FDxx page (accessible from the 1MHz Bus), although not a lot -- the most I've tried so far is 32 bytes.

So for HostFS, try the latest instructions up on https://github.com/google/myelin-acorn- ... sd_adapter -- that explains how to build a version of JGH's HostFS that works with this board, and how to get sweh's Perl TubeHost running with it. I've only tried it on macOS, and there may be some serial port quirks with TubeHost if you're on Windows or Linux, so let me know how it goes and I'll see what I can do to help. I'll be around for the next 6 hours or so if you're working on it right now :)
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Mon Jan 08, 2018 10:50 am

Thanks Phil,

the driver for the debugger is quite larges (about 3 and a half pages, plus some buffer space). I'm not sure where best to put it, I may come up with a few different versions. The simplest would just become the current language and place itself in 400-700 plus wherever I can fit the rest. I will look at another version in a SW ROM, not as current language. I would like to be able to debug stuff without getting in everything else's way! I need to have a look to see if I can get it smaller, it should be possible to squeeze it down as the example it was built on seemed to be coded for clarity rather than size...

I'll try and get a look at the tubehost thing this week - though I'm away for a family break next week so will have to get some real work finished.

D

cmorley
Posts: 426
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby cmorley » Mon Jan 08, 2018 11:01 am

dominicbeesley wrote: I would like to be able to debug stuff without getting in everything else's way! I need to have a look to see if I can get it smaller, it should be possible to squeeze it down as the example it was built on seemed to be coded for clarity rather than size...
D


NoIce for 6502 looks interesting. I took a quick peek at the website last evening after your post.

Could be an ideal candidate for the OS RAM I did... hide all the code, workspace & buffers in the OS RAM. You can hook the 6502 vectors too because you can redirect this to on or other of the 16K RAM pages. Then JMP to the OS handlers. If you copy the OS into one RAM page too you could single step through OS calls too...

No ROM, SRAM or main memory needed.

edit: if you're using a model B...

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Mon Jan 08, 2018 11:33 am

cmorley, interesting! I need to look at that...

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Mon Jan 08, 2018 6:04 pm

Hi Phil,

I just gave it a quick shot. I recompiled UPURSFS with the new locations but I just get "UPURSFS no selected; no RTS" is there other stuff I need to disable/enable?

D

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Mon Jan 08, 2018 6:40 pm

dominicbeesley wrote:I just gave it a quick shot. I recompiled UPURSFS with the new locations but I just get "UPURSFS no selected; no RTS" is there other stuff I need to disable/enable?

The trick is that you actually want to compile *HOSTFS*, not *UPURSFS*, because my board just looks like the Beeb's serial port (with different addresses), so it doesn't need all the UPURS magic. Try 'make OBJ/HOSTFS' (after editing hostfs.txt, replacing &FE08 (TxStatus and RxStatus) with &FCA1, and replacing &FE09 (TxData and RxData) with &FCA0), and installing OBJ/HOSTFS rather than OBJ/UPURSFS.
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Mon Jan 08, 2018 7:24 pm

Woo hoo!

20180108_191810-s.jpg


Got to cook tea, more later hopefully!

D

PS: How do I select on break? U,H don't seem to work

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Mon Jan 08, 2018 7:27 pm

dominicbeesley wrote:Woo hoo!

PS: How do I select on break? U,H don't seem to work

Awesome! Did you run into any issues getting TubeHost to recognize the serial port? I had to mess around with it quite a bit on my Mac, although I was also trying to debug my UPURS adapter at the same time, which probably made it a lot harder :)

This snippet in hostfs.txt suggests that TAB-break is the hotkey to boot into HostFS:

Code: Select all

BreakKey = &60  \ TAB
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Mon Jan 08, 2018 8:00 pm

Aha. I'll try TAB later.

No the serial port has been pretty straightforward. Thus is running the perl server under Cygwin.

Do you know is there any way of getting two usb com ports on those uControllers? Having hostfs and noIce at the same time would be immense!

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Mon Jan 08, 2018 8:38 pm

dominicbeesley wrote:Aha. I'll try TAB later.

No the serial port has been pretty straightforward. Thus is running the perl server under Cygwin.

Do you know is there any way of getting two usb com ports on those uControllers? Having hostfs and noIce at the same time would be immense!

That's a really good idea! I hadn't thought of that. I didn't write any of the driver code for the USB serial port, but I've been getting a better understanding of how USB works while trying to get an ATSAMD21 chip to act as a USB host for a keyboard, so it may be possible. This post suggests that you can do it with LUFA.

If we *can* get two CDC ports on the MCU, I wonder if the 9572 has room for the logic. My current dev build uses 65/72 macrocells and 43/72 registers, but that includes the &FDxx ROM. It's using 25 registers for the serial port, 15 for the SPI, and 3 for the bit-banged SD card access. Adding a second serial port would bring it up to 68 registers, which would be a tight fit, but I could possibly reduce the serial ports to half-duplex so they'd only use 17 registers each, so 52 total, which is only 9 more than I'm using right now.

For now, when you're using NoICE, you can always run HostFS on your Beeb's built-in serial port, or use UPURSFS for a speed boost (although it requires some tweaking to get it to stay in sync -- I couldn't get it to work, but sweh and various others appear to have).

I really need to start using MachXO chips instead of XC9500XL on my boards -- tons more registers to play with there!
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Mon Jan 08, 2018 11:40 pm

I'd vote drop anything that is JIM / PAGE FD related, as unearthed in a recent thread JIM is broken and two devices can't really share it.

If you could get two COM ports working that would be worth more to me than anything else!

I've had a quick test this past hour and it seems to work well (barring some wrinkles, see below). Issuing *OPT6,0 doesn't seem to cause any noticeable corruptions. At least not on the protracker tunes I've been trying it out on!

It's still (only) about as fast as MMFS, I reckon with a bit of tickling it might be possible to get it going a little faster. I'm not sure where the bottle neck is though, the client or the perl server?

I did find a bug(?) in TubeHost.pl, specifically in OSFILE/5/7 handling - if a file is not found then an error should not be generated but 0 should be returned (JGH, if you're around please could you confirm). I've not tried this yet with JGHs host code - should it work?

I've made a quick fix to TubeHost.pl, but not sure where best to post it. I've attached it here for reference, along with a diff.

D
Attachments
perl-server-db-fixosfile5.zip
(26.08 KiB) Downloaded 6 times

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Tue Jan 09, 2018 12:25 am

dominicbeesley wrote:It's still (only) about as fast as MMFS, I reckon with a bit of tickling it might be possible to get it going a little faster. I'm not sure where the bottle neck is though, the client or the perl server?

Mostly in the client, as far as I can tell. HostFS was written for a 19.2kb/s serial port rather than a 12Mb/s one, so it expects to have some time to process each character :)

I have a performance tweak that brings the speed up to something like 29kB/s on the BBC and 39kB/s on the Electron (which is weird, but I haven't investigated further); it tightens up the loop when loading a block of data from the port so that it basically just spins checking the status, and only processes the allowed escape sequences (esc-esc for a literal esc, and esc-&Bx to signal that the download is done) rather than using the full parser.

Releasing my code is a little complicated because I'm not allowed (work rules) to release anything unless it's under a recognized open source license. http://mdfs.net/Software/Tube/6502/Serial65.src says "This code may be freely reused, with acknowledgements", but I know the company lawyers would say that this doesn't allow me to make derived works or redistribute it. J.G.Harston, if you're around, is there any chance you could put one of the standard open source licenses on your code? (Assuming you are OK with people patching it and redistributing it, that is.) I just sent an email to ask as well.

In the meantime, if you want to try recreating my patch... In a nutshell, the changes are in .WaitLoadIO. You want to poll RxStatus until you see the RxRDY bit go high, then read RxData. If it's the 'esc' character, read another byte. If it's the 'esc' character, TubeHost is sending you a literal esc. If it's &Bx, the transfer is done. Otherwise loop back to WaitLoadIO. I also tried commenting out all the flow control stuff in .ReadData and .ReadDataOk, but I don't think that made much of a change -- improving the block read function in WaitLoadIO was a big help. I also had to make a copy of .CallCode (I called it .CallCode2) because the enlarged WaitLoadIO routine pushed it too far away from .WaitStart for it to be called with BCC.
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Tue Jan 09, 2018 12:47 am

Thanks Phil,

I started experimenting around the same area. I first tried just removing the twiddly status register stuff in .ReadData itself: that didn't do anything noticeable but I've not been measuring accurately (counting cursor flashes while as ~96K module loads in 5 chunks).

I see what you're getting at with the main transfer loop, I wasn't sure whether one had to check for esc/0 during transfers?

I was hoping that this might be a candidate for some DMA acceleration but as its a byte based protocol I suspect not without a lot of changes to the protocol...

Time for bed now.

D

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Tue Jan 09, 2018 1:27 am

dominicbeesley wrote:I see what you're getting at with the main transfer loop, I wasn't sure whether one had to check for esc/0 during transfers?

I was hoping that this might be a candidate for some DMA acceleration but as its a byte based protocol I suspect not without a lot of changes to the protocol...

Changing it to send a length value followed by the data (without any escaping) is probably what you need to do to enable DMA (and probably a tighter non-DMA loop).

Here's how the escaping works:

- The escape character is &7F
- If you see &7F &7F in the byte stream from the host, that should be decoded as a single &7F character.
- If you see &7F &Bx (i.e. the second byte can be &B0-&BF), that means that the transmission is done and you can return.

All sorts of other escape codes are used, but you won't see anything other than &Bx in WaitLoadIO.
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Tue Jan 09, 2018 10:40 pm

I'm mega-busy this week so won't have a chance for any in-depth tests of speed on the serial link but I will think about this when I'm on holiday.

I was going to have several transfer modes for the DMA

1) halt processor, seize the bus, transfer one byte in/out every cycle
2) NMI, trap NMI before cpu sees it, on leading edge halt processor, transfer a byte (one read/write)
3) IRQ, trap NMI, inspect a single port, check against a mask, if NE do transfer, else pass IRQ to processor

For your serial port, that would require adding an IRQ or NMI (configurable?) on RxD,TxD becoming active, clearing when RxD,TxD is read. That would allow for 2 or 3, I think for the serial port 1 is not appropriate.

I was going to add a configurable timeout for 2/3 (probably prescaler + 8 or 16 bit counter) which aborts the transfer if the next IRQ/NMI is not received in a certain time-frame.

For 2/3 to work though the protocol must be written in such a way that a block transfer is guaranteed to transfer a certain number of bytes a length byte followed by data would achieve that. However, any early termination would have to either time out or preferably send padding bytes followed by a termination byte or bytes (could be a checksum with a single abort flag bit, in which case it is not a checksum but an abort counter).

This all sounds a bit complex though and I can't see me getting the time to write anything that complicated in the next few months!

D

User avatar
myelin
Posts: 374
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby myelin » Tue Jan 09, 2018 11:06 pm

TBH I think the best way to implement really fast serial would be to connect the Pro Micro directly to your FPGA, or to use a spare CPLD pin from the serial board as a "byte available" flag (or two pins for "received byte available" and "transmit buffer is empty"). I can change the VHDL pretty easily to generate an IRQ or NMI when data is available, though, if you like -- it's probably just a matter of adding:

Code: Select all

bbc_nIRQ <= '0' when (elk_RXD_state xor avr_RXD_state_sync) = 1 else 'Z';


That'll hold the /IRQ line low whenever a byte is available.
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

dominicbeesley
Posts: 543
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: Fast serial port/SD card adapter for the 1MHz Bus

Postby dominicbeesley » Wed Jan 10, 2018 5:44 am

I'll have a go at hacking something together myself and let you know results before asking you to commit to anything. Even without DMA I need to work out if polling or NMIs would be better for block transfers.

I'd say for a general purpose serial port some sort of disable-able interrupts would be in order though :?:

[Anyway I need some sleep, it's 5:40 here and I've just spent the last 7 hours sorting a horrible bit of code out (for work) that has been a millstone around my neck for the past six months...release for test on Thursday. Nothing like leaving things until that last minute.]

D