Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Progamming an ATMEGA8515 using Uno on: August 05, 2012, 05:45:44 pm
I'm doing what the title says, according to this article: http://hlt.media.mit.edu/?p=1706
here is an exact replica of my breadboard:

 (except the part has the wrong label)

after connecting the pins like this,
Code:
atmega  | arduino
6(MOSI) |   11(MOSI)
7(MISO) |   12(MISO)
8(SCK)  |   13(SCK)
9(RESET)|   10(SS)

I run 'avrdude -P COM3 19200 -c avrisp -p m8515 -v -e -U flash:w:foo.hex'
and the 'heartbeat' led freezes, error led comes on, and get an error: avrdude: stk500_getsync(): not in sync: resp=0x00

any advice? did I miss a pin on the atmega8515?
2  Using Arduino / Programming Questions / Re: tracking the state of a 4040 binary counter on: April 13, 2012, 01:15:40 pm
ok, great! Now I think I can handle writing the ISR, but what interrupt am I looking for? Here is the 2MHz clock output code:

Code:
    TCCR2A = ((1 << WGM21) | (1 << COM2B0));
    TCCR2B = (1 << CS20);
    TIMSK2 = 0;
    OCR2A = 3;

from my understanding, the timer register TCCR2A is doing the counting and the output compare register OCR2A outputs the waveform. So the interrupt I'm looking for will trigger when OCR2A changes from low to high? and if I do run the ISR, won't it interfere with the output? I'm probably waaay off base, this is my first time looking at atmega registers other than the PORTs.
3  Community / Exhibition / Gallery / Re: Arduino + AY38910 on: April 12, 2012, 06:28:31 pm
here you go, I couldn't find the part for the crystal and I don't use one so I couldn't tell you how to wire it anyway haha. I've outlined in pink the dots which show pin 1 on the ICs.

http://i44.tinypic.com/34yxwtj.png
4  Using Arduino / Programming Questions / Re: tracking the state of a 4040 binary counter on: April 12, 2012, 05:32:29 pm
did you perhaps mean ISR?
5  Using Arduino / Programming Questions / Re: tracking the state of a 4040 binary counter on: April 12, 2012, 05:26:41 pm
thanks grumpy_mike, I'll read up on IRS and see what I can do smiley-grin
I'm sending the outputs of the 4040 to A,B,C of a 4051 multiplexer to step through the 8 output gates, and I need to know which gate is open. Basically I'm just trying to save those 2 output pins smiley I'd like my program to "do stuff" at each stage, so I'm going to try to time it to happen in between each clock cycle. The atmega328 runs at 16 MHz, so if I clock the 4051 down to 2KHz I should have 8000 cycles to do stuff, right?
6  Using Arduino / Programming Questions / tracking the state of a 4040 binary counter on: April 12, 2012, 03:45:52 pm
I'm using OCR2B to provide a 2mhz clock signal for a binary counter. What I want to do is keep track of the outputs of Q0, Q1, Q2 to count up to 7. I don't really know anything about timers or interrupts, but is there a way to do this in software?
7  Community / Exhibition / Gallery / Re: Arduino + AY38910 on: April 11, 2012, 05:53:22 pm
Hi. Are you looking for a larger pic to see the IC pins? It looks like it was done in fritzing; I could probably make one up for you.
This page seems to be the best on the topic of controlling the AY with an arduino, with vonkhades permission I might try and flesh out the project a little more. I've seen a couple posts here asking about using the AY38910 and it would be cool to have a detailed page to point people to.
8  Using Arduino / Programming Questions / Re: DigitalToggle in 1.0 on: March 26, 2012, 06:23:32 pm
I think the change needed is DigitalToggle.h should #include Arduino.h for Arduino 1.0 and beyond, not pins_arduino.h...

yep, that fixes it!
9  Using Arduino / General Electronics / 16V preamp & arduino? on: March 15, 2012, 01:50:28 am
Hi everybody. I'm kind of on a side-track from my main project of programming a sound generator IC with the arduino. I couldn't detect the output of the PSG (it's an AY-3-8914) running into an 8 Ohm speaker, so I decided to build a BJT preamp:

(thumbnail)


I've been testing it by using my mp3 player as input (I think the PSG is at line level, or ~1V anyway)  and my headphones at the other end. The first thing I noticed was that unless the 3.5 jacks are connected to the 16V power supply ground, there's extremely loud noise  smiley-mr-green. So my first question is regarding the use of 2 power supplies in the same circuit (something I've never tried before). The PSG takes a 5V supply so I'm powering it with the arduino-- assuming I don't connect the 16V and 5V grounds together, will I get crazy feedback? (I know they're technically connected at my power bar smiley-razz )

Second, do I even need that 16V supply? Could I power my preamp with the arduino safely? The funny thing is, my mp3 player is louder with the headphones plugged in directly rather than through the amp....

Anyway, I want to make sure what I'm doing isn't deplorably stupid before I put my precious ardy and even more precious '79 PSG anywhere near a 16V supply :/ any advice is much appreciated!



edit... I guess I meant to say, if I recalculate the resistor values for a 5V supply, will it amplify the 1V analog signal enough to drive an 8 Ohm speaker? I'm afraid I'm not very educated on AC stuff and I just want to know if my code works or not!
10  Community / Exhibition / Gallery / Re: Arduino + AY38910 on: March 14, 2012, 07:29:02 pm
okay, I have an 8 ohm speaker that I ripped out of a gameboy (don't worry, it was dead anyway smiley-grin) but wiring it as in your schematic doesn't produce any sound. I'll try with some other speaker & head phones to make sure it's not just a broken speaker...

Quote
You need to write to register 07 and 08 and set them properlly!
great, that's settled!

Quote
One question, are you using a TTL Oscillator (4 pins, one of them unused) or a Crystal Oscillator (2 pins)??
I'm using pin 3 on the arduino to produce a 2MHz square wave, I tested it with a binary counter and confirmed it's at the right frequency

Quote
If the channel A keeps giving you problems, enable all 3 channels, set the volumen to all of them and write notes to all three.
good idea, I didn't even think of that heheh.

thanks for all your help, I'll keep plugging away until it works or I melt some chips haha!


oh, just thought I'd add this link -- http://dev-docs.atariforge.org/files/AY-3-8910-8912_Feb-1979.pdf I don't know if you'll find it useful cause you seem to have the PSG figured out, but it has a LOT more information than the datasheet!!
11  Community / Exhibition / Gallery / Re: Arduino + AY38910 on: March 13, 2012, 07:56:29 pm
well I'm having some trouble doing it on my own (i think the code is ok) because I haven't connected the outputs to a speaker, and I'm trying to test it by writing to a register and then reading back the contents... thing is, when I try to read from the PSG all the bus lines show 2.5V, so I'm not sure what's going on there...
I decided to turn to your project on the wiki to at least make sure my AY is working. I have a question about your schematic -- did you manage to get sounds out of it by hooking up a bare speaker (no amp)? what are the characteristics of that speaker hooked up to channel A?


edit: actually I have another question smiley I've read the datasheet 100s of times and it doesn't say much about actually playing notes.
I see in your code, when you want to play a note on channel A you only need to write to R0 and R1 to set the period. Is that all it takes to generate output after a fresh reset? I mean, do you need to do anything to the Envelope (R13), Enable(R7), or Amplitude(R8) registers first?

2nd edit: well i answered that question, I see in your initialization you write to R7 and R8 smiley now I hooked it up to an oscilloscope but it shows nothing... however my multimeter reads 3V when I try to produce a 2khz tone!! yay! I'll keep watching for more videos, I'd like to see your finished case
12  Community / Exhibition / Gallery / Re: Arduino + AY38910 on: March 13, 2012, 12:04:21 am
awesome project! I just started my own with the goal of making a synth from scratch!
Thing is I don't have a 595 at the moment so I'm using 8 arduino pins for the bus. I'm just hoping I can get it to make some kind of sound at  least :)

Just wanted to mention that you only need 2 pins for the Bus Control. BC2 can be tied to 5V because 4 of the 8 bus commands are redundant. Here's a crummy chart :D

Code:
BDIR | BC2 | BC1
-----+-----+-----
  0  |  1  |  0  = inactive
  0  |  1  |  1  = read
  1  |  1  |  0  = write
  1  |  1  |  1  = latch

I hope your project is doing well, maybe you've played it live already!
13  Using Arduino / Project Guidance / Re: Interfacing with an AY 3-8910 Chip on: September 28, 2011, 04:19:23 pm
Hi guys, I'm working on a similar project and figured it would be more useful to post in this thread rather than start a new one. I actually have an AY-3-8914 taken from an Intellivision, but I found a datasheet for it and it's basically the same. My arduino is set up like this:
pins 4-13 : DA0 through DA7 (the 8-bit bus)
pin 3: 2 MHz clock
pins 2, 13, 12: BDIR, BC1, BC2, respectively, for bus commands

I really wanted to use PORTD for the bus but didn't want to run into problems with pins 0 & 1, and I don't have a shift register.

My main concern at the moment is the timing: let's say I want to change the period of channel A, then change the noise frequency. I'll go through what my API does 'cause I want to make my question clear:

Code:
regWrite(R4, B00000100); //coarse tune channel A
regWrite(R11, B00011111); // set noise freq.
the regWrite function does:
Code:
busWrite(B11110100); //address for R4
busCmd(BAR); //Bus to Address Register
busWrite(B00000100); //data to write to R4
busCmd(DW); //Data Write
busWrite is just a loop that goes through pins 4-13 and "digitalWrite"s each bit. busCmd uses digitalWrite to set BDIR, BC1, and BC2 to the corresponding command.
Now my question is, how do I know that the register address is latched into the AY-3-8914 before the arduino writes the next byte to the bus? What if the bus control is currently sitting at DW when I write an address to the bus in preparation for a BAR? could it write half of the address into the previous register's data before the PSG selects the right register? I'm guessing it has to do with the PSG's clock cycle smiley

anyway, this is my first time using a bus or interfacing the arduino with anything complex, so I'd appreciate some help from someone with more experience smiley

edit: in addition, the 8914 has 3 pins that I have no clue what to do with: !CS0, CS1, and CS2. From my datasheet:
Quote
The AY-3-8910 is organized as 16 consecutive memory locations starting at the base address which is decoded by the chip select lines (CS0-CS2)... a 3-bit code on these lines selects the AY-3-8910 for sound programming or parallel input/output.

unfortunately there is no other mention of their function in the documentation. The datasheet is from GI's catalogue of chips for their Gimini game system, which served as the basis for the Intellivision. I got them from http://spatula-city.org/~im14u2c/intv/gi_micro_programmable_tv_games/ (the PSG starts at page 7_100)

Techone, if you don't want to post your schematics publicly you can send them to me ;-)
14  Using Arduino / General Electronics / Re: generating a 2 MHz clock signal on: September 27, 2011, 01:45:13 pm
haha ok great. I was searching for "clock signal", "clock pin" etc but I only got threads about actual clocks  smiley-roll
15  Using Arduino / General Electronics / generating a 2 MHz clock signal on: September 27, 2011, 01:33:08 pm
I have an IC that requires an external 2 MHz clock. I have a 16 MHz crystal laying around and a ripple counter, but I don't know how to make a circuit to send the signal to the IC's single clock pin.

Is it possible to output  2MHz 50% duty cycle signal, while doing other processing on the arduino? I read the article on Timer1 and thought I might be able to use PWM, but I guess it only supports frequencies up to 1 MHz.
 I would try to just make a loop that sets a digital pin HIGH/LOW, but I fear the frequency would vary based on the rest of the program.
Pages: [1] 2