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

All times are UTC




Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Mon May 08, 2023 7:37 am 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
BigDumbDinosaur wrote:
wayfarer wrote:
GARTHWILSON wrote:
...

Four flops in “series” will give you 2048 Hz with a 32KHz oscillator. That would be approximately C7, which is a bit high-pitched, but distinctive. The lowest harmonic in its series would be 6144 Hz, which means it won't sound like a perfect sign wave, but it’ll be close.
this is exactly what I am talking about! using 7474s or similar (just more in one chip is good rather than several in 'ripple'/series), Im doing this to A) have a RTC, B) a Breadboard clock, and C) because its a long IC chain, I get those 'Cs' for free.
I rather like 1024, 512, 256, 128 and 64, thats 5 notes on a monotonic scale, really, 64/128, 256 or 512 and 1024 or 2048 gives 3 'distinct' high medium and low sounds. Somewhere in there, I think this 'nice side effect of my breadboard clock' got turned into more than it needed be, and Im very interested in this, outside of 6502 context per se.
I do not think I can fit all that on the 54x70mm perfboard for this project.

GARTHWILSON is correct in the use of the 6522 as a single voice frequency generator. As I am unlikely to use a 7474 or 74574 or 74273 or something on the tiny can board, the 6522 use is really very helpful and good advice, as it not only can recreate the 'free Cs' from the RTC (easy to do chimes eh..., I might build that as a edu-solder kit...), the 6522 can make any other frequency too. When I move to the can, I might do that to get back these 'lost tones'

BigDumbDinosaur wrote:
Another possibility would be to use an oscillator built with a comparator. You can easily get such a circuit to oscillate around 512 Hz (~C5) with a reasonably-size capacitor. I've used the illustrated circuit to generate audio frequency sounds in the C5 to C6 range. Change the capacitor to 0.0047 µF and you’ll get a 2 KHz output.

Im doing several smaller experiments over on the EEVBlog forums, and a lot of this sort of thing is definitely on the list of shirt term projects. Again, Im not trying to solve the 'create a human audible tone' problem, which leads to the next bit...

BigDumbDinosaur wrote:
wayfarer wrote:
if I could 'easily get' a ... The notion of a divide-by-n ... between two frequencies, to... use for a synthesizer in the future, ...

What, exactly, is your goal here? One minute you’re poo-pooing using the 65C22 to produce an easily-varied audio frequency, and the next minute, you’re bloviating about a synthesizer. Try hitting one target at a time—you’ll waste less ammunition. :D

the overall goal is to make a tiny 6502 in an mint can.
the immediate goal is setup a breadboard clock thats 'better' than the analog adjustable one built on 555s from the videos...

I noticed that in the course of doing so, to maximize the use of my RTC and a few frequency dividers, I get 'free C note sounds'

BigDumbDinosaur wrote:
wayfarer wrote:
I am 'slightly interested in yet see no real chip to use' for a frequency range divider. I think there is something I could do with a PLL and a divide-by-n counter. Really, very quickly, it becomes much easier to just use an actual Programmable Sound Generator.
...

Figure it out, man! Geesh! If you are worried about PCB real estate, go the op amp route. Those are available in SOIC packages.

In the course of becoming aware I could get 'free tones' out of my Clock circuit, and in discussing things here, it occurred to make a different project later, with an audio synth made with a PLL and divide-by-n counter.
If I can, Id use a PSG, if I could get one, a SN76489 or more likely a knockoff AY-3-8913 rather than any other solution, though as stated, there are a lot of ways to make an audible tone or 3. I would love, to get a 4 voice-channel PSG or similar. An old SID would be fun, though whatever I use, since I intend later to make this a kit/DIY-tutorial, I want it to be easily found.
it looks like you can get knockoffs of either on the 'bay, and they are under $2 each.

this is hands-down, near as I can tell, exactly what I want: SN76489 or SN76496
It does everything one could need for 8 bit audio, on a small package.
It is basically perfect and if I had to choose in I/O with a 6522 and a serial port, and this, Im not sure I can justify a 6522
the AY-3-819x series is 'a little better', though a bit more complex.

BigDumbDinosaur wrote:
wayfarer wrote:
I am very torn on adding the 6522, ...

It has a bug related to one mode of the serial shift register, which you likely won’t use. As for size, the WDC 65C22 is available in PLCC44. You can save space by forgoing a socket and soldering it directly to the PCB.

I am looking at that actually, not 100%, the through hole sockets will fit perfboard ok, breadboard ok, and are not bad to solder, a little worried about a bus and space for it, I'll see how it goes in the next step...

TinyGeniusPrimate wrote:
wayfarer wrote:
It can 'do a lot' yet requires overhead from the CPU, unlike using a MCU you can program a loop or two for and have it run its own code.

Then, use an MCU...

I might do that.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 7:38 am 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
____________________________________________________________________________________________

Dr Jefyll wrote:
wayfarer wrote:
For me it is using the existing frequencies ...

It's true you'd have a collection of useful frequencies "sitting right there," but don't forget you'd need to add some circuitry to ... and some program interaction with said circuitry.
.., it seems to me you'll want to consider going with a 6522... especially as it'd let you produce a scale (rather than just a selection of octaves)...
-- Jeff

yes Im looking at that for the breadboard, instead of like a potentiometer to select a 2, 4 or 8 Hz, or free running 32768 clock (since breadboards are slow) and since I was doing that anyway, Id use the beeps. I guess I could be clearer that Im doing the C-notes on the breadboard, because Im using my RTC can to double as my human-speed board clock. you are 100% correct that this would require extra hardware, and on my breadboard, because Im doing this anyway, it is convenient to do so.

"In the can", I really want a PSG the previously mentioned Ti tone generator,
its an altoids can, not the jobsite/kayak/hiking computer that takes PC Cards...

_________________________________________________________________________________________________

BigDumbDinosaur wrote:
Dr Jefyll wrote:
Since extra circuitry and program interaction are inescapable, it seems to me you'll want to consider going with a 6522... especially as it'd let you produce a scale (rather than just a selection of octaves), and this capability appeals you ("would be great").

Like a poor-man’s SID, :D


If I could get THAT kind of function out of a 6522, its worth it to include, unfortunately, the 6522 audio generator trick has but one voice, so suitable for beeps and boops, If Im adding a chip for sound, Im adding Sound Chip...

spoiler alert, Im adding a sound chip.
_________________________________________________________________________________________________


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 7:57 am 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
GARTHWILSON wrote:
First, I definitely like the size idea, although I might go for an ABS plastic box instead, as ABS is wonderful for milling at home with a Dremell tool and needle files, for slots, odd-shaped connectors, windows for display and keypad, etc., and for gluing.

totally get that, and see something like this as a 'user modification'. something at a Chain Store for under $2 would be okay I guess.
Altoids cans are 'traditional' and cheap and ubiquitous.

Quote:
wayfarer wrote:
GARTHWILSON wrote:
If all you want is ...

Ah, its not really ...

Is the 32.768kHz oscillator can feeding the system clock? That would be awfully slow, and you'd only get about 8K instructions per second, more or less depending on what you're doing.

yes, on my breadboard though. The logic ICs are in Narrow form, and not too big, its a simple circuit and yes, once you add the gate hardware to select notes (its likely to just be 3 tones or so) which is not a lot of read/write to turn tones on or off every 1/8th of a second or so... Mind you, Im just planning to do this on the breadboard, because I dont like a potentiometer based variable clock, I like stepping through a series of discrete choices, that circuit will be fun to build, I want to use TimeKeeper RAM, which has an RTC in MMIO addresses. so to get more used to that, I want to start with an RTC of some kind, there are several. If I can get TK-RAM, I'll use it 'in the can', for the BB, I want to stay simple. One of the first projects I intend to do, is just an RTC decoding to some 7-segment displays or such. Its good basic I/O and easy to see errors along the way.

So, because I am using the RTC and BB clocks off the 32768 can for now, and I need to breakout the frequency in a set of resettable hex or octal flip-flops, so I can get a clean , 1, 2, 4 or 8 Hz breadboard clock, I get these mentioned 'C notes' for free.

still, for just beeps and boops, the 6522 is probably better use of real estate and does a lot more tones. seems like the 6522 can pretty easily double as a single voice PC speaker driver too...

Quote:
Will that do the job? ... The exception on the RTC is if you want the RTC to keep running when the computer is powered down, with something like a 2032 lithium coin-cell battery running the RTC. An IC like that will usually be in I²C (probably not SPI, because it doesn't need SPI's speed), and you'd probably interface it by bit-banging the I²C through the '22.

yeah the TK RAM has a built in battery, its pretty cool and you can get a 2k or 8k chip for like $5, maybe $10 for the bigger ones. It gets pretty expensive at a point, users can choose to have more RAM, Im just wanting 'enough', cheap and not in conflict with 6502 vectors (one of the chips date or time values is right over the 6502 hardware vectors in $FFxx, so you cannot use that size.

I "do not like" either SPI or IIC, I am slowly opening up to various serial protocols, it makes sense in certain contexts and as I explore 1- and 2- bit computing. Still, I prefer parallel MCU access. I do not understand SPI RAM. Why is this exists?

Quote:
Quote:
The 6522 would fill in there, still it would increase cost and complexity to add it.

That's the only thing I have against the '22. When we were selling a product with an R65C02 and R65C22 in 1994-2007 or so, they cost us only about $2. Today they're $10, in a day when you would think ICs' prices would be dropping.

I might add one, it does do a lot... its really hard to justify in such a small device, with virtually no intended I/O
Quote:
Quote:
I am very torn on adding the 6522...

If size is an issue, you can get the PLCC package like BDD said, or even smaller, the PQFP. The only bug in the '22 is regarding using the synchronous-serial port with an external serial clock. It won't affect most users. You'll always find however that you'll wish for more I/O than you had planned for—at least I do.

I tend to agree. to what shall I interface the altoids can to?
I am reading the 6522, its a really powerful port expander and has a ton of functionality, with some tricks, you can run several devices off each port...
great timers... I think if I understand them, if you wanted you could take the lower bits of T1 (or T2?) and write those to an address with a latch and each 'pin' on that address would have the corresponding frequency, as each pin would change accordingly to output a lot of 'flat C notes', how often you refreshed those would create your playback/sample rate. Combined with the other Timer and maybe some other bits for noise, you can build a rather basic sound chip with several 'Cs' a single voice in any other note and a bit of noise. Mixing this can be done flat and sent to an op-amp. This would actually be 'good' PC speaker and a 'very bad' PSG. Still, I think you could pull off some basic melody and tunes with a 6522...

Id really rather have that 76489
Quote:
Quote:
It can 'do a lot' yet requires overhead from the CPU, unlike using a MCU you can program a loop or two for and have it run its own code.

You'll still have to have the '02 tell the µC very specifically what to do; so you'll have some programming either way. As far as generating beeps though, there's a minor amount of setup, and it will produce the tone without further attention from the processor until you tell it to stop. In that sense, it's like the '22 is running a loop internally.

yeah reading the data sheet, it can certainly meet and exceed the pinouts on a binary divider...
I think you can get that out of a 6522 as well, if your source clock is set up to be 32768 (or another good multiplier, such as NTSC colorburst which will grant 432Hz or "some people's" A7 evenly), you take the binary counter especially the lower byte, output that to I think a Latched Register that can be sent to a speaker, the refresh is the sample rate (should be twice highest note) and you AND that with different gates to play any of those 8 notes...

so, not only can I use the 6522 the way you mentioned, I think I can get it to do what I am talking about as well, with about the same amount of extra hardware... wasnt one of those 6522 bugs solved by a flip-flop? if so, the having a multi-gate IC, means if you have any left over, if yo have a counter running at all, you can break out a few beeps and boops, and only require a read/write operation during an update loop, and the instructions to turn notes on or off as needed. you would have your say, octal flip flop (on a board bigger than this) and use a few channels on it for a few extra notes.
so, the VIA can be a really crumby sound chip too, in more ways than one. I'll look further into this later. Beyond the single voice at any note you mentioned, you can get 'reference notes' pretty easy too.

Quote:
Quote:
(connecting to devices through a 9-Pin DIN or USB sounds 'educational')

How 'bout a DB-9? DIN is not very standard in the US (I think it was much more common in Europe), and my experience with round DIN connectors has been that they're kind of delicate, with the shells easily splitting or slipping off. A DB-9 was quite common for RS-232 (TIA-232-F).

that is exactly what Im thinking of and called it the other thing.
yes, an rs-232 serial port. I can cram one on here. Its in the images I am posting below. I have no idea, what I would connect this to.
USB sounds a lot more 'current user friendly', while the DB-9 is pretty cool and allows a lot of fun stuff, I have no idea what anyone would do with it these days, other than get in trouble...

Quote:
Quote:
I will possibly need a way to flash a ROM or load files, I figured Id use a memory card or just USB if I add it,
or just flash the ROM and use that,

Further down, you say 8K or 16K ROM. AFAIK, flash does not come in anything below 64K. That's not to say you need to use the whole thing of course; but if you use EEPROM, you don't flash EEPROM, because it's not flash memory. You just program it.

I was generically referring to both options and any others... 'encode' or 'program' is probably correct, Write to ROM is an oxymoron...
So, as I am not certain what form of Hard Storage, if any will be used, if it will be flash, a ROM chip, a ROM space on an MCU, an SD card, etc
what is the most generic term for 'make bits on chip align correctly'?

I do not know if adding software or changing programs will be possible without diassembly of the device... Im leaning toward an MCU with built in usb, or maybe a USB IC with charging and such.. I'll look into it

Quote:
Quote:
Im not sure if Im going to put an MCU on here to handle RAM/ROM and I/O yet, probably not, pin count is a concern here and Im not a big fan of SPI or I2C, Im more of a parallel guy I guess. idk, Im looking into it though, several chips I like use IIC or SPI (I think I prefer SPI maybe), though I still want to write to them directly, or have an MCU do that.

I²C and SPI serve different purposes, and many parts will be available only in SPI and many others only I²C. The ones where transferring files or other large amounts of data will be SPI, because I²C is just too slow for that.

I just have no room on this board to do much, even with the smaller packages.
On a full size system, you might have enough stuff for all of this... I am not certain I will have much if any devices to connect to, even ICs here...
Anything I build beyond an absolutely minimal system here, will really be done on another project.

Quote:
Quote:
When I think of system level design, and I get away from protocols, wires and timing, I think:

CPU (runs programs and OS calls)
MCU (runs the OS/board and puts everything else, ito RAM locations/'vectors' so the CPU can read them)
<snip>
...

We tend to use what we're familiar with. I've looked int the PIC18's a lot, but not actually used one yet, and I think my next step up will be bigger, to the PIC24's. I have brought many products to market with PIC16's though, and an super familiar with them and have a lot of code I've written for them that I recycle to make each subsequent project easier. Still, in 2021 I had to re-develop something to work on a PIC16 after I had done it a couple of years earlier on my workbench computer with the 65c02. Even though I had the previous work to go on (ie, the same thing working on the 65c02), doing it again for the PIC16 was much, much harder.


Id have to check the chart again, the PIC24 looks good for the 65816 in terms of similar data/address size, it can do a lot as a companion chip... the PIC16 or 18 is similar enough to the 6502, its not to recreate what a 65xx does, its to take loads off its back and organize whats coming in and do what it can
_____________________________________________________________________

barnacle wrote:
In ye olde days, there were a number of chips available which took in a 2MHz clock (or thereabouts) and divided it by some interesting numbers to give the twelve notes of the western scale. Many electronic keyboard instruments were designed using one of those and twelve binary dividers to generate the basic frequency for each key. It's possible they're still available somewhere... MK50240 sounds familiar, or M8071 rings a bell. There are probably others; these look to be going for very silly prices online used.

Neil


if these were not stupid expensive, this is basically what I was talking about doing, yet in my head, you would select on if the Reference notes and use that to create the octave from its frequency, these are basically the same things...
_______________________________________________________________________________________

Attachment:
imagepcb-footprint.png
imagepcb-footprint.png [ 40.17 KiB | Viewed 980 times ]


so this has 2x PLCC 44 sockets, a couple of placeholders for RAM and ROM, an oscillator can, a power jack, an RS-232 DB-9 Male(?), and a place for the ribbon to go to the screen, an 2 pin header for the speaker, it needs pins in for the buttons and an on-off switch, still its just to see how things fit.

I think Ill redraw tomorrow with a USB and room for the 76489 PSG instead... I simply have no real reason to include the 6522 on this design. (except I will probably use it later). For sound, Id use a PSG... I have real need for I/O on this.
CPU talks to RAM, Talks to Screen, Talks to sound IC, reads ROM, Reads and Writes to RAM, Reads 8 buttons for input...
Thats all it does I think, until you add some kind of storage (might not really change much or need a 6522), or I use USB (a USB chip is better) or a serial/rs-232 port...
anyway, yes you can fit one on here, though I am 'of a mind' that the 6522, and the db-9, are in 'user extension space' and I am more likely to add a headphone jack and a better sound chip personally, others might want a UART, or a better video chip, or more RAM or Storage, maybe an SD card slot instead...
Attachment:
image_board_parts_tinker.png
image_board_parts_tinker.png [ 108.89 KiB | Viewed 980 times ]


6502 on left, RAM in center, ROM on bottom left, the thing in middle left is the connector for the screen, it doesnt look right call it a place holder. 6522 on right, , Oscillator, power jack leads and a serial port under that. The Caps are for decoupling. Its not really right, it does offer some clarity on how much space there is...

I am very torn on the 6522, and am now very interested in A) putting one on here to gain experience, or B) building a desktop computer with one in it later...

idk, I want to keep scope down, make this as hobby friendly and approachable as possible, and be 'finishable' and 'startable' for young people, old people, people that have shaky hands or are bad eyesight, etc. This should really have a focus on 'what can you do with it' after its built, something missing out there in many places.

6502, RAM, ROM, RTC, Screen, Buttons, Speaker, Battery.

Adding a PSG would be 'real nice'. Adding a 6522 lets it...?


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 9:13 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
One thing I've done with the '22 is the recording and playback of sound, even music, using 8-bit A/D and D/A converters connected to its ports.  What I have not done, but thought about a lot, is actually calculating the waveforms in software.  It would take quite a bit of processing from one timer interrupt to the next, but I think a 65c02 running near 20MHz would have the processing power to combine quite a few complex voices and put the summed output out to a D/A converter, and potentially give you much better sound than any of the sound chips of yesteryear could, as long as it doesn't have to be doing multiplication and division.  8-bit audio can also give surprising quality, as show on the C64 at https://www.youtube.com/watch?v=UYAf_awh5XA .

Something else I have done is use the 65c22's synchronous-serial port free-running at a rate controlled by T2 as a 9-level D/A converter, which is like just a tad more than 3-bit, which is better that some talking toys.  See http://wilsonminesco.com/6502interrupts/index.html#3.3 .  It works out fine for speech with a lot of dynamic compression, but I don't remember if I've tried it for music.  That, too, would have to be highly compressed, and even then, it would sound pretty bad if you put a lot of instruments through it at once.  My original use for it was for DTMF for phone dialing in the 1990's, where you're only generating two frequencies of sine waves at a time.  It worked great for that.

Quote:
I think I can get it to do what I am talking about as well, with about the same amount of extra hardware... wasnt one of those 6522 bugs solved by a flip-flop?

Yes, you can get around the bug with a flip-flop; but again, unless you're running the synchronous-serial port with an external serial clock source, the bug won't affect you at all.  When you use the 6522's serial port, the more common thing is to have the '22 generate the serial clock, and have it controlled either by T2 or Φ2.  There's no bug in those five modes.

Quote:
USB sounds a lot more 'current user friendly'

USB is only more user-friendly to consumers.  It is definitely not friendly to hobbyists who are interested in controlling, customizing, troubleshooting it, building it onto perfboards, and making up their own cables.  The USB 2.0 spec is over 650 pages.  I don't know how many pages the latest spec is.  What might be somewhat friendly is if you use an adapter that converts USB to UART—and then you'll need a UART anyway, although you may not need the line drivers and receivers of RS-232.

Quote:
So, as I am not certain what form of Hard Storage, if any will be used, if it will be flash, a ROM chip, a ROM space on an MCU, an SD card, etc
what is the most generic term for 'make bits on chip align correctly'?

SD Card will be flash, and you could say something like "flash it," "write to it," "transfer the file to it."  But the term for EPROM and EEPROM is "program it."  EEPROM (with two E's, ie, electrically erasable) can be written to in-circuit, by the same computer that's using it, but the program to write to it will have to be in a different chip, as it takes many clock cycles per byte written, and the EEPROM is incommunicado during this time.

Quote:
I do not know if adding software or changing programs will be possible without diassembly of the device... Im leaning toward an MCU with built in usb, or maybe a USB IC with charging and such.. I'll look into it

You could do something like the tiny plug-in modules like I show in the middle of the front page of my site, http://wilsonminesco.com/ . I've done these with both SPI and I²C, with the SPI-10 connector and I2C-6 connector.  You'd need a way to put the data/program material into the module; but once it's there, you can have various ones for various applications and swap them out without being tethered to a host computer.

Quote:
Quote:
Quote:
Im not sure if Im going to put an MCU on here to handle RAM/ROM and I/O yet, probably not, pin count is a concern here and Im not a big fan of SPI or I2C, Im more of a parallel guy I guess. idk, Im looking into it though, several chips I like use IIC or SPI (I think I prefer SPI maybe), though I still want to write to them directly, or have an MCU do that.

I²C and SPI serve different purposes, and many parts will be available only in SPI and many others only I²C. The ones where transferring files or other large amounts of data will be SPI, because I²C is just too slow for that.

I just have no room on this board to do much, even with the smaller packages.
On a full size system, you might have enough stuff for all of this... I am not certain I will have much if any devices to connect to, even ICs here...
Anything I build beyond an absolutely minimal system here, will really be done on another project.

Um... That kind of conflicts with your preference for parallel.  Many of the I²C and SPI devices are available in SO-8 or even tinier packages, with far fewer connections than any parallel counterparts.  That's partly what these interfaces were designed for.

I've never bought Altoids, but I've seen other people pull one out of their purse and pop a mint in their mouth.  How much vertical space does it give you internally?  Sockets will eat into that space, and a display and keypad of any kind will take space too.  A very small dot-matrix display I've been interested in using is the Avago HCMS-29xx (5V) series which fit into skinny-DIP sockets and have 8 dot-matrix characters each, end-to-end stackable and daisychainable in their interface.  They're ridiculously expensive, so not practical for something to sell to a consumer market (only industrial or military); but for a one-off project where your time dwarfs the cost of materials, they're attractive in that they're so small and they let you make any characters that will fit in the 5x7 dot matrix of each character position, since you feed them the dot information.  I'm attaching a data sheet.


Attachments:
AV02-0699EN_2021-01-21.pdf [664.54 KiB]
Downloaded 23 times

_________________
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: Mon May 08, 2023 12:04 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
GARTHWILSON wrote:
USB is only more user-friendly to consumers.  It is definitely not friendly to hobbyists who are interested in controlling, customizing, troubleshooting it, building it onto perfboards, and making up their own cables.... What might be somewhat friendly is if you use an adapter that converts USB to UART—and then you'll need a UART anyway, although you may not need the line drivers and receivers of RS-232.

Actually, USB FIFOs such as the FTDI FT245 look pretty darn friendly to use, if I'm understanding the datasheet correctly. They appear as a USB serial interface on the host computer (the Linux kernel comes with drivers for these; Windows 10/11 either has them or downloads them automatically) except that it doesn't care about the baud rate and the like. On the device side you've got 8 bidirectional data lines, two pins to indicate ready for read and write, and two pins to strobe read and write. The chip has a 256 byte transmit (to host) buffer, and 128 byte receive (to device) buffer, so you can quickly load it up with data to send and need not worry too much about getting to it immediately when data become available.

On my List Of Things To Do is to add one of these one of my SBCs or microcomputers. The chip appears to handle 5 V TTL levels and the timings I think are fine for my little 8-bit systems (mostly running at 1-4 MHz), so I think it may work hooked directly up to the bus with just a bit of address decoding.

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


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 12:33 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1120
Location: Albuquerque NM USA
I have very positive experience with FT245 module. It enables minimal designs without need of a serial port device, but the downside of FT245 is about 10 times more expensive than the cheap CP2102 USB-serial adapter.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 1:40 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
plasmo wrote:
...but the downside of FT245 is about 10 times more expensive than the cheap CP2102 USB-serial adapter.

A while back I picked up three FT245 development boards for under $20, including shipping, from AliExpress. I just checked and prices for that seem still about the same. The cheap USB serial interfaces are about a third the price ($6 for three, including shipping), but then you still have to buy the UARTs as well.

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


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 2:52 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1120
Location: Albuquerque NM USA
Good to know Aliexpress has better price for FT245. I’ll buy a few; it is quite useful for high speed transfer, like video data for animation. Aliexpress’ CP2102 price is around $1.25, similar to eBay price.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 2:58 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
GARTHWILSON wrote:
USB is only more user-friendly to consumers. It is definitely not friendly to hobbyists who are interested in controlling, customizing, troubleshooting it, building it onto perfboards, and making up their own cables.

yea i can understand why you would think of USB as a black box compared to older communication standards, because it pretty much is.
but if that's a good or a bad thing depends entirely on the person asked.
and i can tell that you like being able to look deep into what is going on in your data lines and such, and USB is simply not made for that. but that doesn't mean it's completely unusable by hobbiyst.

GARTHWILSON wrote:
The USB 2.0 spec is over 650 pages.  I don't know how many pages the latest spec is.

why does it matter how many pages the spec has? the SD card's simplifed physical spec alone has 363 pages, but it's still a pretty common storage option for hobbiysts.
plus there is rarely a reason to even look at such spec sheets anyways since the most important information has likely already be extracted by someone else online. (though the more obsture the info you need, the more likely it becomes that you actually have to open some spec sheet)

and yes, the lowest layer you have with USB (the packet stuff) is way more complicated than dealing a UART (even the fancy ones), so if someone doesn't want to learn about all of that there are 2 options.
1. stick with a UART because it's simple to understand.
2. use some IC that does all the work for you. like the below mentioned FT245/FT240X
ironically those turn the entire thing around becuase they're actually much easier to deal with than a dedicated UART IC (both in terms of hardware and software).

plasmo wrote:
I have very positive experience with FT245 module. It enables minimal designs without need of a serial port device, but the downside of FT245 is about 10 times more expensive than the cheap CP2102 USB-serial adapter.

the FT245 module is quite expensive, but the IC itself is pretty cheap.
of course there is also my favorite, the FT240X... very similar features compared to the FT245R but at only half the price! (~2 USD instead of 4)
either chip are a great replacement for a UART if (like me) you'd never use the RX/TX lines for anything else besides connecting to a PC.


Last edited by Proxy on Mon May 08, 2023 6:16 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 3:14 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1120
Location: Albuquerque NM USA
Garth’s comment about vertical space remind me of this 2.1”X2.8” overclocked 6502 SBC, stacked 3 chips high.
https://www.retrobrewcomputers.org/doku ... ome:oc65r0

I don’t have an Altoid, but it may fit minus the CP2102 USB-serial adapter.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 3:21 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
that is both amazing and very cursed.

i wonder if you could take it to another level, instead of an IDE connector sticking out the side, have a CF Connector on the back with the card poking out over the PCB edge juuust enough that you can remove it without tools.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 5:12 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 984
Location: Potsdam, DE
My default standard is to install a six-pin connector (though only four/five are needed) which fits one of those handy FTDI breakout cables; provides power at 5v (note that the 3v3 version still provides 5v on the Vcc line!) plus convenient USB terminal comms with no issues. I've used the FT232 (or equivalent) on an old circuit in which I had to bit-bang the serial at 2400 baud.

GARTHWILSON wrote:
What I have not done, but thought about a lot, is actually calculating the waveforms in software. It would take quite a bit of processing from one timer interrupt to the next, but I think a 65c02 running near 20MHz would have the processing power to combine quite a few complex voices and put the summed output out to a D/A converter,


I think this would be possible, particularly if you kept the sampling rate to something like 16kHz. Additive synthesis from an existing waveform sample - normally a sine wave but it doesn't have to be, of course - is just a question of picking the next sample from the waveform, and that's just a question of adding modulo the desired output frequency. Not much more effort to do multiple samples rather than one, but it depends how complex you get with attack and decay which you'd want to manage without a multiply or divide... convenient that the ear hears logarithmically. Less convenient that the ear is incredibly good at hearing sampling noise, so the bigger the waveform the better, as a general rule.

I wonder if you could use the internal timers in a minimum pin-count arm or similar to generate a handful of convenient tones? Top of my head there are STM parts with four or more timers with four outputs each that can be assigned to pins...

Neil


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 6:02 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
Proxy wrote:
GARTHWILSON wrote:
The USB 2.0 spec is over 650 pages.  I don't know how many pages the latest spec is.

why does it matter how many pages the spec has? that is such a weird detail to bring up...

Garth is making the quite-valid point that USB is a very opaque interface and not at all hobby-friendly. If it takes 650 pages to describe how to get data from point A to point B, with points A and B separated by a few feet, someone has devised a very complicated “solution” to a relatively simple problem.

Quote:
the SD card's simplifed [sic] physical spec alone has 363 pages

...of which about 300 of those pages are what I’d classify as drivel. :D

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


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 6:44 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
BigDumbDinosaur wrote:
Garth is making the quite-valid point that USB is a very opaque interface and not at all hobby-friendly.

but again, it's a subjective thing. i think USB is hobbyist friendly enough to be used in projects, as example i use an FT240X for serial and a CH376 for mass storage. both chips give the benefits of USB (ie compatibility with modern devices/systems) but without the drawbacks of the raw interface.

BigDumbDinosaur wrote:
If it takes 650 pages to describe how to get data from point A to point B, with points A and B separated by a few feet, someone has devised a very complicated “solution” to a relatively simple problem.

i really doubt all of those pages are actually filled with useful information. also if simple data transfer is the whole goal, why was USB invented in the first place and toke over most other interfaces? it must've done something right... i mean even ethernet is using a packet system and it's just as widespread.
hmm, maybe it was just the raw speed it had compared to everything else at the time?

also, obviously off topic, but how fast could you make a UART run? aassuming you're using an FPGA for the controller+buffers, and diffirential pairs for the RX and TX lines... how much bandwidth could you get out of that?

BigDumbDinosaur wrote:
...of which about 300 of those pages are what I’d classify as drivel. :D

did you know that you're one of the only people on this forum who occasionally throws a word at me that i have to google because i have no idea what it means?
so today i learned what "drivel" is.
ah, the joys of a non-native english speaker :)


Top
 Profile  
Reply with quote  
PostPosted: Tue May 09, 2023 1:38 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
BigDumbDinosaur wrote:
Garth is making the quite-valid point that USB is a very opaque interface and not at all hobby-friendly. If it takes 650 pages to describe how to get data from point A to point B, with points A and B separated by a few feet, someone has devised a very complicated “solution” to a relatively simple problem.

I'd say this rather misrepresents both the problem USB is solving and the solution they came up with.

The problem is not as simple as it looks. USB is not just about "get data at relatively high speed (for the time) from point A to point B over a serial connection." That had already been solved much earlier via RS-422. But the difference from USB is clear if you try to go out and buy an RS-422 keyboard and RS-422 disk drive, plug them into a computer, and have them just start working. RS-422 doesn't handle power delivery, speed negotiation or automatic device description, nor does it provide a vast set of protocols about that for a wide variety of devices and data types.

If you wanted to do a simple implementation of just the differential serial signalling that RS-422 provides and make it work on any USB system you need to implement only a few pages of the USB 1.1 spec. For simplicity in your implementation you'll probably want to support only low-speed (1.5 Mbps) mode. Actually making it do anything after that you'll need to implement some of the basic discovery protocol (one or two dozen pages) and one of the USB device specifications (one or two dozen more pages). A few years ago I did a rough working-out of how one might implement a USB keyboard using a 6502 and a few other parts, and it wasn't too bad. Not quite as simple as the Atari 800's SIO interface, but not all that much worse.

That said, as a hobbyist you probably wouldn't want to do that unless you had a particular interest in USB, any more than you'd want to build your own CPU from gates. Just as you can simply go out and buy a microprocessor, you can go out and buy a chip like the FT245 that provides a very simple interface and does most of the work for you. And using that chip is significantly simpler than using a UART and setting up an RS-232-style serial connection, even if you run that at TTL levels. In fact, it's hard to think of a communications interface that's simpler, on either end (USB host or hobbyist-built board), than FT245.

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


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

All times are UTC


Who is online

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