6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 20, 2024 9:35 am

All times are UTC




Post new topic Reply to topic  [ 430 posts ]  Go to page Previous  1 ... 10, 11, 12, 13, 14, 15, 16 ... 29  Next
Author Message
PostPosted: Fri Feb 01, 2019 7:28 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
drogon wrote:
backspace119 wrote:
I do have a UART on board (the 28L92 DUART) and it's wired up to a MAX238 that's then wired to a DSUB-25 connector for RS-232. (it seems to handle 2 RS-232 connections, but I'm not presently using the second one, so I could unwire it and use the second channel of the DUART for something else) Here's a picture:



You may want to consider a header for a TTL output to use with a usb <-> TTL serial adapter as these are considerably cheaper than true rs232 usb serial adapters.

That's essentially all I use - and my whole board is powered via the USB 5v supply too.

(and I'd go 9-pin just for size - also no PC made in the past decade has a 25-way serial port)

(or any serial port for that matter)

-Gordon



The way I was seeing it, the RS-232 connector would be more robust, (although I will have to get the USB to RS-232 connection) and I'm planning on powering the board from 12v and regulating to 5v on board, then supplying the 12v line to certain peripherals. I'll switch it to the D-SUB 9 connector though, to save space as you said. I just need to find the pinout of it.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 01, 2019 7:33 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
Quote:
since polling a lot of devices may be costly.

Like it says in the interrupts primer, you will typically have very few interrupts enabled at once, and there's no point in wasting time polling for interrupts that aren't enabled. Your software could use an editable list to go through, or even self-modifying code, and put it in order of priority, which might take into account the frequency and urgency of the interrupt. I was looking at how the Apple IIGS did it, and was appalled by the extreme overhead. Since you're not building a full-on general-purpose personal computer, that level of complexity can definitely be avoided.

Quote:
I'll switch it to the D-SUB 9 connector though, to save space as you said. I just need to find the pinout of it.

That's in my RS-232 primer.

_________________
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 01, 2019 7:49 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
GARTHWILSON wrote:
Quote:
since polling a lot of devices may be costly.

Like it says in the interrupts primer, you will typically have very few interrupts enabled at once, and there's no point in wasting time polling for interrupts that aren't enabled. Your software could use an editable list to go through, or even self-modifying code, and put it in order of priority, which might take into account the frequency and urgency of the interrupt. I was looking at how the Apple IIGS did it, and was appalled by the extreme overhead. Since you're not building a full-on general-purpose personal computer, that level of complexity can definitely be avoided.

Quote:
I'll switch it to the D-SUB 9 connector though, to save space as you said. I just need to find the pinout of it.

That's in my RS-232 primer.


Man you have a primer for everything. Thanks for the link, I didn't know it existed.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 01, 2019 9:17 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
drogon wrote:
You may want to consider a header for a TTL output to use with a usb <-> TTL serial adapter as these are considerably cheaper than true rs232 usb serial adapters.

I'd just do this. 3 wires tied to a header. As Gordon said, this is your 99% use case. Why spend the money and complicate the build.

At this point, the serial line is a means to an end, it's not even really a driver of what you really want out of this project anyway. Even more a reason to make it a second class citizen.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 01, 2019 10:11 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
whartung wrote:
drogon wrote:
You may want to consider a header for a TTL output to use with a usb <-> TTL serial adapter as these are considerably cheaper than true rs232 usb serial adapters.

I'd just do this. 3 wires tied to a header. As Gordon said, this is your 99% use case. Why spend the money and complicate the build.

At this point, the serial line is a means to an end, it's not even really a driver of what you really want out of this project anyway. Even more a reason to make it a second class citizen.



These are very good points. I think what I'll do is, I'll use one of the channels from the DUART on a pin header for USB to TTL, and one for RS-232 (just for connecting devices that may use the interface in the future) I don't have to buy the USB-RS232 adapter at the moment, only the max238 and DSUB 9 connector (I've not looked up the dsub connector but iirc the max238 is a couple bucks).

This means I could, potentially, go for the max 232 (I think that's the model) that only does one RS232, and may be cheaper.

I suppose I am overcomplicating this project with my hopes and dreams, I can always build another, more capable system, down the road.

The USB-TTL line should get me up and running with a terminal on my PC, and then I can work on programming the basics into it, and getting it ready to handle its own IO (keyboard, character display, and later, audio and video).

Any thoughts on the audio/video questions I posed earlier? I'm mostly looking for daughterboards vs no daugtherboards.

Also, the hardware mini project section has an area on LCDs, and it shows hooking up A0 to the RS of the LCD, wouldn't this count as running a processor bus off board? Should I instead put that behind a via or similar?


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 01, 2019 10:19 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1466
Location: Scotland
backspace119 wrote:

Also, the hardware mini project section has an area on LCDs, and it shows hooking up A0 to the RS of the LCD, wouldn't this count as running a processor bus off board? Should I instead put that behind a via or similar?


Putting it behind a VIA port decouples any timing issues that it might have. You can also use an 8-bit port to drive it in 4-bit mode - assuming the usual Hitachi displays

But... for debug an initial board bring-up, a serial line is very easy to use.

-Gordon

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 01, 2019 10:27 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
drogon wrote:
backspace119 wrote:

Also, the hardware mini project section has an area on LCDs, and it shows hooking up A0 to the RS of the LCD, wouldn't this count as running a processor bus off board? Should I instead put that behind a via or similar?


Putting it behind a VIA port decouples any timing issues that it might have. You can also use an 8-bit port to drive it in 4-bit mode - assuming the usual Hitachi displays

But... for debug an initial board bring-up, a serial line is very easy to use.

-Gordon


When you say serial line, are you talking about to my PC for the terminal? That is my plan, to use that first for all of the setup of the board, and move on to having it stand alone later. The display I found is 40x4, and it's slightly different from the Hitachi one, but seems compatible. it has 2 E pins instead of one, the first one controls the top 40x2 and second one controls the bottom 40x2. I suppose I could put it behind one bit of one of the vias for the RS, this may be a stupid question, but would using a simple inverter decouple it too? (as in !A0, so I access the registers at their compliment's address).

Here's the datasheet for the display: https://www.mouser.com/datasheet/2/291/NHD-0440AZ-FL-YBW-40611.pdf


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 01, 2019 10:52 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
If you are going to buy a MAX232 consider the MAX3232 - it's capable of running at 3V and 5V.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 01, 2019 10:56 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
I've used the 40x4. It is essentially two 40x2's, one above the other.

drogon wrote:
backspace119 wrote:
Also, the hardware mini project section has an area on LCDs, and it shows hooking up A0 to the RS of the LCD, wouldn't this count as running a processor bus off board? Should I instead put that behind a via or similar?

Putting it behind a VIA port decouples any timing issues that it might have.

Yes. In the past these have hardly been fast enough to put on the 6502 bus even at 1MHz; but from your data sheet, it looks like they've sped it up somewhat since then. Still, it's not very fast; and if you want to use it later with a bus speed of 8 or 12 or 16MHz, you'll definitely need to go through the VIA.

Quote:
You can also use an 8-bit port to drive it in 4-bit mode - assuming the usual Hitachi displays

I show this in the circuit potpourri page of the 6502 primer, at http://wilsonminesco.com/6502primer/potpourri.html#LCD, with a link to working code, http://wilsonminesco.com/6502primer/LCDcode.asm . There is a trick to getting a reliable reset that works every time, so don't ignore it. Note that one VIA can be used for lots of things at once, as I show in the primer. VIA #1 on my workbench computer handles:

  • keypad
  • LCD
  • parallel printer
  • beeper (soldered to the board, under the top trio of ferrite beads seen in the last picture above, using the whole board as a sounding board)
  • real-time clock and calendar (from T1 interrupts)
  • I²C port
  • abort button
  • enable for the A/D converter
  • synchronous-serial port for the front-panel connector to an external frequency/event counter and also shared with the connector to the external circuit for the oscilloscope raster graphics

Yes, that's all one VIA, and these are connected all the time.

It's always nice, I think, to have at least a minimal display of some kind on the board, for debugging.

If you have ±12V on the board anyway, you can use the 16-pin MC145406 triple line driver and receiver which saves board space compared to the MAX232 & siblings because it does not need more pins for the capacitors for charge pumps.

_________________
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 01, 2019 11:06 pm 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
GARTHWILSON wrote:
I've used the 40x4. It is essentially two 40x2's, one above the other.

drogon wrote:
backspace119 wrote:
Also, the hardware mini project section has an area on LCDs, and it shows hooking up A0 to the RS of the LCD, wouldn't this count as running a processor bus off board? Should I instead put that behind a via or similar?

Putting it behind a VIA port decouples any timing issues that it might have.

Yes. In the past these have hardly been fast enough to put on the 6502 bus even at 1MHz; but from your data sheet, it looks like they've sped it up somewhat since then. Still, it's not very fast; and if you want to use it later with a bus speed of 8 or 12 or 16MHz, you'll definitely need to go through the VIA.

Quote:
You can also use an 8-bit port to drive it in 4-bit mode - assuming the usual Hitachi displays

I show this in the circuit potpourri page of the 6502 primer, at http://wilsonminesco.com/6502primer/potpourri.html#LCD, with a link to working code, http://wilsonminesco.com/6502primer/LCDcode.asm . There is a trick to getting a reliable reset that works every time, so don't ignore it. Note that one VIA can be used for lots of things at once, as I show in the primer. VIA #1 on my workbench computer handles:

  • keypad
  • LCD
  • parallel printer
  • beeper (soldered to the board, under the top trio of ferrite beads seen in the last picture above, using the whole board as a sounding board)
  • real-time clock and calendar (from T1 interrupts)
  • I²C port
  • abort button
  • enable for the A/D converter
  • synchronous-serial port for the front-panel connector to an external frequency/event counter and also shared with the connector to the external circuit for the oscilloscope raster graphics

Yes, that's all one VIA, and these are connected all the time.

It's always nice, I think, to have at least a minimal display of some kind on the board, for debugging.

If you have ±12V on the board anyway, you can use the 16-pin MC145406 triple line driver and receiver which saves board space compared to the MAX232 & siblings because it does not need more pins for the capacitors for charge pumps.


I was looking at putting -12 on the board, but, honestly, I have a 350w 12v PSU just sitting doing nothing right now (came out of a 3D printer that I put a 24v PSU on) so I was probably going to use it to bootstrap myself here, rather than buying another (save maybe $20-50). When I get closer to putting everything in the final package, I may switch it if it won't fit in the case I make, although it's also nice that it has a fan that turns on when it gets hot, so I could use that to pull air over the components as well.

I may include a spot for -12 on the board, just to remain future proof, but at the moment I'm going to plan for only 12, so I may go with the MAX232.

As far as an LCD on board....I have been considering getting some small 7 segment displays to plug into a "debug port" that could show what's on the busses. This would really only be useful if I implemented a clock control circuit to manually step the processor though (this may actually be worth it, since I don't have a logic analyzer)

At any rate, this monstrous LCD could possibly fit on standoffs over the board itself, rather than using a big ribbon cable.

Lightning EDIT: Also, I'm planning on running a seperate 5v regulator powered from 12v for the LED backlighting (max draw is about half an amp) is this a good idea or overkill?

GaBuZoMeu wrote:
If you are going to buy a MAX232 consider the MAX3232 - it's capable of running at 3V and 5V.


I'm planning on using straight 5v everywhere, so having it operate with 3.3 won't be necessary, there may be some components I have to shift down to 3.3 for, but if possible, I want to stay at 5.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 02, 2019 2:01 am 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
So, from what I've seen with USB-TTL RTS and CTS are optional, do they function as hardware handshake if I include them? Because if so, I'd like to include them.

I found this on amazon and it has a lot of pins for things like CTS, RTS, DTR, etc. Should I use something like this? or go for one of the simpler 4 wire ones (and cut the power wire out of it)


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 02, 2019 5:24 am 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
Ok so, I've wired the display to a VIA. I've opted for an 8 bit data bus on it and after reading the datasheet for the 65c22 I'm a bit comfused. It seems to say that PORTB pins don't work like PORTA pins when it comes to input, I believe it means their data cannot be latched with a signal on CB1 like on PORTA, this shouldn't affect normal read operation with the display though right? I know that in the notes on displays, Garth has said you don't necessarily need to read it, but I figured I'd give it the capability, so I can write to it as fast as possible (which still isn't that fast). I have PORTB0-7 wired to D0-7 on the display, and I'm planning on using PORTA0-3 for RS, E1 and E2 respectively.

Is there anything wrong with this setup?

On an unrelated note, I've been considering putting a second 65SPI on board. My reasoning is this: I'm considering SPI flash/eeprom on board as long term storage, and I'm also thinking about putting the audio and video daughter cards (if I do it with daughter cards) on the SPI chip as well. This leaves me 5 more SS lines on that chip, which I can definitely find uses for (I could break them out to a GPIO header for SPI, or put more chips on the board (I know what everyone is thinking right now, "PLEASE STOP ADDING CHIPS", at this point, I'm only adding the stuff I originally set out to do, OR things on SPI, since SPI is so simple and reliable and easy to work with.)) I want to use the 2nd 65SPI for the "cartridge" system for loading in games/programs. I'll have at least EEPROM/flash on each cartridge, possibly some NVRAM (score data and the like) and I'll have 6 more SS lines for other things I may want to add on to cartridges.

I know I'm acting like a kid in a candy store here, but I'm looking at the very real possiblity of having the PCB made with OSHPark, who has a min order of 3 boards, and I'd like it to be as expandable as possible for the first build, so I don't have to have more boards made (and I can potentially reuse boards for my next builds).


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 02, 2019 5:38 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
backspace119 wrote:
Ok so, I've wired the display to a VIA. I've opted for an 8 bit data bus on it and after reading the datasheet for the 65c22 I'm a bit comfused. It seems to say that PORTB pins don't work like PORTA pins when it comes to input, I believe it means their data cannot be latched with a signal on CB1 like on PORTA, this shouldn't affect normal read operation with the display though right?

You can always read the port, any bits you have configured (via the data-direction registers) to be inputs; it's just that on port B, you won't get automatic read handshaking. I've never used the automatic handshaking capabilities of the '22, for either read or write, or for either of the ports. Every time I've used the CA1, CA2, CB1, and CB2 pins, it has been for something else. The LCD has no way to do this hardware handshaking anyway, so it's irrelevant here.

_________________
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: Sat Feb 02, 2019 6:03 am 
Offline

Joined: Sat Jun 04, 2016 10:22 pm
Posts: 483
Location: Australia
Serial handshaking is completely optional, as far as I'm aware. If you want to use it, you'll need to tell both ends, or things may not work. If the handshaking connections are in place, but handshaking is not being used, those signals will get ignored.

It looks like you're thinking differently to the way I would, but you might not need two 65SPIs.
The way the slave selects are set up on the 65SPI, they actually work as general purpose outputs; they mirror the bit pattern in the SSR, so you could put a 3-to-8 decoder on them(for example), and get 8 selects out of 3 lines from the chip.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 02, 2019 6:20 am 
Offline

Joined: Fri Jan 25, 2019 5:40 am
Posts: 346
Location: Knoxville, TN
DerTrueForce wrote:
Serial handshaking is completely optional, as far as I'm aware. If you want to use it, you'll need to tell both ends, or things may not work. If the handshaking connections are in place, but handshaking is not being used, those signals will get ignored.

It looks like you're thinking differently to the way I would, but you might not need two 65SPIs.
The way the slave selects are set up on the 65SPI, they actually work as general purpose outputs; they mirror the bit pattern in the SSR, so you could put a 3-to-8 decoder on them(for example), and get 8 selects out of 3 lines from the chip.


That's actually a really good idea, especially considering that addressing multiple SPI chips at once is not very common (or possible? I forsee contention on the SO line if it's a read in this case). so I guess I can get some extra SPI without the extra SPI chip, which will save board space and make things cheaper and cleaner.

Thanks!

So then, I can forget the extra 65SPI (I'm getting 2 from Garth, I'll save the other for a rainy day), but I am actually looking at another addition.

Originally, I was going to look into the capability of the 28L92 to generate a square wave clock output on OP3 to use as a jiffy timer, with a very specific frequency. Doing this, I could time the processor's clock on startup like this (psuedo code since I'm not entirely familiar with opcodes yet):

    Set register X to 0
    wait for IRQ
    set flag in memory (or possibly on the processor's P reg)
    RTI
    LOOP branch on flag, INCX if flag is set
    JMP LOOP
    IRQ comes back in, back to ISR, now with a value in X

I can then use the value of X to see how many clock cycles were completed within the given interrupt time (which is a well known clock rate) and know the CPU clock without much trouble, and be able to display it (for grins) and use this info to form "delay" commands that can accurately delay for a set amount of time (only to be used when we can't be doing something else useful)

The documentation for the 28L92 is, to me at least, very dense. I believe I could eventually get it set up correctly to do this and be able to time the processor off of it, and use it as a general purpose "jiffy" interrupt afterward. But I got to thinking, if I put a RTC in the machine, I could have accurate date/time AND this kind of functionality without much extra effort, since most RTCs are set up to do square wave/alarm/interrupts like this already. This would remove the need to rely on a chip like the 28L92 to be able to time the processor clock, and probably be a more resilient solution in case anything ever changes.

The one issue is, it appears most of the THT RTCs that have nice time keeping and battery backup have a multiplexed address/data bus, which could complicate integration into the machine. I've found a total of 1 chip that has parallel busses, but I don't think it keeps time with power off, and I'm not sure what its accuracy is (it seems more like just a timer chip, although I'm not even sure about that, the datasheet on it is absolutely horrible (is Epson bad about data sheets?))

Thoughts anyone?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 430 posts ]  Go to page Previous  1 ... 10, 11, 12, 13, 14, 15, 16 ... 29  Next

All times are UTC


Who is online

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