SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on the software and hardware for Atmel's STK standard.
By hareti
#37968
Hi, I've built a board with an AT90S2313 uC but due to space constraints have left off the ISP socket. I wanted to program the device before I plug it into the socket on my board but I'm starting to this this was a bad idea.

I have plugged my programmer into a breadboard and wired up the GND, VCC, MISO, MOSI, SCK and RESET lines to the uC. I've also hooked up my power supply to the VCC and GND lines. I was hoping this would be suficient to program the device but I'm having problems. I've checked all the wiring and tested it with a multimeter so I know that's ok.

I'm using PonyProg and a simple buffered parallel programmer. PonyProg is set to Parallel Avr ISP I/O and clicking Probe tests OK. When I try to program the first error I get is "Device missing or unknown device (-24)". The if I click Ignore it says Writing.... but then says "Write error (-21)".

Is there something I'm missing? I thought maybe it needs the crystal so I tried adding an 8MHz one and the 22pF caps but no difference. The power supply is set to 5v, maybe this is not correct?

Any help would be greatly appreciated...
User avatar
By leon_heller
#37974
It does need to have a clock. Is yours working?

Are you sure that the programmer is working properly?

Leon
By hareti
#37980
Hi Leon,

The clock on the breadboard does not appear to be working. Using a scope I've looked at other working boards with the same uC and you get a nice sine wave on pins 4 and 5 - the ones connected to the crystal. There is nothing on the one I'm trying to program out of circuit.

All it has is power and the crystal with load caps. That's all it needs isn't it? The crystal should go even if the uC is blank. I'm not sure what's going on. The only thing I can think of is that I haven't got a voltage regulator on the breadboad, I'm just using a stabilised power supply. I've checked it's output with a multimeter and it says 5.08v so it shouldn't be an issue. How sensitive are these uCs to voltage?
User avatar
By leon_heller
#37984
As I said, the clock must be working for ISP. Perhaps the chip is faulty, or you need high-voltage programming to set the clock mode.

I'd use the newer Tiny2313 anyway, the 2313 is obsolete.

Leon
By hareti
#37996
I changed out the 22pF load caps for 47pF ones and it seems to have solved the problem. It programs fine most times but sometimes gets stuck at about 85% of the write. I see the load caps are supposed to be 30pF so maybe this is why it is still a bit temperemental. I'll have to get some...

Thanks for your help.
User avatar
By leon_heller
#38000
The capacitors depend on the specified crystal load capacitance, usually 20 pF. They are in series so 33 pF should be about right for 20 pF, allowing for stray capacitance. The wrong value isn't likely to stop it working, it'll probably just affect the frequency slightly.

Leon