electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » Thomas Henry designs
AY-Voice is Underway
Post new topic   Reply to topic Moderators: Scott Stites
Page 1 of 7 [154 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2, 3, 4, 5, 6, 7 Next
Author Message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Mon May 28, 2012 5:27 pm    Post subject: AY-Voice is Underway
Subject description: A Pilgrim's Progress
Reply with quote  Mark this post and the followings unread

Hello all,

I decided to start a new thread for this so that it begins with the actual design rather than the philosophical meanderings of the previous announcement of a couple years ago.

Here's what we're shooting for. The AY-Voice will be a three-voice, polytonic affair with noise and tones, EG, LCD display, cursor keys for menu navigation, etc. It will also sport 8 gate/trigger outputs (good for percussion, etc.) and MIDI transport outs Start, Stop, Continue and Clock (good for sequencers and recorders).

The processor is the Picaxe 28X2 and the sound chip is the AY-3-8910. Note that the latter has two, 8-bit uncommitted data ports, hence the large number of features possible.

There's a lot to learn as we go along here, so I'll be building up the project step-by-step so I can learn the features of the AY-3-8910. (Its data sheet is some fifty pages long). As a first step, I confirmed that I knew how the Picaxe worked by simply blinking an LED once a second. That was a couple days ago.

The next step which I finished today is to again blink an LED, but with a huge difference. This time the Picaxe is controlling the AY which then blinks the LED. This confirms that bus access to the two ports is working as expected. It may sound trivial, but with a combined data/address bus it was an important first step. Since all control of the AY registers works in a similar way, it should be all downhill from here.

I'm hoping my comments will attract some of you for testing and confirmation. I'm attaching a pic of the breadboard, the Picaxe code and the schematic if you'd be willing to try it out. Note how simple it is (both hardware and software). In the fact, the circuit consists mainly of wires, rather than components. Here are a few other notes.

X1 is a three-pin 10MHz resonator. However, the Picaxe has an internal X4 multiplier, so the program actually runs at 40MHz. The middle pin is ground, otherwise the part is non-polarized. I'm guessing this will be fast enough for good MIDI performance. Notice also that the Picaxe has a 1024 byte queue for the serial input, and that serial input runs in the background (independent of the program) suggesting the MIDI might be reliable.

Pins 6 and 7 of the Picaxe are the programming pins as described in the excellent free manual from Revolution Education. Not shown are the pull-down and current limiting resistors; refer to the manual. I envision the final circuit board having a 3.5mm jack on these to make firmware updates a snap.

Again, there are 16 uncommitted port lines on the AY. I envision every pin of that chip and the Picaxe will be used, even though this stripped down starter circuit shows many unused pins.

Next step is to interface the LCD not with the Picaxe (which is easy to do) but with the AY which connects to the Picaxe. Hence the LED experiment here to confirm I understood the read/write/addressing protocol of the AY.

So, I'd be most happy if anyone here jumps in and confirms my results as we go along. Next installment (the LCD) should come along in a day or two.

This should be a great learning experience for those with a bent for hybrid analog/digital music.

Thomas Henry


AY_Blink.jpg
 Description:
Photo of the breadboard so far.
 Filesize:  315.59 KB
 Viewed:  665 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

AY_Blink.jpg



AY_Blink_Schem.jpg
 Description:
Schematic
 Filesize:  669.35 KB
 Viewed:  829 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

AY_Blink_Schem.jpg



AY_LED_Blink.txt
 Description:
Program Code

Download
 Filename:  AY_LED_Blink.txt
 Filesize:  1.35 KB
 Downloaded:  696 Time(s)

Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2177
Location: Chicago
Audio files: 16

PostPosted: Mon May 28, 2012 9:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

I haven't worked with picaxe before (my PIC experience is with Arduino), is there a reason it uses a 3 pin resonator rather than a 2 pin crystal? Is it interchangeable?

I don't have the parts to try this at the moment, but I'm very interested to give it a shot once I can get them.

Thanks for sharing with us!
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Mon May 28, 2012 10:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi,

A raw crystal requires a pair of capacitors to load it as well. The resonator doesn't (it's an all-in-one package), and is dirt cheap. All in all, it's a very simple way to get the clock rolling on a microprocessor.

The Picaxe and three-pin resonators are easily available from Sparkfun, a company I've used some half-dozen times these past several years and really like. The AY *may* still be available from BG Micro (their stock was running low last time I checked).

I hope you can join in. This promises to be a great learning experience!

Thomas Henry
Back to top
View user's profile Send private message
theglyph



Joined: Aug 15, 2008
Posts: 31
Location: Jachsonville, FL

PostPosted: Tue May 29, 2012 9:29 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello Thomas,

If I can find an AY chip I'm In. I've got way too much free time on my hands and have been meaning to get into PIC programming anyhow.

Cheers,
Aaron
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2177
Location: Chicago
Audio files: 16

PostPosted: Tue May 29, 2012 10:02 am    Post subject: Reply with quote  Mark this post and the followings unread

I ordered two from BGMicro, looked like they might have one more left....
Back to top
View user's profile Send private message
theglyph



Joined: Aug 15, 2008
Posts: 31
Location: Jachsonville, FL

PostPosted: Tue May 29, 2012 10:16 am    Post subject: Reply with quote  Mark this post and the followings unread

elmegil wrote:
I ordered two from BGMicro, looked like they might have one more left....


HA, Yeah I just ordered the last one! Thanks for the heads up! This should be a fun project.
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2177
Location: Chicago
Audio files: 16

PostPosted: Tue May 29, 2012 1:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Just a quick note for anyone else who doesn't have a PICAXE already, Sparkfun has some good utility stuff (usb->cable board, cable->breadboard kit, appears you just add a standard small stereo cable to attach them), but their price on the PIC 28x2 itself is half again what I was able to get from RobotShop.com ($15 vs $10)...and RobotShop also carries the Sparkfun pieces at the same price. I can't speak to difference in shipping costs, so it could be a wash, but figured I'd mention it. The usb->cable board is definitely cheaper ($15 vs $30) than the "official" dedicated cable, regardless of who you get it through.
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Tue May 29, 2012 4:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Elmegil,

Thanks for posting the Picaxe info.

For others with older computers hanging about: you can make your own programming cable for the Picaxe with nothing more than a straight-through cable, miniphone jack on one side, DB-9 on the other. I soldered up my own for under $3, with surplus parts from BG Micro. Of course, this presumes you have a computer with a COM port, which are becoming somewhat uncommon now. I have an old Dell laptop I keep on the bench just for this purpose.

The software is free from Revolution Education, as are the manuals. So your total investment is only $3 on some wires and connectors.

Also, I've found Sparkfun's shipping rates via First Class Mail to be quite reasonable. And they ship fast. Not a bad company to deal with at all; I've used them a half-dozen times or so.

Thomas Henry
Back to top
View user's profile Send private message
jumunius



Joined: Apr 19, 2010
Posts: 346
Location: San Francisco, CA
Audio files: 13

PostPosted: Wed May 30, 2012 12:01 am    Post subject: Reply with quote  Mark this post and the followings unread

I don't have time to play right now, but I am very curious about this project as it goes on. Nice that it's going to be something very different than the "usual" VCO. Polyphony even!

Good thing I already acquired my AY chips in case this thing ever got going. Smile

_________________
-Jim
Back to top
View user's profile Send private message
andrewF



Joined: Dec 29, 2006
Posts: 1176
Location: australia
Audio files: 4

PostPosted: Wed May 30, 2012 12:21 am    Post subject: Reply with quote  Mark this post and the followings unread

glad to find this project, i have had a few AY chips sitting around for ..... 10 years? or more

guess i need to get a picaxe now.
Back to top
View user's profile Send private message Visit poster's website
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Wed May 30, 2012 7:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi gang,

Here's a bit of an update.

I've spent the last two days working on interfacing the LCD by means of the AY IOB port. It's going to work! This is an important breakthrough for more reasons than one, but especially because it frees up oodles of port pins on the Picaxe for other things.

I do have one thing I have to work through, though. I still haven't coordinated the timing of the resets to the Picaxe, AY and LCD. The way it is now, the LCD works perfectly for all sorts of things (scrolling, printing backwards, block/underline cursors, blinking, etc.) but only after the unit has run for a minute or so. Like I say, this is something to do with the multiple resets I think, and I'll eventually figure it out. The important thing is that I now have confirmation that the Picaxe can drive the AY which drives the LCD and all beautifully.

I do have a schem and code, but won't post it until I figure out the necessary reset sequence. But this truly is getting exciting. It occurred to me last night that even if a person ignored the sound generators in the AY it would still make a great peripheral adapter what with its 16 port pins.

More tomorrow,

Thomas Henry
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Sat Jun 02, 2012 2:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi again,

Here's some more news. I've spent the last three days working exclusively on this project (some forty hours at the bench). My goal was to fire up the LCD by means of Port IOB on the AY.

Well! What should have been easy turned into a nightmare. I was in fact able to put the LCD through its paces. Sometimes it worked nonstop for hours and other times it would simply refuse to come up. After many, many experiments both in hardware and software it seems likely that there is a subtle timing problem in the reset sequence. (Keep in mind that the Picaxe, AY chip and the LCD all go through their own power-on resets). It's either that or a stray capacitance problem on the breadboard.

Speaking of which, I had to abandon the previous breadboard when I (finally) noticed that each power bus dropped an additional 0.2V. By the time I got to the last rail, the power supply was down to 4.4V or so. What junk!

Anyway, you get the idea. This week has been spent fighting some real-world things that sometimes happen. The design on paper looked fine, but not so on the breadboard.

So, I'm going to go back putting the LCD on the Picaxe (which I did get working well several years ago) and put the navigation switches on the AY. Speed is not an issue with switches as it is with the LCD.

I'll redraw the schem and revise the code appropriately. I should have both posted in a day.

Thomas Henry
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Sat Jun 02, 2012 9:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi All,

Okay, now I'm really pissed. After taking a break for a much needed several hours respite from the workbench it finally hit me: there is no major reason why this shouldn't work. After all, it's just digital data being transfered from register to register and at not too onerous a clock rate. I've decided that pumping the LCD from the AY is really the best way to go for several reasons so want to stick with this a bit longer. If nothing else, I want to know why this is acting up. (I hate mysteries, which is why I became a mathematician).

So who wants to help out with some testing and theorizing? I've attached the schem and code. On my breadboard, sometimes everything works well and sometimes it doesn't. The code was designed to put the LCD through its paces just for testing purposes. It should print various messages to the LCD, scroll left, right, blink and so forth. The purpose is simply to see what the LCD can do. If I don't use the AY as an intermediary, it works perfectly. When I use the AY, behavior is dicey.

Will someone please try this out and leave some comments here? For my part, I'm going to rebuild everything on the breadboard and double-check the code yet again.

Thanks for contributing!

Thomas Henry


AY_LCD.jpg
 Description:
AY to LCD Schematic
 Filesize:  940.58 KB
 Viewed:  565 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

AY_LCD.jpg



AY_LCD.txt
 Description:
Picaxe Code

Download
 Filename:  AY_LCD.txt
 Filesize:  9.79 KB
 Downloaded:  534 Time(s)

Back to top
View user's profile Send private message
diablojoy



Joined: Sep 07, 2008
Posts: 809
Location: melbourne australia
Audio files: 11

PostPosted: Sun Jun 03, 2012 12:00 am    Post subject: Reply with quote  Mark this post and the followings unread

hi thomas love your work amazing stuff Shocked

Quote:
On my breadboard, sometimes everything works well and sometimes it doesn't.

did i mention i hate breadboards
maybe time for a new one or i am guessing here but invariably i have trouble with them as well especially anything dealing with logic or digital signals ,
too much stray capacitance maybe ?
I invariably end up etching a board to test with, not very efficient but then it usually works for me even if it does take a few tries
I know nothing of coding so can offer no help there .

_________________
In an infinite universe one might very well
ask where the hell am I
oh yeah thats right the land of OZ
as good an answer as any
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2177
Location: Chicago
Audio files: 16

PostPosted: Sun Jun 03, 2012 3:51 am    Post subject: Reply with quote  Mark this post and the followings unread

Unfortunately I don't have the parts to do this yet...

But looking at the ckt diagram, what is the reason for managing RS and E from the picaxe directly rather than through the AY bus? Wouldn't using a couple more bus pins from the AY chip help be sure those were all in sync?
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Sun Jun 03, 2012 12:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Elmegil,

RS may be possible that way, but handling E would be troublesome since it requires a trigger pulse. (RS is simply a logic level). The AY chip uses a data-address bus, i.e., first you latch the address and then you latch the data which goes into that address all on the same bus. Because of that, it takes several dozen Basic commands to toggle E on and off. E takes a trigger signal 10 uS wide which is easy to handle from the Picaxe using the PULSOUT command.

For what it's worth, in my experiments earlier this week I took your comment into account by testing various delays after latching the data just to make sure the Picaxe ports weren't outpacing the AY ports. No change.

However, I thought of another experiment to try later today which would help confirm the AY port isn't sluggish.

Thanks for the idea, and please keep them coming!

Thomas Henry
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Sun Jun 03, 2012 5:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi again,

I thought a bit more more about Elmegil's suggestion and decided to try putting RS and E on IOB.4 and IOB.5 of the AY. As it turns out, the code required to handle this isn't messy at all, so you can jettison my previous comment.

However, the behavior is the same. Sometimes it works, sometimes it doesn't. By not work, I mean that random characters appear on the screen.

My suspicion all along is that it has something to do with the reset sequence. I spent several hours with the LCD data sheet today and figured out how to code a manual reset. That too made no difference.

But there is a curious pattern to what's going on. Changing from the Picaxe to the AY for RS and E control suggests to me the dog which did nothing in the night.

I did warn everyone that this is a pilgrim's progress, didn't I?

Thomas Henry
Back to top
View user's profile Send private message
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Sun Jun 03, 2012 5:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

It may be frustrating at times, but it's really good work you're doing Thomas.
_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Sun Jun 03, 2012 11:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Gang,

This was yet another long day, but with an incremental progress to report. Here's the deal. The LCD works perfectly now...

BUT...

...only after the circuit has been running for a minute or two.

It really does work as expected (IOB ports on the AY, control lines, etc.) but only after the unit has been running for a couple of minutes.

I keep coming back to, my intuition tells me there is something not quite right with the power on reset of something-or-other. So the good news is that the AY port works just fine at 40 MHz, but somehow the LCD isn't latching on correctly.

Anyone care to try it out? Attached are the schem and code. Here's what I see; I would appreciate hearing if you can replicate my results. When powered up for a couple minutes I see a bit of garbage, a blank display and so forth. Then it kicks in and shows the character set, cursor movement, panning and all the other things it's supposed to do---perfectly.

Just so you know, I moved everything over to a different breadboard and completely rewired things.

I surely will appreciate a progress report from someone else.

Thomas Henry


IMG_1323.JPG
 Description:
AY on a different breadboard
 Filesize:  197.9 KB
 Viewed:  30894 Time(s)

IMG_1323.JPG



Schem.jpg
 Description:
Newest Schem
 Filesize:  878.46 KB
 Viewed:  703 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Schem.jpg



AY_LCD2.txt
 Description:
Newest code

Download
 Filename:  AY_LCD2.txt
 Filesize:  9.66 KB
 Downloaded:  487 Time(s)

Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2177
Location: Chicago
Audio files: 16

PostPosted: Mon Jun 04, 2012 5:25 am    Post subject: Reply with quote  Mark this post and the followings unread

I really really want to work on this, but I don't expect to have all the parts for as much as another week yet :/
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Mon Jun 04, 2012 5:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Gang,

I'm happy to report that all is hunky-dory now; the LCD works perfectly whilst connected to the AY chip.

After another dozen hours with the data sheets (which I can recite from memory now), I finally found one of the keys I was looking for. And after single-stepping the program through the Picaxe simulator (which is part of the free software by the way), I found another not so obvious error with a binary number in the code. Finally, with several hours at the bench today I deduced the last timing link that pulls it all together.

In broad terms (apart from the naughty binary number), some things were running too fast and some were running too slowly. It was today that I noticed the latter. Thinking of the LCD as a combinatoric device is a mistake; it truly is sequential in some regards.

Anyway, here's the dope. None of the problems I was seeing was due to the AY, just the LCD. And in a nutshell they all had to do with the power on reset sequence as I guessed early on. In particular, at 40 MHz, the Picaxe reset first, then the AY and finally the LCD. Once I figured that out it all became clear.

Again, if my notes have had you worried, worry no more. The AY works like a champ, and now so does the LCD.

The schem is the same as the last one, but the code has changed. I've attached it as version 3. Remember, the code is much inflated just to show all of things the LCD can do. In the actual AY-Voice we'll only be using a subset of the code. Even so, you'll notice I've only consumed 800 bytes of the 4000 available in program space.

So it works, at least on my breadboard. Keep me posted on anything fishy you might notice. As for me, I now turn my attention to the navigation buttons for winding around the menus. I've got three options to propose:

1. Cursor buttons (north, south, east, west) and center for enter. This would be like a joystick with a fire button in the center but just done with pushbuttons on the front panel.

2. A 12 button keypad.

3. A television universal remote. This frees up oodles of other Picaxe pins for other purposes and also provides many other options.

Option 2 is the most complex, Option 3 the least. But number 1 is my choice for ease of use in the studio.

What do you think?

Thomas Henry


AY_LCD3.txt
 Description:
Working code for the LCD; use previous schematic

Download
 Filename:  AY_LCD3.txt
 Filesize:  10.15 KB
 Downloaded:  482 Time(s)

Back to top
View user's profile Send private message
Dan Lavin



Joined: Nov 09, 2006
Posts: 649
Location: Spring Lake, Mi, USA
Audio files: 21

PostPosted: Mon Jun 04, 2012 6:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Thomas,
Yeah, I think option 1 is the most intuitive even though the other options are tempting. Just to let you know, I did use the Picaxe, cannibalizing your code, to make my DR110 clap drum retrofit (seen elsewhere in the DIY forum). Just sent a PM to you on it.

_________________
Synth DIY since 1977!
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 170
Location: N. Mankato, MN
Audio files: 3

PostPosted: Mon Jun 04, 2012 9:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Dan,

Thanks for your opinion. I do believe I'm going to go with the pushbutton cursor control approach you voted for.

I didn't get any PM today; do you need to resend it?

Thomas Henry
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2177
Location: Chicago
Audio files: 16

PostPosted: Mon Jun 04, 2012 10:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

I agree with option 1 as well. It's a fairly established interface trope. A 12 digit pad is going to be 'what do I type'? and a TV remote even more so.
Back to top
View user's profile Send private message
magneticstripper



Joined: Jan 12, 2009
Posts: 25
Location: San Francisco

PostPosted: Tue Jun 05, 2012 10:49 am    Post subject: Reply with quote  Mark this post and the followings unread

i vote option 1. Very cool project Thomas!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Scott Stites
Page 1 of 7 [154 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2, 3, 4, 5, 6, 7 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Thomas Henry designs
Jump to:  

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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use