6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 7:07 am

All times are UTC




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Wed Nov 11, 2015 4:24 pm 
Offline

Joined: Wed Sep 23, 2015 8:14 pm
Posts: 171
Location: Philadelphia, PA
cbscpe wrote:
If you use 15ns GALs then you could look for Quarter Power GALs they are quite efficient and consume only 55mA worst case.

I can only find the quiet GALS in 20ns, so I figured I'd start with the 15ns units. Both use too much power for battery operation AFAIAC.

cbscpe wrote:
I really doubt that the performance impact of many wait states for the IO register data cycle is relevant to the overall system performance. I'd really want to measure that and compare it to a solution that uses a 65C22 as interface between the 6502 bus and the AVR and needs to poll for ready. On the other hand I still have this idea in mind to convert Daryls SPI using Xilinx 95xx to an ATF1504AS. That would be definitively the fastest solution.

Given that the SPI clock can run quite fast (up to 8MHz in the case of PIC-SPI), I think if you add up the AVR interrupt latency, plus the time required to service the interrupt, that you're talking about a lot of wait states at 14 MHz 6502 clock rate. I'll wager that your maximum transfer rate will be less than half of what the PIC-SPI can do, even with the faster AVR instruction time. Additionally, you'll completely lose your 6502 during maximum-speed transfers as the bus will be 100% utilized during that time.

You'd probably be better off making some kind of DMA engine with the AVR to transfer from memory to the SPI device directly. I may go in that direction once I've got a basic PIC-SPI running. In any event, the wait states involved in setting up the DMA transfer won't hurt nearly as much in this case.

I haven't looked into it myself, but it's possible that a Cypress PSoC may offer a the best solution. They run natively at up to 5V and have a limited amount of programmable logic on them which is connected to an 80 MHz ARM Cortex M0. I think it should be possible to set something up equivalent to the Microchip PMP peripheral and then implement your own I/O device without any great effort. You will have the best of both worlds at your disposal -- programmable logic and microcontrollers.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 3:41 pm 
Offline

Joined: Wed Sep 23, 2015 8:14 pm
Posts: 171
Location: Philadelphia, PA
External events have kept me unusually busy of late, and are threatening to continue to do so for the next few weeks. However, I did find the time to put together an initial implementation of what I'm calling PIC-SPI and checked it into Github here: https://github.com/jason6502/pic-spi

The checked-in code has not been tested, and despite being based on working PIC-UART code is likely to have bugs. It may be some time before I am able to properly test it. So I decided to publish it on Github now rather than wait until it's fully tested in case anyone else would like to play with it. It is significantly simpler than PIC-UART, and as a result I expect it will work at considerably higher 6502 bus speeds in polled I/O mode. In interrupt-driven I/O mode, there should be no practical bus speed limitations at all. The maximum SPI clock frequency supported by the PIC is 8 MHz, which is I believe faster than a 14-MHz 6502 is capable of driving the bus anyway so is not really a practical limitation.

Given the sporadic availability of time over the next few weeks, I will probably concentrate on making some documentation (build and usage) for PIC-SPI and PIC-UART on Github in order to make it easier for anyone who wishes to try either project out.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 6:30 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
jmp(FFFA) wrote:
The maximum SPI clock frequency supported by the PIC is 8 MHz, which is I believe faster than a 14-MHz 6502 is capable of driving the bus anyway so is not really a practical limitation.

Using an '816, if you can make the address decoding so the transmit & receive registers respond to a range of addresses for the same register, you could use MVP or MVN to copy a set of bytes to or from memory at one every 7 clocks, if it helps any. That would allow an SPI clock even higher than the '816's Φ2. One might ask, "Why? You still have to do something with the data. What's the difference between picking it up from the SPI or from memory?" But I've used SPI flash memories that write a block of 1KB at a time for example, and while they're writing, they can't take any more commands or data until they're done writing several ms later, so there's a delay when the processor could be accessing data that's already in memory, or getting the next block ready to send out.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 6:45 pm 
Offline

Joined: Wed Sep 23, 2015 8:14 pm
Posts: 171
Location: Philadelphia, PA
GARTHWILSON wrote:
Using an '816, if you can make the address decoding so the transmit & receive registers respond to a range of addresses for the same register, you could use MVP or MVN to copy a set of bytes to or from memory at one every 7 clocks, if it helps any. That would allow an SPI clock even higher than the '816's Φ2.

OK, so with the right hardware setup it looks like you could make use of a SPI clock up to 16 MHz with a 14 MHz Φ2 on an '816. Far be it from me to ask, "why?" as there are almost always benefits associated with higher speeds. But, and I think I've mentioned this this tangentially before, why not make another, "PIC-DMA" peripheral in order to come up with a general purpose solution which would work not only with the '816, but with virtually any CPU with an 8-bit bus? I'm sure I'd have to go with a 40-pin DIP package (or any of several SMT packages) as additional I/O pins would be needed, but there could be some exciting possibilities opened up by such a device -- blitting and DMA-based I/O are the first things to pop in mind, though I suspect one could also do things like implement an off-chip FPU as well in order to speed up some types of computation.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 6:52 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
That would be great too, much better in some applications, although the MVP/MVN method is interruptible so the processor can service other things at the same time with practically no effect on interrupt performance.

If you get ambitious enough, it would be great if you would offer your 65-family I/O, DMA, and related products for sale, long-term, ie, not just get an initial order for a few and quit.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 7:24 pm 
Offline

Joined: Wed Sep 23, 2015 8:14 pm
Posts: 171
Location: Philadelphia, PA
GARTHWILSON wrote:
That would be great too, much better in some applications, although the MVP/MVN method is interruptible so the processor can service other things at the same time with practically no effect on interrupt performance.

In combination with an MMU, it should be possible to get the best of both worlds. But I suspect that is something best implemented with an FPGA.

GARTHWILSON wrote:
If you get ambitious enough, it would be great if you would offer your 65-family I/O, DMA, and related products for sale, long-term, ie, not just get an initial order for a few and quit.

The web is littered with projects where someone produces something neat in a burst of energy, maybe distributes a handful of them over the next year or two, and then fades away never to be heard from again. Sometimes they get taken over by someone new, but that is less common. I had hoped to avoid this by publishing full source code, decent documentation, and good instructions sufficient to allow anyone with a cheap ($50) programmer, PC, and internet access the ability to make as many of these devices as they may care to. I figured anyone with the skill to put together a working computer would surely have no trouble with this. Where does our thinking diverge?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 7:39 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
(I fully support your idea of putting your project materials out there for anyone to build! Even if you also decide to sell kits or built products - you're unlikely to lose many sales, and you were never going to make a fortune anyway. It's a good backstop, to have the data out there, it allows the project to survive even if you lose energy or interest.)


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 8:07 pm 
Offline

Joined: Wed Sep 23, 2015 8:14 pm
Posts: 171
Location: Philadelphia, PA
BigEd wrote:
(I fully support your idea of putting your project materials out there for anyone to build! Even if you also decide to sell kits or built products - you're unlikely to lose many sales, and you were never going to make a fortune anyway. [...])

Yes -- it is not my intention to make money doing this. For that I have a day job. This is just a hobby for fun. I was curious to understand if Garth was thinking there was some other reason I should be selling hardware possibly related to sustaining the project?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 8:22 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
Every time someone contacts me about buying a SRAM module, they ask, "Do you still sell these?" They have obviously been conditioned by the fact that people do things in a burst of energy as you say and then lose interest and move on. I tell them, "Yes, I should be able to supply the modules as long as the SRAM ICs are available, which should be a long, long time." (In fact the last batch I bought was at less than half the price of the first, so I have reduced the module price.)

I am all in favor of open-source code; but in the case of programmable logic, I don't see myself being able to take the time anytime soon to learn to use it even if it's published. I would much rather buy a pre-programmed part.

In the case of a PIC microcontroller, I probably need to find a more modern programmer to buy. The one I use for PIC16's is home-made (but production-worthy, with the ability to have the software set the voltages for program and test). I recently bought another programmer so I wouldn't have to write new software (since the PIC18's programming method is radially different), but the programmer came with only Windows software, not Linux, so I sent it back. I won't use Windows ever again.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 8:35 pm 
Offline

Joined: Wed Sep 23, 2015 8:14 pm
Posts: 171
Location: Philadelphia, PA
GARTHWILSON wrote:
In the case of a PIC microcontroller, I probably need to find a more modern programmer to buy. The one I use for PIC16's is home-made (but production-worthy, with the ability to have the software set the voltages for program and test). I recently bought another programmer so I wouldn't have to write new software (since the PIC18's programming method is radially different), but the programmer came with only Windows software, not Linux, so I sent it back. I won't use Windows ever again.

Thank you for sharing your thoughts. Regarding programmers -- the Microchip PICKIT 3 (http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=pg164130) is an in-circuit debugger and programmer available from many sources for under $50. Furthermore, it works in conjunction with the free MPLAB X software produced by Microchip (http://www.microchip.com/pagehandler/en-us/family/mplabx/) which runs on Windows, Linux, and MacOS. It also programs all of Microchip's PIC products, including PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC, and PIC32 series now and will continue to be updated to support future products as well (but for how long I cannot say). By way of disclaimer, I have no affiliation with Microchip other than as their customer.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 19, 2015 9:16 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
I do remember looking into it. There was a reason I decided against that one, but I don't remember what it was.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 38 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: