Well it seems to be plugged in the wrong way, as the red stripe is up, however the programmer indicates that it’s the wrong way when oriented red stripe down (it has an LED indicator) and I get the error "avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Target reverse inserted"
I don’t have a scope, though it’s beyond time I get one frankly. Do you have a recommendation for an affordable option that gets the job done?
PB6 is reading 2.55 volts.
PB6 at 2.5 sounds right. The avrdude “reverse inserted” message is at best a good guess based on the failure mode/which pins are high/low, but avrdude can’t reliably detect that so it might not actually be so.
At home i have a couple of old analog scopes i managed to get my hands on for free so I have never actually bought a scope, so it’s hard to make a good recommendation. I’ve seen the cheap rigol models recommended, but i think that’s because they can be hacked to perform on a higher level.
What programmer are you using?
I’m using the Waveshare XPii that was recommended above by rempesm.
I was originally intending to use Atmel Studio, since I run Linux, but decided to give avrdude a shot first. I then used a family member’s windows PC to give it a shot with Atmel Studio 6 with the same result.
In your message you said the error code was “0x0000c0” but in the screen snapshot it’s “0x000000”. Can you clarify whether you actually saw 0x0000c0 or 0x000000 in Atmel Studio 6?
I agree a scope would be a good next step so you can see what the ATMEGA is generating. I would start with no input to the Cadet 1 and check that the ATMEGA is generating suitable clock signals.
If you have some audio eurorack modules then you could try a “quick and dirty” test of connecting each of the pins of the video sync output header one by one to an input of one of those modules, to see if there is a signal present. For example, if you connect it to a VCA audio input some of the pins should give you a low pitched (60Hz for NTSC) tone corresponding to the frame refresh rate. If none give you anything at all then that’s more evidence that the ATMEGA isn’t working correctly. It would be good to be sure of this before spending more time trying to get it programmed.
Ah, interesting point. I’ve got both. I got 0x0000c0 when I added -V to the command, as I had seen another user on this forum do. Without the -V it was 0x000000.
avrdude -V -c avrispmkII -p m88 -P usb -B 1 -U flash:w:LZX-C1-SW-V1.0.elf -U efuse:w:0xF9:m -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x0000c0
avrdude: Expected signature for ATmega88 is 1E 93 0A
Double check chip, or use -F to override this check.
I’ll look at getting a scope. I’ve needed one for a while. I’ll give a go at your quick and dirty method when I’ve got a moment.
I wouldn’t have expected the -V flag to affect the signature that’s read from the chip: it should only change the behaviour of the program, not the programmer. But anyway.
One other thing to check is whether or not you’re powering the Cadet module while you reprogram it. From memory I did NOT power it via the eurorack connector while programming the chip. Are you?
If you could please send photos of your programmer plugged into the module that might also show something unexpected (I doubt it but worth a shot).
I went back and re-read the earlier posts in this thread, and I see that csboling also suggested that you check the oscillator AND sync outputs on January 1, and you wrote back that you had checked the oscillators outputs but didn’t mention the sync generator outputs, so definitely a good idea to do that.
Also LZX posted the other day to ask people with sync gen problems to get in touch, since they know about the unprogrammed ATMEGAs. I would definitely talk to them and see about getting a new chip sent out. Even if that is the problem you can still keep working on learning how to program the ATMEGA, while you have a working video synth
I did power the cadet, the instructions on the programmer indicated to power the target module. The waveshare programmer has a red light when module is powered off, green light when powered on and properly plugged in, and flashing red when inverted.
avrdude gets “target not detected” error if command attempted with module powered off.
Here’s an image of ready to go:
As far as testing the sync output pins, each pin except the bottom 2 is reading roughly 5V. I’m not sure if I’m doing your quick and dirty test properly, I just took a patch cable into a VCA and touched the other end to the sync output pins. Each pin, including the bottom 2, sent out a tone, a bit higher than 60hz, but it’s the same tone I get from touching pretty much anything it seems (for example the RCAs or the 5V leg of the regulator).
Thanks for the tip about LZX reaching out about unprogrammed chips. I sent them an email, though as I followed what seemed good advice and I didn’t use sockets on the cadets, the prospect of desoldering this ATMEGA is about as daunting as trying to program it.
You’ll need to make sure the Cadet module and the euro gear you’re using to test both share the same ground otherwise there will be stray hum like you’re describing. Probably the easiest option might be to plug a patch lead into the vertical sync output socket on the front of the Cadet instead.
I would guess LZX may send you a new chip; if they do then it might be best to just cut the existing chip away and carefully desolder each leg from the PCB. Desoldering a chip with that many pins intact is tricky
The GND pin on the programming socket J10 is the one furthest from the ATMEGA, on the outside edge of the board and closest to the J1 sync out connector, diagonally opposite to the J10 pin with the square pad on the PCB. See if you can work out which pin is GND on the programmer cable socket in order to make sure it’s oriented correctly. Use your multimeter to check resistance from a known GND point on the programmer to confirm.
The programmer is oriented properly, I found the pinout and it matches the LED indicator.
None of the output jacks produce any audible tone, I should have been clearer on that earlier in the thread, I see what you mean now. And with the VCA sharing gnd with the cadet there is no audible tone off any of the sync out pins. Which, if I understand, is consistent with an unprogrammed ATMEGA.
So to recap, at this point I’ve traced the circuit for continuity as best I can, I’ve checked that all the ICs are getting power, so I’m fairly certain that the ATMEGA is where the problem lies. So then the solution would seem to be to program the chip.
But the programmer returning a device code of 0x000000 suggests that either the chip itself is bricked somehow, or that there is some faulty connection on the board that is interfering with the clock (if I’m understanding @transistorcat). I have verified the connections on the crystal oscillator and there does not seem to be a problem there, and it appears, at least using the rough method of a voltmeter, that the ATMEGA is receiving the clock from the crystal.
LZX is going to send me a new ATMEGA, which is great, though I’m concerned why this chip is proving difficult to program.
The only osciloscope I have the budget for right now is something like a DSO 138 or a DSO 150. I might order something like that while waiting for the chip from LZX, hopefully that’ll be sufficient.
I have a DSO138 - very convenient size. It only goes to 200Kc/s so it’s fine for audio and video frame and line rates but won’t show you video waveforms. For what you’re testing now that should be fine.
Glad to hear you’re getting a replacement chip!
AVR programming seems to be a recurring theme here for multiple people so i’ll try to expand a bit on the relevant bits.
ISP programming on the AVR is just a SPI serial protocol with reset as the chip select line.
Reading the ID is usually the first thing done when trying to program the chip. an all-zeroes response here just means the line stays low during the entire operation - i.e. that the MISO line is shorted, disconnected from the target, or that the chip is unresponsive.
What it does indicate is that the programmer sees some voltage between the GND pin and the VCC reference pin that is within the legal levels for the device, as checking the voltage is the only thing done before trying to read the ID.
If we rule out misconnection and soldering-related opens/shorts on the programming lines on the PCB (and re-checking all these might be worthwhile to a level of tediousness ) what remains is that the device simply for some reason does not answer.
This is usually because you have managed to lock yourself out somehow with the fuses (It’s quite hard to electrically completely break an AVR in a way that doesn’t leave marks).
If you’ve been messing with them (doesn’t sound like you have), this could be Brownout detector (But in this case we’re running at 5V, so that can’t be it), debug/programming settings, i.e. turning debugwire on or SPI off (the former is fixable, the latter would require you to desolder the device), or clock related.
The clock one is interesting, because setting the device to an external clock and then not providing one would leave the device looking rather dead. On the cadet, the “worst case” setting is intended (external clock) and the board provides this clock. What that does mean is that we probably can’t easily mess this fuse up in a way that leaves us locked out, but it also means that if something is broken or mis-assembled around the clock generator, these symptoms are expected.
Final update: while waiting for an oscilloscope kit and the new chip from LZX, I went over every solder joint again just to be extra super sure. The chip still would not be programmed.
The chip from LZX arrives. Pop out the old one, put in the new one. And everything is finally working.
I have no idea why neither avrdude on Linux nor AVR Studio on Windows would recognize the old chip, but oh well who cares. Hopefully I find some use for this programmer in the future.
Thanks so much to everyone who has been helping me figure this out. The support I get from the SDIY community when I run into problems above my paygrade is a really lovely thing.
On now to testing all the other modules.
Look into programming AVR chips! It’s a lot of fun. The ATmega328P is the chip the Arduino UNO uses (and is kind of similar to the chip the Cadet sync generator uses too), and once you look into Arduinos you realize that they’re just a few additional things tacked onto an ATmega328P. That’s it. So you can build a stripped down Arduino just by putting an ATmega328P on a breadboard and adding a few resistors, capacitors, LEDs, and buttons and using your programmer to program it (instead of the UNO’s built in USB). The Arduino software will likely support your programmer just fine, so you can use the official Arduino example programs, even.
Doing video stuff on AVRs (especially ones like the ATmega328P) is kind of tricky. Well, doing video stuff on any chip is kind of tricky. But there’s an Arduino TVout library that exists that can make some really blocky (but cool) B&W text and graphics on NTSC (and maybe PAL? I can’t remember), so there’s already a jumping off point there. Also if you’re doing a breadboard Arduino, you can use a different timing crystal to get something better suited to your intended composite format, and then you can take the video output even further and do color graphics at higher resolutions. (I keep meaning to fiddle with that myself, but my Arduinos and ATmegas are still buried somewhere in my room from my move a few months ago.)
Plenty of non-video stuff to do with Arduinos/ATmegas, too… Too many to list here. One thing they’re pretty great for is designing cool standalone gear to generates MIDI signals of some sort… sequencers, keyboards, etc.
Some people are fine with jumping into AVR C, while others prefer to start off with Arduino’s version and then eventually expand to raw C, so there are a variety of different levels of tutorials/articles about it all. The Arduino ones are especially beginner friendly, usually, so start there if you’re unsure.
Such a big and fun rabbit hole to go down!
Welcome to the exclusive DIY video synth gang @Whelm!