6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 10, 2024 7:25 pm

All times are UTC




Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Fri Jan 15, 2021 11:52 am 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
You have a clock domain crossing problem due to the inclusion of slow ROM, slow I/O and fast video. A partial solution to this problem is to shadow ROM. Meanwhile, people who have implemented systems without video advocate clock stretching. You are rightfully wary of this technique. The trivial case is incompatible with processor/video running on opposite clock phases. The extended case requires additional hardware which may not be suitable in your design. It might be helpful to enumerate a subset of possible options:-

  • Slow ROM: Anyone who is familiar with 1980s computer hardware will associate the magic figure of DRAM with 150ns RAS with an operating frequency of 4MHz. Using contemporary glue logic, 150ns ROM might obtain 5MHz. Budget 30ns for glue logic and CMOS loads, an extra 30ns if using 74x688 for address decode and 5ns per buffered parallel bus card. (Unbuffered cards count as multiple loads.) For your case, 200ns is optimistic and this may fail when all parallel card slots are occupied. Understandably, unshadowed slow ROM is not your preferred option. However, parallel boot ROM speed plus signal load limits the maximum operating frequency at boot.
  • Shadow ROM: In this case, the initial task of the processor is to copy firmware to RAM. This requires either booting the processor in a slow mode or clock stretching. Either technique may or may not be compatible with the video system. Thankfully, this is not a problem because the video system may be initialized after firmware is shadowed.
  • Boot with slow clock: Software defined clock speed. System boots at 4MHz or slower. Firmware is copied to RAM. Processor/video frequency is switched to faster setting before video is initialized. I am unnerved by this option because clock switching may create signal glitches which may crash a system and these are Heisenbugs which are difficult to replicate. It is also possible to switch to an absent clock and hang the system. Regardless, an idle system may be dropped to the minimum frequency to reduce energy consumption.
  • Clock stretching: This covers a subset of clock domain crossing. I don't find clock domain crossing intuitive. I suspect you don't find it intuitive either. Thankfully, the most important aspect is to recognize the problem rather than solve it. In particular, it is not often acknowledged that there are multiple tiers of solution. It is relatively easy to solve this for a single core system with no video. It is slightly more difficult to solve this for a dual core system with no video. Solving this problem with video divides into a number of cases which include a split bus (possibly with multiple banks of RAM), disallowing access to slow peripherals during video display, "snow" on screen and video memory which is not in the processor's memory map.
  • Split bus: Other systems may have an arrangement where video hardware has priority access to video RAM and the processor may concurrently access its own bank of RAM. The interleaved arrangement of 6502/6845 (and similar) makes this redundant. However, problems arise when 6502 is required to depart from this interleaving. This can be solved with tri-state buffers between the processor and the video RAM and, unfortunately, clock stretching. This allows the video system to make multiple accesses to video RAM while the processor makes one access to slow ROM or slow I/O. Specifically, without a Chip Enable signal, video RAM ignores addresses directed to slow ROM or slow I/O. Meanwhile, the video system never displays transitory junk obtained from unwanted sources.
  • Secondary bus: This covers a different subset of clock domain crossing. In this case, fast ROM and fast RAM are memory mapped but slow I/O is accessed via latches and buffers. Although timing glitches remain possible - especially with asynchronous clocks - there is no restriction on the frequency ratio between clock domains.

To handle the cases of boot ROM, slow I/O and consistent timer state, my personal preference would be fast ROM and a secondary bus. This requires minimal hardware and provides considerable flexibility. (I'm not adverse to memory mapping a serial ROM or using a toy processor to copy serial boot ROM into fast RAM. It is merely a matter of cost and reliability.) You may be inclined to shadow slow ROM, allow a processor to set its own speed and provide an interrupt handler to access slow I/O between video display cycles. This requires the least hardware and any deficiencies can be fixed in software.

BigaEd on Tue 29 Dec 2020 wrote:
if the clock isn't regular, is there any provision for fixed-frequency timer/counters?


The video hardware is in the fastest clock domain. It is typical for video hardware to generate vertical blank interrupts or horizontal scan line interrupts. Problem partially solved.

jfoucher on Tue 5 Jan 2021 wrote:
the only parallel ROM I could find that was not outrageously expensive was 150ns, so why couldn't it be at the other end of the bus ?


My suggestion for slow ROM directly adjacent to the processor covers multiple scenarios. In the first set of scenarios, a surface mount slow ROM may be shadowed (or clock stretched). Due to similarities of pin-out, a slow boot ROM may be at the bottom of a DIP fast ROM stack which possibly consists of one fast ROM in a ZIF socket. A slow boot ROM may also be at the bottom of a fast DIP RAM stack. Although the timing of the shadowed boot ROM is not critical, this arrangement minimizes the horizontal and vertical distance of the furthest RAM while also minimizing board area. In the final scenario, slow ROM and slow I/O may be on one side of a split bus while fast RAM is more closely associated with the video hardware.

Only one ROM must be executable at boot and that is the base firmware. For an automatically configuring parallel card bus system, all device driver firmware may be supplied on serial ROM. Whether or not the base firmware is shadowed in RAM, the device drivers can be transferred over a clocked serial connection and executed from RAM. This may require an additional fraction of a second to initialize but it significantly eases bus timings while reducing cost. To further reduce cost, all shadowed firmware may be de-compressed using one common algorithm.

Sheep64 on Mon 4 Jan 2021 wrote:
without space for video DRAM


There's a guy who makes a really compact 4MB Static RAM module. It requires less space than DRAM and it doesn't require refresh cycles. Indeed, by using such a module, a separate bank of video RAM may only require about one square inch.

Sheep64 on Mon 4 Jan 2021 wrote:
FPGA for video is a hedged bet


I briefly investigated Lattice Semiconductor's iCE40 FPGAs and now I understand why people are so enthusiastic about them. They are cheaper than 6502, faster than the official speed of 6502, work with fully open source tools which can be run from command line or Makefile. The largest variant currently has 7680 four input LUTs. Arlet's popular soft core requires about 4000 six input LUTs and this may or may not fit. This is probably not sufficient for a VIPER and VIC-II but it is definitely suitable for something like a Diablo engine and Atari ANTIC. Indeed, given the bus timings, there is an inherent compromise between processing and display. Therefore, creativity may be encouraged by deliberately avoiding a large, expensive FPGA.

cjs on Mon 4 Jan 2021 wrote:
I'm not sure that you're clear on the reasoning behind the 100×100 mm limit.


I briefly investigated board manufacture. Excluding introductory offers, excluding heavy metals which cannot be sold in Europe and excluding suppliers in countries where the natives murder each other in significant quantities or are otherwise likely to have disrupted supplies, the best I could find was USD115 for three credit card size boards. That might have been four layers and including air mail delivery. It was about half price with lead and cheaper with introductory offers. I was surprised to see a Japanese company listed but I assumed that it was a scam, outsourced or an introductory price. Actually, they all looked like scammers, spammy companies which spend heavily on advertising and intermediaries inflating the costs of lesser known parties. It makes me much more inclined to use a local company which I met at a trade exhibition. Even if it costs more than USD115, this is vastly preferable to having my bank account emptied and not receiving circuit boards.

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 15, 2021 2:48 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10976
Location: England
Sheep64 wrote:
You have a clock domain crossing problem due to the inclusion of slow ROM, slow I/O and fast video...

(possibly in response to the upthread comment
jfoucher wrote:
In my case, (and please tell me if I get something wrong) it would be possible to have a slow clock and a fast clock on the bus. The expansion slots would listen to the slow clock all the time. The CPU board would listen to the fast clock all the time except when an expansion slot (or it's onboard ROM) is selected.

)

Just to note, I would generally use 'clock domain crossing' for the case where two clocks have no synchronous relationship, which might be true here. But it need not be true: a fast CPU and a slow peripheral could be clocked using related clocks, such that the transition on one will come in a predictable place on the other. It's an easier case.

It was not uncommon in earlier machines for the CPU clock and the video dot clock to be related (by division) and was not uncommon to use a base frequency related to the TV colour burst frequency, to help with colour rendition on composite or modulated video. But I'm not sure this is what we're dealing with in this case. (Colour burst crystals were cheap too, I think, because of high volume manufacture.)


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 06, 2021 9:33 am 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
Finally, the prototype boards are in!
I'm quite happy with how they turned out. I'm still waiting on some components to be able to solder everything up. I'm quite impatient to try it out as you can probably guess.

Attachment:
IMG_2836.jpg
IMG_2836.jpg [ 2.96 MiB | Viewed 1504 times ]


From the top left we have the IO board with a 6522, PS/2 port, parallel port (VIA port A) and an SPI port with 7 slave selects, similar to the 65SBI specification but with the 12V power replaced with 5V. It has 8 onboard leds to display the port A value.

Then on the top right is a prototype board (I got 10 of these to be able to try out a few things)

Bottom left is the backplane itself, and then middle right is the serial board, which is just a 6551 with a header for a usb to serial adapter.

At the bottom right is the processor board, which includes a ZIF socket for ROM, a wide or narrow socket for RAM, a 16V8 to handle RAM/ROM address decoding and irqs, and the CPU at the bottom.

Hopefully more updates will come soon.

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 16, 2021 3:36 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
jfoucher on Tue 5 Jan 2021 wrote:
only parallel ROM I could find that was not outrageously expensive was 150ns


Was that on Mouser's website? I looked at similar parts and found USD80 components which should be USD6. Try using different criteria when searching for components. Or restricting criteria in a different order. I suspect this semi-broken search criteria is good for business. I can imagine companies with a purchasing department have staff who think "USD80 for one EEPROM? That's seems reasonable". But it also affects hobbyists. If I order the boards and you order the components, we could pay more than USD200 for a project. Whereas, if you order the boards and I order the components, we could pay less than USD100 for the same project. Beware!

I looked at your clock stretching circuit published on Sun 10 Jan 2021 and I'm quite impressed to the extent that I may implement a variation of it. I doodled something similar but it didn't occur to me that the 4 bit state could wrap around. Your implementation has approximately double range and is therefore the preferable one. As I understand, it normally transitions between 15 and zero but if a slow cycle is required, it counts from nine to 15 and then transitions to zero. It then alternates between 15 and zero until the next slow cycle occurs. Unfortunately, there is less than 30ns to signal that a slow cycle is required.

The variant I'm intending to use with 74HC161 has separate inputs to D0, D1 and D2. This loads the counter with 14, 13 or 11 and therefore provides separate +1, +2 or +4 ticks. Including the unstretched cycle, this provides a processor high phase with a total of 1, 2, 3 or 5 oscillator ticks. (Erroneous states may incur additional ticks but are otherwise not adverse.) Allowing D0 low effectively switches bus phases. This option is superficially incompatible with many video circuits, DMA systems or dual processor configurations. However, selective use of 74HC161 clock inhibit may switch bus phase back. Therefore, in a typical use case, a processor on a split bus may remain in the wrong phase until it accesses video memory.

Adapting this back into your design using 40ns tick (or thereabouts) and 74AC11 triple input AND gates, you could have three boards with +2 wait states and three boards with +4 wait states. I/O is preferably placed from one end to use the fast slots. Whereas, cheap ROM is restricted to the slow slots where it has 200ns (or more) to respond. By flattening the logic, as recommended by BigDumbDinosaur, you also have the option of an extra three boards with +1 wait state. However, this would complicate video. Perhaps you could have a "desktop" configuration with six slots and video and a "server" configuration with nine slots and no video?

BigEd on Fri 15 Jan 2021 wrote:
I would generally use 'clock domain crossing' for the case where two clocks have no synchronous relationship


Perhaps I have the wrong terminology but with the synchronous case, the slow clock is often divided down from the fast clock and therefore typically lags the fast clock. That causes similar hassle for the unwary.

jfoucher on Sat 6 Feb 2021 wrote:
prototype board (I got 10 of these to be able to try out a few things)


Very prudent.

Overall, I really love the StarTrek Voyager Isolinear look. My efforts related to PETSCII and double height characters exclude many interface choices but I have been careful to not exclude an LCARS interface.

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 16, 2021 4:02 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10976
Location: England
Ah yes, clock skew might be the term for that: a relatively fixed phase offset, which might in a helpful direction or an unhelpful direction.

Sometimes, instead of dividing a clock, it's better to use a clock enable, or a pulse-suppression tactic. But it still might introduce an extra gate delay.


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 21, 2021 10:06 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
Hi everyone, an update on this. I have received most of the chips I was waiting for, so finished putting everything together today.
The design called for an ATF16V8 on the processor board to handle incoming interrupts and onboard RAM and ROM decoding. However they seem to have been misplaced in the mail. I was tired of waiting, so I decided to use one GAL22V10 instead. 4 pins float outside the board, but it doesn't really matter.

Well after all that, I am really pleased to report that everything works perfectly (over serial only for now) with only 3 or 4 bodge wires :mrgreen: Two of the boards (backplane and IO board) actually have none! :shock:

I am also very pleased to report that thanks to your help, the clock stretching circuit works like a charm. I have installed a 25 Mhz crystal (fastest I had) and everything runs at about 12.5 MHz without a hitch (so far). Only one wait state is necessary for the ROM.

Next step is to get the PS/2 keyboard working, which should not take very long since I already have working code, but will have to wait until next week because it's already late here and tomorrow is Monday 8)

All in all I am very pleased with how it turned out and very grateful to all of you for your help in getting to this point.

I have attached a picture of the computer running forth over serial.


Attachments:
IMG_2848.JPG
IMG_2848.JPG [ 204.4 KiB | Viewed 1397 times ]

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.
Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 21, 2021 10:18 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10976
Location: England
Well done!


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 22, 2021 1:12 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8480
Location: Midwestern USA
jfoucher wrote:
Hi everyone, an update on this. I have received most of the chips I was waiting for, so finished putting everything together today.
The design called for an ATF16V8 on the processor board to handle incoming interrupts and onboard RAM and ROM decoding. However they seem to have been misplaced in the mail. I was tired of waiting, so I decided to use one GAL22V10 instead. 4 pins float outside the board, but it doesn't really matter.

Well after all that, I am really pleased to report that everything works perfectly (over serial only for now) with only 3 or 4 bodge wires :mrgreen: Two of the boards (backplane and IO board) actually have none! :shock:

I am also very pleased to report that thanks to your help, the clock stretching circuit works like a charm. I have installed a 25 Mhz crystal (fastest I had) and everything runs at about 12.5 MHz without a hitch (so far). Only one wait state is necessary for the ROM.

Next step is to get the PS/2 keyboard working, which should not take very long since I already have working code, but will have to wait until next week because it's already late here and tomorrow is Monday 8)

All in all I am very pleased with how it turned out and very grateful to all of you for your help in getting to this point.

I have attached a picture of the computer running forth over serial.

Excellent! It's always a relief when your new contraption works.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 01, 2021 8:01 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
I am putting up some documentation little by little on a website dedicated to the Planck 6502

Any feedback is welcome, as usual.

And another thing, I would like to ask if anyone would be interested in trying it out, I can send an assortment of boards to you for the cost of postage (I have a few leftover from my order). These are prototypes and two boards will need to be corrected with a couple of bodge wires. I can also throw in a few SMD passives if you don't have them.
Just message me if you'd like to take me up on this offer!

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 03, 2021 11:56 am 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
Now officially open hardware certified: https://planck6502.jfoucher.com/news/20 ... certified/

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 03, 2021 12:10 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10976
Location: England
Well done Jonathan, this looks really nice!


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 03, 2021 2:48 pm 
Offline

Joined: Mon Feb 15, 2021 2:11 am
Posts: 100
jfoucher wrote:
Now officially open hardware certified: https://planck6502.jfoucher.com/news/20 ... certified/


Congratulations!


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 03, 2021 4:40 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Excellent... very nice layout and design. Two thumbs up for the cert as well!

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 04, 2021 5:09 pm 
Offline
User avatar

Joined: Sun Dec 27, 2020 11:12 pm
Posts: 94
Location: France
Thanks for the nice comment chaps !

_________________
Jonathan Foucher

Take a look at the Planck 6502 computer.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 11, 2021 1:52 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
Firstly, I am utterly astounded by your rapid progress. A friend is following your progress closely and is similarly impressed.

Secondly, the most major concern that I have about your design is that the fixing holes of the backplane are not symmetrical. And if that's my major complaint then you should probably ignore it because I have no issue with anything more significant.

Thirdly, I am very interested in running a Planck with a MCL65+ temporarily or permanently in the processor socket; possibly running an increasingly ludicrous virtual machine. Unfortunately, my ability with hardware is vastly behind my ability with software. In particular, I am unable to solder surface mount components or flash CPLD. If you can solder the smallest components and flash firmware then your project is worth more than a Gigatron or RC2014. Specifically, if you can do the most fiddly bits, can I send you USD200 via Western Union? And if there is a firmware update for the video system, can I send you a video card to be re-flashed?

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: