6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 12:49 pm

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Feb 15, 2013 2:38 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
BigEd wrote:
... if the PIC controls the clock (maybe by toggling an output pin) then surely it's fast enough to control everything it needs to - it just needs to sort everything out between each clock toggle.

That's one of the things I'm curious about. If I drive the PIC with a 64-MHz clock then I have sixteen PIC instruction cycles to produce a 1-MHz clock signal with seven or eight instruction cycles to read and qualify the address. Can the PIC produce an uninterrupted 1-MHz clock and simply slow down the clock when necessary to handle one or two simple memory mapped I/O functions assigned to the PIC?

I think Garth is correct that the PIC simply is not fast enough to replace hardware I/O decode logic.


Chuck wrote:
... It sounds like this project I posted about. They use the PIC as ROM.

Those are some of the articles I read, too, Chuck.



Cheerful regards, Mike


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 15, 2013 3:32 pm 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
Michael wrote:
BigEd wrote:
... if the PIC controls the clock (maybe by toggling an output pin) then surely it's fast enough to control everything it needs to - it just needs to sort everything out between each clock toggle.

That's one of the things I'm curious about. If I drive the PIC with a 64-MHz clock then I have sixteen PIC instruction cycles to produce a 1-MHz clock signal with seven or eight instruction cycles to read and qualify the address. Can the PIC produce an uninterrupted 1-MHz clock and simply slow down the clock when necessary to handle one or two simple memory mapped I/O functions assigned to the PIC?

I think Garth is correct that the PIC simply is not fast enough to replace hardware I/O decode logic.


Chuck wrote:
... It sounds like this project I posted about. They use the PIC as ROM.

Those are some of the articles I read, too, Chuck.



Cheerful regards, Mike


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 15, 2013 3:38 pm 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
The fastest ADC on a PIC is 1 MHZ:
http://www.microchip.com/forums/m565767.aspx

PIC32 drives SID audio chip
http://dangerousprototypes.com/forum/vi ... =56&t=2197
http://dangerousprototypes.com/2011/04/ ... udio-chip/

My friend Brad over at bradsprojects.com/forum would help answer your questions because Microchip Pics are his thing.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 15, 2013 3:42 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Hi Mike
if you want to hit exactly 1MHz or make every clock cycle the same time, it will be more difficult. But if most of the time you're just checking that the address bus is not one of a few values, you're probably OK: clock low, wait, clock high, wait, check high byte of address bus, goto top of loop. Only if the top byte matches your special-case range do you need to do further checking.

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 15, 2013 8:09 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
If the point is just to see it work and not necessarily to get any speed out of it, then sure it will work.  I've thought about making (emulating) a 65Org32 with a PIC just so I could experiment with the instruction set and new assembler and try writing a multitasker and a Forth kernel for it, but I don't expect more than a small fraction of a MHz equivalent speed.

In your case, you're not emulating the 6502 itself, but there are still a lot of operations that must take place in every half cycle of the 6502.  There will be a tradeoff of course, with the fastest operation being if all you do is toggle the clock and do basic memory decoding (watching only the high address byte).  Additional jobs like having the PIC be the ROM and looking up bytes, or doing I/O operations (which also require looking at the low address byte and the R/W bit, or generating interrupts based on timers and I/O, will come at the expense of a lot of PIC instruction cycles.  And so far, we're not talking about keeping a constant phase-2 clock rate, as that would eat up a lot more cycles.

It sounds like a fun experiment though.

_________________
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: Fri Feb 15, 2013 9:49 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Garth (and gang),

I agree with your assessment. Some things however, like generating a 1-MHz clock output, can be handled quite easily in the background by the PIC PWM module.

I just read about another chap who used a propeller chip for video and keyboard but the 'overhead' reduces the actual clock speed of the 65C02 to around 100 kHz (yuch!).

I'm still looking forward to experimenting, though.

Regards, Mike


Last edited by Michael on Sat Feb 16, 2013 1:22 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 16, 2013 1:10 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
ChuckT wrote:
My friend Brad over at bradsprojects.com/forum would help answer your questions because Microchip Pics are his thing.

I just ran across Brad's site in December. I redesigned his old 8x8 LED "Great Race" game to run on a single PIC 16F1828 which I posted here, with his kind permission, of course.

Regards, Mike


Image
Image


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 33 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: