6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Oct 07, 2024 5:18 am

All times are UTC




Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Mon Jun 18, 2007 11:30 am 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
Good news, everyone! I finally got this all up and running! I pulled sickie today and instead of going to work I stayed home and worked on the code. This is the first real 6502 coding I have done and my code is very simple and primative (I am too ashamed to post it just yet) but it seems to be working. Lots of little problems along the way of course.

The circuit is simple. The 6502 controls a 6522. I use the upper four bits on one port to select which audio chip to play the sampled audio from (I have three but in theory you could do 10) and the lower four bits to preload the starting address on my binary counter hooked up to the audio ROMs. Each ROM is basically broken into 16 one second blocks and I can choose which one to start playing from. Another bit on a VIA port simultaneously loads the upper address bits on the counter and clears the lower bits. The audio board has it's own clock so a further bit on the VIA is used to AND with this clock to start it playing. I did it this way (instead of the CPU or VIA generating the clock) just so I can manually vary the clock rate for the audio and hence the playback speed. Samples can go over the one second boundaries. To know when to stop playing I have a 8 input NAND on the ROM output. I code a FF into the sample as a stop bit. The NAND generates a pulse which I feed into an interrupt pin on the VIA. That interrupts the processor and I stop the playback and reset everything. That was the hardest part. I couldn't get it to play more than once at first but that was because I wasn't disabling the VIA interrupt inside the interrupt handler and I think it was then never getting past that code as it would just keep interrupting and never reset.

All the main code does is loop around storing a value for each chip and sample to play (15 different phrases in all). After storing each one it polls a button hanging off the VIA to see if it is pressed. If so it just plays whatever sample it just stored address info for. It then ignores button presses until the sample stops playing. Since the processor is loading and reloading all the addresses so much faster than the playing of the samples it is almost random as to what sample you get when you hit the button. Random enough for me anyway.

I know there are much better ways to achieve what I have done but the point was to use a 6502 in some way and, crude as it is, this definitely works and it has been fun building it too!

When I have put together a little web page about the entire Bender and his brain I will post a link to it here.

Simon


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jul 29, 2007 10:25 am 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
Slightly late and not actually finished yet but I started a web page for my Bender project.

http://www.asciimation.co.nz/bender/

The page should be working in Firefox but I think IE might be broken. The 6502 specific bits are about half way down if you don't want to read all the gumf!

The 6502 'brain' is complete though and working really well. I have had the circuit sitting and running for over a week at a time (off a plug pack, not batteries of course) and it works flawlessly.

The remote control is a simple ASK transmitter with the receiver connected to the 6502 via the 6522. I just look for a simple on/off signal rather than sending any data. The whole thing is pretty crude and total overkill really but it was built for novelty rather than practical reasons :) I will post more details on the site when I have them all drawn up.

Simon


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jul 29, 2007 3:17 pm 
Offline
User avatar

Joined: Fri Oct 31, 2003 10:00 pm
Posts: 200
Simon,

The web site shows fine (IE6). Good story, great result!

Seeing the details of the 6502 system would be nice!

Hans


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jul 29, 2007 5:18 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
You put way more detail into that project than I ever expected. :) Awesome! I forwarded the URL to a beer-fanatic friend of mine who also is a Futurama fanatic too. :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jul 29, 2007 8:39 pm 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
I'll try to get the circuit up there soon although it may have to be hand drawn then scanned in! It's basically the 1541 drive circuit minus one of the VIAs and with a different ROM chip. The audio part is more complicated though. The code is very simple.

A friend reported the site not working in IE7 but when I tried it at work just now it was fine. It also does work on 5.5 and 6 it seems.

Simon


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jul 29, 2007 10:25 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Just one more reason to stay as far away from IE 7 as possible -- it's even less standards compliant than any of its predecessors.

I stick with Firefox and Opera personally, and your site is perfectly fine to me.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jul 30, 2007 6:42 pm 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
I generally get things working in Firefox first. Then spend a little time (not too much though) getting it to work on IE. If anyone complains I tell them to use FF!

Will try to draw up the circuit diagrams today and post them soon.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Aug 11, 2007 9:28 am 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
I finally put up part of the circuit for my Bender brain. I found some free software online to draw it all up with. So far I have done the CPU board and posted a diagram of that and the source code to here:

http://www.asciimation.co.nz/bender/page2.html

It is all a bit of a hack really but it works. I know the code can probably be a lot better too :)

I will try to get the audio part of the circuit up there soon.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 17, 2007 5:13 pm 
Offline

Joined: Tue May 29, 2007 1:29 pm
Posts: 25
Bravo. Well done.

Do you know what other famous robot has the same 'brain'?

I'll be back later to check your answer.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 21, 2007 2:27 am 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
VBR wrote:
Bravo. Well done.

Do you know what other famous robot has the same 'brain'?

I'll be back later to check your answer.


No idea? And if I try Googling for it I just get back to my own site!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 21, 2007 10:36 am 
Offline

Joined: Tue May 29, 2007 1:29 pm
Posts: 25
Simon wrote:
VBR wrote:
Do you know what other famous robot has the same 'brain'?

I'll be back later to check your answer.


No idea? And if I try Googling for it I just get back to my own site!


The Terminator (1984 model)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 22, 2007 7:30 pm 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
Oh yeah, I remember that now! You see the assembly language when getting a Terminators eye view :)


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

All times are UTC


Who is online

Users browsing this forum: GARTHWILSON and 48 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: