6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed May 15, 2024 6:13 pm

All times are UTC




Post new topic Reply to topic  [ 56 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Tinker, 6502 in a can.
PostPosted: Mon May 01, 2023 9:24 pm 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
it comes in a can, it comes in a can.
ok, so an Altoid's Mint Can, the full size one, is usually just a few dollars and will hold a credit card or business card ok. so, that means business card PC. trying to make this 'apartment and hobby friendly';

WIP Shots!
Attachment:
rn_image_picker_lib_temp_f4cb9e21-747c-4679-83e6-22750c244fb0.jpg
rn_image_picker_lib_temp_f4cb9e21-747c-4679-83e6-22750c244fb0.jpg [ 441.57 KiB | Viewed 1333 times ]

Attachment:
rn_image_picker_lib_temp_19730c68-3cc0-4bb7-939d-827e865d54bb.jpg
rn_image_picker_lib_temp_19730c68-3cc0-4bb7-939d-827e865d54bb.jpg [ 619 KiB | Viewed 1333 times ]

any particular screen is TBD as of 5/14/23 for the Mark-I.

so a Dpad, and 4 buttons on the front with a 2.8" or so screen, mono speaker somewhere and/or a headphone jack.
lets call that "Type One" Im thinking of 3-4x AA batteries or a cell phone battery. idk yet

Display: a 2.5" to 2.8" lcd screen running an ST7xxx. we get a 128x64 LCD with a Neotech or Sitronix "driver" IC. The multicolor backlight is kinda nice for a few extra bucks., though I think I am fine with a White-on-Blue or Yellow-on-Black. I have done a lot of little maths and searches on available hardware, and a full-color screen would fit, you need a GPU for it though. For this design, the 6502 is basically just running the screen, input and simple audio.

Input: If you have the buttons on top of the Altoids can, 2.8" is about the limit you can hit. those ST77xxx chips can 6800 or 8080 in, and I guess I just prefer this to SPI or IIC. A few had MIPI or other controls, I guess I really want that more familiar console old school shared VRAM thing going? idk, Im open to ideas and this tin can might get a USB or serial port. probably not.

Design: as we further reduce the design to an MVP then you have a Screen Module, a ROM IC, a RAM IC, a system clock and support passives, a sound chip if possible and the 6502. It is likely to space concerns that the 6502, power clock and RAM will be on one protoboard, with a set of headers as busses to another porotoboard with the audio (and maybe power) and possibly ROM and the display connector.

Physical Constraints: This should all fit correctly. Even with PLCC sockets, on the perfboard, its too complex for most to wire up. This should be much easier to complete, workshop activity level. So a 6502 needs RAM, 128*64 = 8192, or about 8Kb. a 32Kb RAM IC is about $5 right now, and that would give plenty of program, screen and general purpose space for a device of this type. It is considered to put 2K of RAM nearest the 6502... 32K is half of 64k, which we will need some of for ROM on this as its not likely to have much I/O. A very simple SD card or Flash Card reader is proposed in several places here and on the web by 6502.org users; however, space constraints are very great and a very basic ROM chip (a socket is pushing it, so programmable by pin headers?) is probably all we get, and will need to be tested on a breadboard before final soldering and assembly, though here a plcc socket or such might work. 8Kb of ROM is $5, and 32K is about $11, so that is still approachable by many.

Sound a tone generator IC, or possibly a couple of noise diodes to use for drums, here we approach a cpu/video/storage/audio 'card' design with each IC on a perfboard, this is unlikely to fit though worth consideration. Most likeky, a single IC will fit on the secondary board, the 'back plane' of an SMD design vs Through Hole.

Software important to think about, a version of Oxide is unlikely though many routines may be developed.
    A side scrolling space ship game like the arcade game "Defender" or R-Type seems ok.
    An endless runner game, or something like "Pipes".
    A calculator, probably the start of a hex editor or monitor software later.
    An onscreen keyboard and notepad.
    A note reader.
    A music/chiptunes player if possible.


Bill of Materials
"under $100"
    $5-10___Perfboard and wire
    $5______Batteries/holder
    $20_____Screen
    $1-2____Speaker,
    $5-10___Buttons and d-pad
    $10_____6502
    $5+_____RAM
    $5+_____ROM
    $10_____discrete components

$65-85 total for parts, plus any tools or other supplies.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
History and Inspiration:
Atari Punk Console/Baby-8 Sequencer
I think it still needs a few things, however, this would be a 'DIY Dodo' type system, for under $100,

original message included a reference to another Tin-Can-Puter

whitespace_removed wrote:
Does anyone know, who this is?
http://www.sunrise-ev.com/6502.htm
are they a member here?
I am working on a very similar design, as described here.
viewtopic.php?f=4&t=7575
to the 'NameBoy' on the bottom of the page. Further exploration of the site shows numerous 'altoids can PCs' which I am working on right now.
I have several mint can electronics projects, a metronome/tone generator, a 'baby 8' sequencer and probably an echo/reverb effect or recorder/playback device. Just some modular stuff for making electronic music most people call noise. I also get to build a clock, gates and triggers, loops, counters and interface various ICs with an analog signal. Fun stuff. I have some designs from years ago I will pull up one of these days, really, a lot of this kind of stuff I post about more at EEVBlog forums instead of here.
copied over:
I think I can fit a 6502, a RAM with RTC, a 2.8" or so 320x240 color LCD, some registers or a 6522, support hardware etc in this space, I believe I saw a business card PC on the SBC- area of the site.
this suggests an even more simple design that the Chronos, which is a pretty maximized 6502 system that can probably take expansion cards and a GPS. the Chronos is meant to be used on jobsites, where you would not use a motorola Z-Fold. its the size of a tape measure and might have a good level and compass. It will do carpenter math better than a Construction Master Pro.
I will out math a Ti83. this isnt that.
some earlier notions, a spoiler tag would rock! wrote:
Id like to go to a bigger screen and hit 400x240, or 1/4th my Integrity screen size, this would require a larger enclosure and more hardware, it would require a proper GPU and certainly a PIC or other board controller. So that might be, a different system entirely, like the Chronos...Qronos... using the 'Q-series PIC... I like that; so there is as much reason to not have a PIC on this device as there is to include one. So to consider a "Mark-I Tinker" as an attempt at one of the most minimalist, proof-of-concept, teeth-cutting design possible, it is best to eliminate rather than incorporate features. In this, even the 'Q71 must be considered an 'extraneous chip', a luxury for fancy rich people and their color screens and USB... no,
_____________________________________________________
so this little idea. is a tin can. a sardine can (I have a couple) are closer to 3x4 inches. an Altoids can is cleaner and in this type of hobbyist project, traditional. really, there are several nice project boxes about on the web, and 3d printing might open a lot of doors; so should this expand then really one of the 4.5x7 inch boxes is about right, though beyond this project and delving into "IntegrityLite" territory
_____________________________________________________
if you put the screen on the inside of the lid, you can fit a 4-5" screen depending on its arrangement. I saw a really nice 3.5" or so 400x240 screen on digi or the mouse. it was not a lot more expensive.
so then your lid opens like a mini laptop and you have room for controls, speaker, more buttons etc.
lets call that "Type Two".

I might make both, I am almost certain to make type one, and possibly give it a few ports, idk yet. I want to avoid too many cuts on the front, and mounting to the front and running wires might be best, just a few drilling spots, and then glue might be enough. rather than cutting out the spots for the controls and screen.


Last edited by wayfarer on Sun May 28, 2023 5:37 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon May 01, 2023 10:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1686
Location: Sacramento, CA
Hi wayfarer

His name is Lee Hart. I do not think he is a member here.

Lee's designs are very minimalistic. I bought one of his 1802 computers which also fits in an Altoid's can.

Good luck with your project!
Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Tue May 02, 2023 12:20 am 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
8BIT wrote:
Hi wayfarer

His name is Lee Hart. I do not think he is a member here.

Lee's designs are very minimalistic. I bought one of his 1802 computers which also fits in an Altoid's can.

Good luck with your project!
Daryl


Thanks, I had thought they might have an account here. Yes, there are a ton of commonalities there and with my altoids can 6502, "Tinker" for TIn-Can-computER, and its as good a name as any for a project.
I added a couple of concept pics to the first post. Im not 100% of what Im putting in here, though this will end up being very close the Core unit I use in other projects later I think.

thanks again!


Top
 Profile  
Reply with quote  
PostPosted: Sat May 06, 2023 3:10 pm 
Offline

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

so the clock module at the moment is a common 555 design for a stable output on a square wave and a potentiometer for manual adjustment. This is a common design and readily available. Im not real happy with this, it is okay, yet has caveats and is easy to cause error.

Id like to create a clock based on a 32.768kHz can, broken out with a binary counter to its power-of-2s frequencies.
this is:

32768 full speed clock, used to the RTC
16384 sampling rate?
8192 this is pretty hard to hear and very whiny as a square wave. ~C
4096 a nice high tone ~C
2048 not bad ~C
1024 fair ~C
512 ok ~C
256 warm ~C
128 soft ~C
64 lowish ~C (will be on more speakers)
32 nice base ~C
16 rattle and pop, so no tone its below 20Hz
8 ok, this might be ok for actual visible breadboard clock
4 great breadboard clock
2 pretty slow breadboard clock
1 1Hz and some chips dont like this, Im not sure much is gained here
0 static

using this is ok: https://onlinetonegenerator.com/
Im just using the square wave as Ill probably get that out of a frequency divider.
so out of that, using the pins on the binary counter/divider, I want to step out individual frequencies.
so I would probably not use 8192, or maybe the 32 Hz, its pretty low and a lot of small speakers wont go that low..
these are all 'C' and a little flat. so its a 'monotonic scale' and unless I want to add more hardware, having a set of tones in
0 = 0, 1 = 64, 2 = 128, 3 = 256, 4 = 512, 5 = 1024, 6 = 2048, 7 = 4096
is a Byte to control sound, probably just as feeds into a mixer or such chip will allow some odd chords or simple music to be fed to a speaker, basically from the clock can. Id even say the 4096 tone is a bit on the high side.

for the low end of Pins coming out of our divider, 1, 2, 4 and 8, maybe have 32.768 and 0 in there, these are the clock speeds for the breadboard, and instead of a knob, Id use a jumper, DIP switch or maybe just have a button you push and it cycles through, so a single step button that acts as a 'Pause' maybe, and a clock speed step, 32768hz -> 0 -> 1hz -> 2hz -> 4hz -> 8? -> 32768hz, maybe just have a jumper or selector here.

I dont really need a variable knob to control my board speed, Id like discrete steps based on my RTC and to use those frequencies for basic I/O sounds like select, cancel or invalid choice/error.

so my first circuits will involve this clock circuit for a 6502 in a mint can


Top
 Profile  
Reply with quote  
PostPosted: Sat May 06, 2023 7:06 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
Quote:
8192 this is pretty hard to hear and very whiny as a square wave. ~C

The lowest-frequency harmonic content of a 50%-duty-cycle square wave of 8192Hz will be 24,576Hz, meaning you won't hear it, so the square wave will sound the same as a sine wave.

I think that with Schmitt-trigger CMOS gates these days, there's seldom a reason to use a 555.  The 555's output slew rate is not really suitable for a lot of digital work, and may cause problems with a WDC 65xx processor whose data sheet says the clock input's edge rate should be 5ns or faster.  I show a variable-frequency oscillator (VFO) I made for testing a computer's maximum operating speed at viewtopic.php?p=10619#p10619 .  It goes up to 73MHz.

You can get almost infinite variability in audio frequencies by implementing a numerically controlled oscillator (NCO) in software, even doing multiple frequencies at once; so you don't need to be limited to a hardware divide-by-two circuit.  See our topic, "Basic Project Advice for 6502-based Synthesizer?"

_________________
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 May 06, 2023 7:07 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 575
I have one of Lee Hart's 6502 boards, and it is indeed minimalistic.

http://sunrise-ev.com/6502.htm

I haven't bought his 1802 Altoids computer, but I have been sorely tempted.


Top
 Profile  
Reply with quote  
PostPosted: Sat May 06, 2023 8:00 pm 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
GARTHWILSON wrote:
Quote:
8192 this is pretty hard to hear and very whiny as a square wave. ~C

The lowest-frequency harmonic content of a 50%-duty-cycle square wave of 8192Hz will be 24,576Hz, meaning you won't hear it, so the square wave will sound the same as a sine wave.

I think that with Schmitt-trigger CMOS gates these days, there's seldom a reason to use a 555.  The 555's output slew rate is not really suitable for a lot of digital work, and may cause problems with a WDC 65xx processor whose data sheet says the clock input's edge rate should be 5ns or faster.  I show a variable-frequency oscillator (VFO) I made for testing a computer's maximum operating speed at viewtopic.php?p=10619#p10619 .  It goes up to 73MHz.

You can get almost infinite variability in audio frequencies by implementing a numerically controlled oscillator (NCO) in software, even doing multiple frequencies at once; so you don't need to be limited to a hardware divide-by-two circuit.  See our topic, "Basic Project Advice for 6502-based Synthesizer?"


I gotcha. Im not really wanting to stay with a 555, that is why Im getting the 32k can.
using a frequency divider or two, which is common for a real time clock, you count 100 of the last stage and that 'one second'.

because of this, I am going to utilize the existing 'breakout frequencies' to make simple beeps and boops at 64, 128, 256 Hz etc.
At some point, a real sound chip like the 76489 or an AY2612, etc. this is an altoids can with limited board space, so I will probably stick to just the plain monotonic C scale the 32k clock will give us. if I could find a divide-by-n counter, and I could have one frequency in and all the 'n' frequencies out between two frequencies, that would be really cool, like between 1024 and 2048, divide that range into 5 or 8 or 12 different frequencies and you can get a scale you can change octaves in easily

I think thats all too much for a tin can right now, getting a stable clock, and an RTC, with a few tones is probably plenty. just 4-5 'notes' on the buzzer.


Top
 Profile  
Reply with quote  
PostPosted: Sat May 06, 2023 8:01 pm 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
Martin_H wrote:
I have one of Lee Hart's 6502 boards, and it is indeed minimalistic.

http://sunrise-ev.com/6502.htm

I haven't bought his 1802 Altoids computer, but I have been sorely tempted.


I am building a 6502 in an Altoids can right here. Hope to be running by end of summer, at least showing a picture or some text and moving a cursor if I can get that far!
2"x3" perfboard for now.


Top
 Profile  
Reply with quote  
PostPosted: Sat May 06, 2023 8:11 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
If all you want is a square wave signal of variable frequency into a piezoelectric beeper, you can make the VIA's T1 put that out on PB7.  The number you put in T1's latch determines the frequency.  (This is mentioned also in Tip #17 in my "Tip of the Day" column where you'll get lots of other ideas as well.)

_________________
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: Sun May 07, 2023 3:47 pm 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
GARTHWILSON wrote:
If all you want is a square wave signal of variable frequency into a piezoelectric beeper, you can make the VIA's T1 put that out on PB7.  The number you put in T1's latch determines the frequency.  (This is mentioned also in Tip #17 in my "Tip of the Day" column where you'll get lots of other ideas as well.)

Ah, its not really a variable frequency Im after. if you had a 6522 and not a 32768 can with frequency divider and all these notes 'just sitting on these pins', yeah Id totally use the 6522 for those basic feedback 'bloops'. For me it is using the existing frequencies that are created by the 32768 clock and the accompanying frequency divider and putting them to use. I get a good set of C notes in different octaves, distinct enough to be useful, thats all.

if I could 'easily get' a scale in one octave, that would be great though unlikely. The notion of a divide-by-n IC, would be to divide by a number used on a common scale, between two frequencies, to create a scale in that octave, no programming, no cycles, n ram reads or register writes, just pure frequencies coming out of a crystal and divided. Why 'create' a frequency, when its sitting right there?
Id be mathematically synthesizing the tone, rather than programmatically creating the tone. It really is an interesting experiment I might use for a synthesizer in the future, though for now, it seems much overkill for the project. Im just trying to use a bunch of otherwise useless pins on a frequency divider and use those pins for my breadboard to make a few beeps and human-readable clock cycles.

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.
Im fine, just using 5-6 C notes I 'get for free' from the clock since Im using it for the breadboard anyway to run both my RTC and my CPU clock off different pins.

Really, though the VIA can produce notes, its overkill unless I use it for something else, same with any kind of frequency divider in the can itself. I might, maybe, put a 6522 on this board, probably not though, the board space is limited. Off the breadboard, I'll be running much faster, and I might not have the same hardware there, I dont think an Altoids can-puter needs a lot of low speed modes for its cpu clock, it should be running at 6 or 12 MHz or such. Whatever ends up compatible with the other chips I use.

and I do not intend for this to really 'connect' to much right now. Im not planning to use a 6522 in lieu of a sound chip, though its cool you can get a few tones out of it too. If I do not use the same frequency divider setup, then I need something else to make the notes used for user feedback. The 6522 would fill in there, still it would increase cost and complexity to add it.

I am very torn on adding the 6522, Im not overly impressed with it at this point. Its big and bulky and has a few bugs in it.
It is very versatile and can 'do lots of things'. Its a nice 'swiss army knife', yet I have no idea how I would use it at this point and designing to include it, is not wise.

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 cannot really 'program' the 6522, you 'instruction' the 6522 regularly. I do consider the 6522 to be a 'direct companion' to the 6502, as it provides a lot of I/O functions that the 6502 does not have, that say more modern designs have incorporated.

For this device, I dont know if I need one yet and it adds like $10 to the cost. Inexpensive, simple and easy to assemble for almost anyone, anywhere... actually, 'some kind' of I/O is probably desired, maybe a 'usb card' or such... even more reason to look at an MCU with usb built into it, since I plan to use that later anyway...

I guess its a good time to go over 'intended functions' of the device:

Practical:
carry around in my pocket and show to people as a conversation starter
to create a modular hobby DIY platform (much like many projects here)
to establish all or part of the Wayfarer Tech 65xx 'Core CPU Section'
(connecting to devices through a 9-Pin DIN or USB sounds 'educational')

Functional:
have a real time clock, with calendar on my little screen with several alarms and notifiers
play games on the tiny screen with the d-pad and buttons, very simple type games
read and type a little on the tiny screen, probably a hex editor or basic monitor type
(my phone does all of these things, yet often requires service or connectivity)

Possible:
play music (needs a sound chip and headphone jack?)
interface with a computer or other device (needs USB or rs-232 port etc and a control chip etc)


I hadnt planned on using a 6522, it adds a lot of complexity to the design, for an altoids can...
Im not certain I can justify adding one at this time, though Im just sorting out what kind of clock I want on my breadboard at this point.

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,
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.


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)

so the CPU doesnt really talk to other chips, it delegates that to the MCU, the CPU runs Binary Embedded Executable Files, code for the 6502. the MCU runs the 'DMA' or whatever, it gets interrupts and sorts them and does whatever it can first, then sends IRQ to the CPU only as needed. the CPU should look at RAM, run code, and send a command stack to the MCU to do, and go back to its running program.

The core loop in here is very 'game centric' and our OS is basically a

Code:
startup_sequence();

while(on){
 do input;
 do logic;
 do video;
 do sound;
 do I/O;
 do IRQ maintenance;
}

shutdown_sequence();

or something not much more complicated than that.
this gets into the OxideOS range of things though.



Parts I want to use:

WDC6502
2k or 8k TimeKeeper RAM or similar integrated RAM/RTC
(this will be determined by the vector used for the RTC so it doesnt interfere with the hardware RESET vector etc.)
2.8" 320x240 LCD screen with built in S7 type controller.
these are pretty cheap and okay, its going to be GBA level graphics, or NEO GEO pocket color, etc.
Probably 16k ROM, maybe 8K. It might be determined by an MCU instead.
a PSG maybe, its probably too much complexity for here.

So this little guy really is very minimal. I might swap an MCU, like a PIC18 or such instead, as it would have some ROM, and some shared RAM, and could do I/O, with timers and maybe USB depending on model...

So what I am doing, is leaving room in the board, so a version with a PSG, or a 6522 or a USB controller, or an HDMI/VGA out, or an FPGA chip... can be built. IDK if I want a 6522 on here, its huge for a 2"x3" board, and Im not sure what its needed for yet...


Top
 Profile  
Reply with quote  
PostPosted: Sun May 07, 2023 6:18 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8183
Location: Midwestern USA
wayfarer wrote:
GARTHWILSON wrote:
If all you want is a square wave signal of variable frequency into a piezoelectric beeper, you can make the VIA's T1 put that out on PB7.  The number you put in T1's latch determines the frequency.  (This is mentioned also in Tip #17 in my "Tip of the Day" column where you'll get lots of other ideas as well.)

Ah, its not really a variable frequency Im after. if you had a 6522 and not a 32768 can with frequency divider and all these notes 'just sitting on these pins', yeah Id totally use the 6522 for those basic feedback 'bloops'. For me it is using the existing frequencies that are created by the 32768 clock and the accompanying frequency divider and putting them to use. I get a good set of C notes in different octaves, distinct enough to be useful, thats all.

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.

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.

Quote:
if I could 'easily get' a scale in one octave, that would be great though unlikely. The notion of a divide-by-n IC, would be to divide by a number used on a common scale, between two frequencies, to create a scale in that octave, no programming, no cycles, n ram reads or register writes, just pure frequencies coming out of a crystal and divided. Why 'create' a frequency, when its sitting right there?

Id be mathematically synthesizing the tone, rather than programmatically creating the tone. It really is an interesting experiment I might use for a synthesizer in the future, though for now, it seems much overkill for the project. Im just trying to use a bunch of otherwise useless pins on a frequency divider and use those pins for my breadboard to make a few beeps and human-readable clock cycles.

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

Quote:
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.
Im fine, just using 5-6 C notes I 'get for free' from the clock since Im using it for the breadboard anyway to run both my RTC and my CPU clock off different pins.

Really, though the VIA can produce notes, its overkill unless I use it for something else, same with any kind of frequency divider in the can itself. I might, maybe, put a 6522 on this board, probably not though, the board space is limited. Off the breadboard, I'll be running much faster, and I might not have the same hardware there, I dont think an Altoids can-puter needs a lot of low speed modes for its cpu clock, it should be running at 6 or 12 MHz or such. Whatever ends up compatible with the other chips I use.

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

Quote:
I am very torn on adding the 6522, Im not overly impressed with it at this point. Its big and bulky and has a few bugs in it. It is very versatile and can 'do lots of things'. Its a nice 'swiss army knife', yet I have no idea how I would use it at this point and designing to include it, is not wise.

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.

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.

Then, use an MCU. At the risk of being rude, quit talking and start doing.

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


Top
 Profile  
Reply with quote  
PostPosted: Sun May 07, 2023 7:19 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
wayfarer wrote:
For me it is using the existing frequencies that are created by the 32768 clock and the accompanying frequency divider and putting them to use.
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 select which frequency will be output at any given time. And presumably you want the selection to be under control of the program running on the CPU. So, to get the beeps and boops you understandably crave :P you're gonna need some extra circuitry and some program interaction with said circuitry.

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").

-- 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: Mon May 08, 2023 1:07 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8183
Location: Midwestern USA
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

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


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2023 4:06 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
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.

wayfarer wrote:
GARTHWILSON wrote:
If all you want is a square wave signal of variable frequency into a piezoelectric beeper, you can make the VIA's T1 put that out on PB7.  The number you put in T1's latch determines the frequency.  (This is mentioned also in Tip #17 in my "Tip of the Day" column where you'll get lots of other ideas as well.)

Ah, its not really a variable frequency Im after. if you had a 6522 and not a 32768 can with frequency divider and all these notes 'just sitting on these pins', yeah Id totally use the 6522 for those basic feedback 'bloops'. For me it is using the existing frequencies that are created by the 32768 clock and the accompanying frequency divider and putting them to use. I get a good set of C notes in different octaves, distinct enough to be useful, thats all.

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.  Will that do the job?  (Actually, I see further down that you might want to do music with it.  You'll definitely need more speed to do that.)  But if it's a second oscillator (the first one being for the system clock), you're adding extra parts, right?  Actually, it sounds like you're adding an extra part for the divider anyway, and you'll probably want to have the software control it, which means there's still software.  Using a faster clock oscillator and using a '22, you can get up to about 500 times the number of instructions per second, generate the tones, and have a software RTC without additional parts, and still have a lot of I/O left over.  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.

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.

Quote:
I am very torn on adding the 6522, Im not overly impressed with it at this point. Its big and bulky and has a few bugs in it.
It is very versatile and can 'do lots of things'. Its a nice 'swiss army knife', yet I have no idea how I would use it at this point and designing to include it, is not wise.

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.

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.

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).

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.

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.

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)

so the CPU doesnt really talk to other chips, it delegates that to the MCU, the CPU runs Binary Embedded Executable Files, code for the 6502. the MCU runs the 'DMA' or whatever, it gets interrupts and sorts them and does whatever it can first, then sends IRQ to the CPU only as needed. the CPU should look at RAM, run code, and send a command stack to the MCU to do, and go back to its running program.

<snip>

So this little guy really is very minimal. I might swap an MCU, like a PIC18 or such instead, as it would have some ROM, and some shared RAM, and could do I/O, with timers and maybe USB depending on model...

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.

_________________
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 5:52 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 684
Location: Potsdam, DE
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


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

All times are UTC


Who is online

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