6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Sep 23, 2024 2:17 am

All times are UTC




Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Mon Jan 20, 2020 5:11 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 588
Location: Michigan, USA
Oh my goodness... Just spotted a big blunder thanks to BDD's comments. Replacing U10a with a pair of 74AC00 gates doesn't really shave anything off the propagation delay, however, driving the 74AC138 directly with the A15 and A14 lines provides a big gain...

My apologies for missing this, dani.


Attachments:
Decoder 2.png
Decoder 2.png [ 75.61 KiB | Viewed 1024 times ]


Last edited by Michael on Mon Jan 20, 2020 5:13 pm, edited 2 times in total.
Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 20, 2020 7:46 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 588
Location: Michigan, USA
dani, I just noticed your PIC 16F628A Frequency Counter in the updated schematics in post #2. If I had known you were familiar with PIC microcontrollers I would have suggested using a PIC for your Adjustable Clock circuit and display early on. Gosh, there are so many different ways you can generate, control, and display an adjustable clock. May I provide an example if your head hasn't exploded yet (grin)? This example would replace the 16F628A frequency counter and eliminate the 74ABT74 and the 74AC14 chips... The crystal is an Epson CA-301 8.388608M-C (DigiKey part # SER3415-ND, $0.83 each) which is used to provide a nice round 16.0-Hz increment for the PIC 20-bit NCO (Numerically Controlled Oscillator) module. If you order one of these crystals, would you get an extra for me, please? Also, I'd be happy to help with the PIC program (and programming if you don't have a PICKIT3 programmer).

Cheerful regards, Mike


Attachments:
Steve's ClockGen.png
Steve's ClockGen.png [ 193.74 KiB | Viewed 1018 times ]


Last edited by Michael on Mon Jan 20, 2020 5:13 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 20, 2020 8:48 am 
Offline

Joined: Fri Jan 25, 2019 2:29 pm
Posts: 192
Location: Madrid, Spain
Jikes! You've been busy tonight!

BigDumbDinosaur wrote:
I'm not sure how important performance is to you, but if it were me I'd be using a 74AC00 in place of the 74AC139 (U10). The average prop time of one section of an 'AC00 is about half of the 'AC139. This isn't too important a consideration with U10b, but could matter with U10a.


It's important, as I want to go as high as possible. Being my first take at an SBC, I won't it to reach too far. Moreover, once I connect my 74HCT6526, I'm pretty sure it will be the limiting factor. Anyway, as Michael pointed out later, going with an 'AC00 may not provide too much benefit. One of my first desings had 3 NAND gates to generate the /CS for the Ram.

DrJefyll wrote:
ETA: the output of U9a as wired is an active-high signal. Is that what the LCD module requires? Just checking...


Yes, it's active high. Also, I was just going through the datasheet for the LCD and don't think it can go very fast... don't really think it can even do 1 MHz! I may end driving it up with the peripheral ports in the 6522 or the '6526, so I can control its timing via software.

BigDumbDinosaur wrote:
I see a 74ABT74 is being used as the source for /PHI2 and PHI2. That flop should be a 74AC74


Agreed. All parts should be AC. I didn't pay too much attention at first to the logic family of the ICs and just focused on the logic. I have some early screenshots where I still have some LS ICs :oops:

Michael wrote:
Oh my goodness... Just spotted a big blunder thanks to BDD's comments. Replacing U10a with a pair of 74AC00 gates doesn't really shave anything off the propagation delay, however, driving the 74AC138 directly with the A15 and A14 lines provides a big gain...


Again... so obvious! Finding a solution is easy... Finding the optimal solution is an art.

Michael wrote:
If I had known you were familiar with PIC microcontrollers


Not at all. Actually, is the part I'm less familiar with of this whole idea, and I'm pretty unfamiliar with almost everything. The frequency meter is based on a cheap kit sold on Aliexpress, which is pretty much a rip-off of this. The kit comes with the PIC preprogrammed so, I'm just hoping I'll be able to adapt it to my needs.

Cheers!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 20, 2020 7:37 pm 
Offline

Joined: Fri Jan 25, 2019 2:29 pm
Posts: 192
Location: Madrid, Spain
DaniMolina wrote:
Yes, it's active high. Also, I was just going through the datasheet for the LCD and don't think it can go very fast... don't really think it can even do 1 MHz!


Sorry for quoting myself, but I wanted to clarify on this.

After digging through the LCD datasheet, it seems it may barely do 1 MHz, but I'm not even sure of that. The minimum time for the LCDE pulse is 230ns. The single addres line, and the R/W, have to be setup 40ns prior to that... so nay, I can't drive it from the main bus. What can you expect from a 2.5$ LCD display, shipping included!

I've seen a video from the 8-bit guy on which he connected an LCD to a C64. First, via the user port (So, driving it with the CIA) then via the expansion port, directly attached to the computer bus. Some glue logic was needed to make it work. He didn't go into details, but I'm guessing some latches maybe?

Anyway, I've attached the LCD to the 6526 PortA. I just feel like a real hardware engineer now. Just passed the issue to a poor software engineer :lol:

As a bonus, I'm posting my first attempt at the PCB.
Attachment:
pcb.png
pcb.png [ 1.66 MiB | Viewed 978 times ]


As usual, 10cm x 10 cm, 2layer board. The cheapest I can have manufactured. If I find it to work at low speeds, I'll probably get a 4-layer version afterwards.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 20, 2020 7:54 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8511
Location: Southern California
daniMolina, note that the common intelligent character LCD modules need more than meets the eye to make the setup work consistently. I cover this in the sample code linked in the 6502 primer, at http://wilsonminesco.com/6502primer/LCDcode.asm . The first time I used one of these LCDs, it was on a 65c02 computer that ran very slowly to conserve battery power (the entire computer only took 2mA, including the LCD), so it was ok to put the LCD directly on the bus; but after that, I always went through a 65C22 VIA. You can take the same code and modify it for your '26.

_________________
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: Tue Jan 21, 2020 1:51 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
A 230ns access time with 40ns setup should work on the 6502 bus up to about 2MHz, if you do it properly. The R/W and A0 signals are valid from the 6502 by the end of Phi1, which takes care of their setup time. Then you only need the access strobe to be qualified by Phi2.

Of course, if you want to run faster than that, you'll need to either insert wait-states, or insert some sort of buffer to isolate the device from the bus.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 5:09 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
An alternative to wait-states is Clock Stretching. Both are feasible, but Clock Stretching probably requires fewer IC's, assuming jelly-bean logic is used. In my RDY vs CLOCK STRETCHING post there's a clock-stretch circuit that requires just one 16-pin IC. And it lets you run your CPU at or near its full speed potential. :)

Tonight I updated the post, after realizing it failed to address daniMolina's requirement for extra setup time for the LCD. Others will face the same issue in future. The matter is now corrected. Extra sets of eyes welcome, but I think my Clock-Stretch mod solves the LCD problem, and still only requires one IC. As a bonus it's possible the capability for clock-stretching may also come in handy elsewhere in the project.

( I'm not necessarily arguing that this is the "best" solution -- "best" will depend on many factors. I'm just drawing attention to one possible option. )

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 9:58 am 
Offline

Joined: Fri Jan 25, 2019 2:29 pm
Posts: 192
Location: Madrid, Spain
So far, I've completely ignored RDY. I do have some notions of what it does and how it works, but don't fell too comfortable with it... yet :)

I'm going to keep the hardware side as simple as I can for now. The chances of nothing working at first are still high and the fewer things I have to troubleshoot, the better.

Still, I'm bookmarking your post. I understand waiting for slower devices is an elegant way of doing this kind of stuff, and will probably add this in a 2nd revision of my SBC, if I ever get that far.

Thx!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 4:16 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
I think these LCDs have always been a bit slow.

One of the ways Acorn's BBC Micro deals with slow devices is to hang them off a 'slow' bus which uses a VIA: one port is a data bus and (some bits of) the other port is an address bus. And perhaps a strobe... Anyway, it's a way to connect devices which demand a slower access.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 5:21 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
BigEd wrote:
One of the ways Acorn's BBC Micro deals with slow devices is to hang them off a 'slow' bus which uses a VIA: one port is a data bus and (some bits of) the other port is an address bus.

So basically you wire all your peripheral chips' data pins in parallel on the "data" bus, run two or three bits of the other port as the "address" bus for selecting registers, and use the rest of the bits for chip select (maybe through a '138 or similar if you need lots of CS lines)? That's clever!

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 5:37 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Indeed - but only slow devices which are not performance-critical! I think that turns out not to be a redundant description. For example, sound and speech chips need only infrequent access, as does the keyboard.
http://8bs.com/inbbc.htm#IC3

(The 2MHz Beeb also does clock-stretching to access 1MHz devices. The later Master uses RDY for the same purpose.)


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 5:44 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 588
Location: Michigan, USA
Have you considered using an LCD 'Backpack' of some sort? Serial, I2C, and various shift-register designs have been popular for years. I've even contributed a few designs. I'd like to think I came up with the first 2-pin shift-register backpack design that used 8-bit LCD interface mode (below).

Cheerful regards, Mike


Attachments:
K8LH 2-Pin Backpacks.png
K8LH 2-Pin Backpacks.png [ 52.87 KiB | Viewed 913 times ]
rc timing.png
rc timing.png [ 17.81 KiB | Viewed 913 times ]
LCD_2P8B_Class.ino.txt [4.13 KiB]
Downloaded 52 times
Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 8:22 pm 
Offline

Joined: Fri Jan 25, 2019 2:29 pm
Posts: 192
Location: Madrid, Spain
A solution very similar to this is shown, at least an schematic, in the 8-Bit Guy series on LCD screens part 2.

Attachment:
multidevice.PNG
multidevice.PNG [ 153.51 KiB | Viewed 901 times ]
.

Again, I think this makes for simpler hardware, more complicated software. Everything in this world is a compromise between different variables.

As the hardware is, for sure, my weakest point, at least right now, I'd rather stick with the simplest design. Don't get me wrong, I find your ideas brilliant, and I'm taking good notes of them.

Taking an optimistic note, if the LCD interface is generating the most debate here, that means the rest of my SBC is pretty much OK :lol: :lol:

Cheers!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 21, 2020 9:02 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1467
Location: Scotland
daniMolina wrote:
A solution very similar to this is shown, at least an schematic, in the 8-Bit Guy series on LCD screens part 2.

Attachment:
multidevice.PNG
.

Again, I think this makes for simpler hardware, more complicated software. Everything in this world is a compromise between different variables.

As the hardware is, for sure, my weakest point, at least right now, I'd rather stick with the simplest design. Don't get me wrong, I find your ideas brilliant, and I'm taking good notes of them.

Taking an optimistic note, if the LCD interface is generating the most debate here, that means the rest of my SBC is pretty much OK :lol: :lol:

Cheers!


I used this "trick" some (eek, 8!) years back on the Raspberry Pi. It works very well:

https://projects.drogon.net/wp-content/uploads/2012/07/pi2lcd.jpg

That image shows them in 8-bit mode, but 4-bit mode is fine too.

Be aware that the cheap "clones" often don't have the extra character RAM to allow user-defined characters...

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 23, 2020 6:11 pm 
Offline

Joined: Fri Jan 25, 2019 2:29 pm
Posts: 192
Location: Madrid, Spain
Updated schematics, with just some minor tweaks. A couple of gate swaps to improve on routing, and connected 6526 PB low nibble with 6522 PA low nibble, in the hope of creating a parallel communication port between them, using CA1, CA2, /PC and /FLAG as handshaking signals.

PCB is getting some minor updates too... but I'm pretty much satified with it. Pretty solid ground plane, almost no vias on main signals... and it looks nice too. I have exposed via a header PB4-PB7 from the 6522. I'm thinking about putting 4 push buttons there so I can have minimal input too.

Beside this, I don't expect anything much to happen for the next 3-4 weeks. I'm on the hunt now for all parts, and as they arrive, I'll start some test to validate the design.

I'll probably start with the following, in no particular order
- clock generator
- RAM bootstrap with arduino
- NOP loop, after filling the RAM with EAs
- Frequency meter
- Write something to the LCD

I want to leave you a question that's been around my head, let me know what do you thing. What are the odds (Assuming there're no errors in my design, of course) that an old, NMOS 6526 will work here? I know it's a TTL device againts an army of CMOS parts, however, I recall reading somewhere that, if there's no need to drive too many stuff, there's a chance a single TTL device has enough power to pull up strong enough to be able to talk with CMOS parts.

I guest the "by the book" answer is, no, it shouldn't work and probably won't. The real answer, I think, is somethine like a maybe, but unreliably. It may even depend on the specific 6526 I use. I have plenty to torture, so I will try it anyaway at some point :)

Cheers!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 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: