#avr Logs

Sep 22 2018

#avr Calendar

12:46 AM [1]MrMobius is now known as MrMobius
06:50 AM davor_ is now known as davor
07:47 AM MarcinWieczorek_ is now known as MarcinWieczorek
08:48 AM davor_ is now known as davor
09:56 AM rue_mohr: --
09:38 PM x7C3: what's a device signature of 0x000002 mean?
09:39 PM x7C3: i've got an atmega328p on a custom circuit that was working up until now
09:42 PM x7C3: how do i fix this?
09:42 PM x7C3: i can erase memory, but not upload anything
09:43 PM x7C3: https://hastebin.com/uleluwavud.shell
09:54 PM x7C3: anyone around?
09:54 PM x7C3: i've got to hand this project in next week
10:23 PM rue_mohr: hey
10:23 PM rue_mohr: what kinda programmer are you using?
10:23 PM rue_mohr: x7C3,
10:24 PM x7C3: atmelice_isp
10:24 PM x7C3: jtag ice3, iirc
10:24 PM rue_mohr: ok, you didn't reprogram the reset line to be io did you?
10:24 PM x7C3: i don't think so, no
10:24 PM rue_mohr: oh, are you using jtag or isp?
10:24 PM x7C3: ISP
10:24 PM rue_mohr: ok
10:25 PM rue_mohr: what do you have on your board connected to the miso and mosi lines?
10:25 PM rue_mohr: (sorry, I'd be more specific, but I'm half asleep)
10:26 PM x7C3: LSM303, digital compass
10:26 PM rue_mohr: ah, k
10:26 PM rue_mohr: can you disconnect that while programming?
10:26 PM x7C3: it's been soldered on
10:27 PM rue_mohr: hmm
10:27 PM rue_mohr: does it have a reset line?
10:27 PM x7C3: connected to the ISP header, yeah
10:27 PM x7C3: and to the debugWire header
10:28 PM rue_mohr: I think, from what you have said,t eh compas is screwing up the programming communicatins
10:28 PM rue_mohr: so, you need to disable the compas
10:28 PM x7C3: how would I go about doing that?
10:28 PM rue_mohr: you could do this by disconnecting it from the miso/mosi lines or holding the compas' reset line low(?)
10:28 PM rue_mohr: or, by disabling the clock line to the compas
10:31 PM x7C3: which is the clock line?
10:31 PM x7C3: SCK?
10:31 PM rue_mohr: yes
10:32 PM x7C3: alright, can i attach that line to ground or vcc?
10:32 PM rue_mohr: you may have to cut a trace to be abel to program the avr and keep the compas out of the equation
10:32 PM rue_mohr: you would want to attach *just the copmpas'* rst to gnd (normally)
10:33 PM rue_mohr: that would keep it disabled during the programming
10:33 PM rue_mohr: how much did it cost you to make the board?
10:33 PM x7C3: dunno, it was provided to me
10:34 PM rue_mohr: oh
10:34 PM rue_mohr: do you ahve a schematic?
10:34 PM x7C3: yep
10:34 PM rue_mohr: can you show me, maybe there is a designed way to do it
10:36 PM rue_mohr: oh and tell me how you know about IRC
10:36 PM x7C3: this channel, specifically?
10:36 PM rue_mohr: no, just irc
10:36 PM x7C3: been on it for years
10:37 PM x7C3: prefer using it over any other internet chat
10:37 PM rue_mohr: how many years?
10:37 PM rue_mohr: how did you learn about it?
10:37 PM x7C3: at least 10 years maybe
10:37 PM x7C3: probably stumbled upon a forum or something that had an irc channel
10:39 PM rue_mohr: can you show me that schematic?
10:39 PM x7C3: just uploading image
10:39 PM x7C3: https://i.imgur.com/f6ePNKc.jpg
10:41 PM rue_mohr: ah, there is a chip select, you should be fine if CS1_EXT is not low
10:41 PM x7C3: i'm wondering what my fuses should be set to
10:42 PM rue_mohr: and yes, INT0 of the mcu is connected to INT1 of the compas
10:42 PM rue_mohr: er.. did you change the fuses from the default?
10:42 PM x7C3: L:FF H:99 E:FF was previous configuration
10:42 PM rue_mohr: thats a good way to brick a controller
10:42 PM x7C3: the programmer said "settings were changed, press Y to change back"
10:43 PM rue_mohr: did this thing ever program ok?
10:43 PM x7C3: i'm not sure
10:44 PM x7C3: is there any way i can recover it?
10:44 PM rue_mohr: you ahve never successfully programmed it?
10:44 PM rue_mohr: heh, do you have an arduino uno around?
10:44 PM x7C3: no
10:44 PM x7C3: nope
10:45 PM rue_mohr: hmm
10:45 PM x7C3: i can order one, but will take 2 weeks
10:45 PM rue_mohr: do you avhea 20 sided dice?
10:45 PM x7C3: in a box, somewhere
10:45 PM rue_mohr: hmm
10:45 PM rue_mohr: its with the 4 sided one?
10:45 PM x7C3: with the 1 sided one
10:46 PM rue_mohr: ok, we need to know a few things
10:46 PM rue_mohr: the compas is a module
10:46 PM rue_mohr: can you just unplug it?
10:46 PM x7C3: it's soldered into the main board
10:46 PM rue_mohr: is the atmega328 surface mount of dip?
10:47 PM rue_mohr: or dip
10:47 PM x7C3: SMT
10:47 PM rue_mohr: mmmm dit
10:47 PM rue_mohr: ugh
10:47 PM rue_mohr: ok, do you have arduino installed on your computer?
10:47 PM x7C3: yep
10:47 PM rue_mohr: ok, lets do some sanity work
10:48 PM rue_mohr: your programmer is a [NULL]
10:48 PM * rue_mohr segfaults
10:48 PM x7C3: atmel ICE3
10:49 PM rue_mohr: ok
10:49 PM x7C3: been using -p atmega328p & -c atmelice_isp arguments to avrdude
10:49 PM rue_mohr: start up arduino
10:49 PM rue_mohr: thats ok, I'm gonna try a sanity fallback
10:50 PM rue_mohr: tell me when its up
10:50 PM x7C3: is up
10:50 PM rue_mohr: ok, so, with programmer connected,
10:51 PM rue_mohr: under tools-> board, select arduino uno
10:51 PM rue_mohr: under tools->programmer select the atmel-ice
10:52 PM rue_mohr: tell me as your there
10:52 PM x7C3: done
10:53 PM rue_mohr: ok, under toools->burn bootloader
10:53 PM rue_mohr: tell me is that works...
10:53 PM x7C3: Arduino: 1.8.5 (Linux), Board: "Arduino/Genuino Uno"
10:53 PM x7C3: avrdude: jtag3_open_common(): Did not find any device matching VID 0x03eb and PID list: 0x2110, 0x2140
10:53 PM x7C3: Error while burning bootloader.
10:53 PM x7C3: This report would have more information with
10:53 PM x7C3: "Show verbose output during compilation"
10:53 PM x7C3: option enabled in File -> Preferences.
10:53 PM rue_mohr: yea yea, hmm
10:54 PM x7C3: does the micro need to be connected to programmer?
10:54 PM rue_mohr: uh, yes
10:54 PM rue_mohr: did you not have the programmer plugged in?
10:54 PM x7C3: i unplugged it
10:54 PM x7C3: connecting now
10:54 PM rue_mohr: and try the burn bootloader again
10:55 PM x7C3: Arduino: 1.8.5 (Linux), Board: "Arduino/Genuino Uno"
10:55 PM x7C3: avrdude: jtag3_open_common(): Did not find any device matching VID 0x03eb and PID list: 0x2110, 0x2140
10:55 PM x7C3: Error while burning bootloader.
10:55 PM x7C3: This report would have more information with
10:55 PM x7C3: "Show verbose output during compilation"
10:55 PM x7C3: option enabled in File -> Preferences.
10:55 PM x7C3: same erro rmessage
10:56 PM rue_mohr: I wonder if that the programmer that has the power problem
10:56 PM rue_mohr: do you have any other power hooked up to the board other than the programmer?
10:57 PM x7C3: yes
10:57 PM rue_mohr: ok, try turning that other power off, and try the burn bootloader again
10:57 PM rue_mohr: I'm eliminating silly things, we will get somewhere
10:58 PM x7C3: same error message
10:58 PM rue_mohr: ok
10:58 PM rue_mohr: stand by a min
10:59 PM x7C3: avrdude: stk500v2_jtag3_recv(): error in jtagmkII_recv()
10:59 PM x7C3: getting this when i try and get info from board
11:00 PM rue_mohr: hmmm
11:00 PM rue_mohr: try with the pwoer on
11:00 PM rue_mohr: I dont know if you power supply is pulling the chip power down or not
11:00 PM rue_mohr: but lots of atmel programmers have problems with powering the baord during programming (they wont)
11:02 PM x7C3: yellow light on programmer doesn't show up anymore
11:02 PM rue_mohr: -p atmega328p & -c atmelice_isp
11:02 PM x7C3: ok working now
11:03 PM rue_mohr: its funny, you would prolly have less problems with a $2 china knockoff programmer
11:03 PM rue_mohr: but this looks like something else
11:03 PM rue_mohr: do you have a multimeter?
11:03 PM x7C3: yep, lemme go grab it
11:04 PM rue_mohr: do you have a red dragon?
11:05 PM rue_mohr: do I have 4 cr2032?
11:06 PM x7C3: what are these?
11:08 PM rue_mohr: red dragon is a large tempromental lizard, but thats not important right now
11:08 PM x7C3: do you speak jive?
11:09 PM rue_mohr: could you measure from ground to VBAT for me?
11:09 PM x7C3: voltage, resistance .. ?
11:09 PM rue_mohr: votlage\
11:11 PM rue_mohr: -p atmega328p & -c atmelice_isp
11:12 PM x7C3: trying to find a test point
11:13 PM x7C3: approx 4.15V
11:13 PM rue_mohr: huh
11:13 PM x7C3: should i replace batteries? :
11:13 PM x7C3: /
11:14 PM rue_mohr: no
11:14 PM day__ is now known as day
11:14 PM rue_mohr: I have something new to try
11:14 PM x7C3: it's 3xAA, shouldn't that be closer to 4.5V
11:14 PM rue_mohr: uh, ok, screw the download, lets try...
11:14 PM rue_mohr: avrdude -c atmelice_isp -p m328p -U lfuse:w:0x62:m -U hfuse:w:0xd9:m -U efuse:w:0xfe:m
11:14 PM x7C3: that's going to need a -F
11:15 PM rue_mohr: -F!?
11:15 PM x7C3: yes, the ID is like 0x000002
11:15 PM x7C3: *device signature
11:15 PM rue_mohr: hmm,
11:15 PM x7C3: avrdude: Device signature = 0x000002
11:15 PM x7C3: avrdude: Expected signature for ATmega328P is 1E 95 0F
11:15 PM rue_mohr: ok, go for it then
11:17 PM x7C3: https://hastebin.com/acewolufoh.shell
11:17 PM rue_mohr: ok
11:17 PM rue_mohr: try it again without the -F
11:17 PM rue_mohr: did it work?
11:18 PM rue_mohr: might be a read error
11:18 PM x7C3: https://hastebin.com/idoferobuj.shell
11:18 PM rue_mohr: hah
11:18 PM rue_mohr: the compas is screwing upt he reads
11:18 PM rue_mohr: no
11:18 PM rue_mohr: arg
11:18 PM rue_mohr: hmm
11:18 PM rue_mohr: ok
11:18 PM rue_mohr: back to multimeter
11:18 PM rue_mohr: what is the voltage from ground to pin 6 of the bluetooth module?
11:19 PM x7C3: pin 6?
11:19 PM rue_mohr: yea, CS
11:20 PM x7C3: which one is that?
11:20 PM x7C3: the bluetooth module only has 0-5
11:20 PM x7C3: no pin6
11:21 PM rue_mohr: according to the schematic its got 9
11:21 PM x7C3: oh, that's the compass
11:21 PM rue_mohr: oh sorry
11:21 PM rue_mohr: yea,
11:22 PM rue_mohr: 87, heh
11:22 PM x7C3: 0.2mV?
11:22 PM x7C3: *200mV
11:23 PM rue_mohr: ah, hmm
11:23 PM rue_mohr: thats prolly an issue
11:23 PM x7C3: says 0 now
11:23 PM rue_mohr: I dont think its CS, I think its /CS
11:23 PM rue_mohr: and the 4148 is not a shottkey
11:23 PM rue_mohr: ok, do you ahve a 1k resistor?
11:24 PM x7C3: nope
11:24 PM rue_mohr: bown black red
11:24 PM rue_mohr: "102"
11:24 PM rue_mohr: ok, do you have an old burned out computer power supply?
11:24 PM x7C3: nope
11:24 PM rue_mohr: do you have an old inkjet printer that doesn't work anymore?
11:24 PM x7C3: nope
11:25 PM rue_mohr: wtf!
11:25 PM rue_mohr: ok, do you have a ....
11:25 PM rue_mohr: dont tell me to go fish..
11:25 PM rue_mohr: do you have a compact flourescent lightbulb, burned out or not
11:25 PM x7C3: yes, but i don't have wires
11:25 PM rue_mohr: screw wries
11:26 PM rue_mohr: ok, do you have a soldering iron?
11:26 PM x7C3: nope
11:26 PM rue_mohr: ARG
11:26 PM x7C3: this feels like a macgyver episode
11:26 PM rue_mohr: do you have a steel fork you can sacrifice in th name of science?
11:28 PM x7C3: nope
11:28 PM rue_mohr: ok, do you have a card to a hackspace?
11:29 PM x7C3: no such thing where i live
11:29 PM rue_mohr: do you have a purple sharpie?
11:32 PM rue_mohr: I'm going to go out on a limb and recon you dont ahve a 3d printer...
11:33 PM rue_mohr: oh wait, nevermind
11:33 PM rue_mohr: the signal is backwards
11:33 PM rue_mohr: 0 is spi diabled
11:33 PM rue_mohr: well ok, you must have goofed the clock settings
11:33 PM x7C3: probably
11:33 PM rue_mohr: so we need to jumpstart it somehow
11:34 PM x7C3: need a powered clock signal to fix it, iirc
11:34 PM x7C3: yep
11:34 PM rue_mohr: do you have a LM555 ?
11:34 PM x7C3: i fucking wish i did, eh
11:34 PM rue_mohr: does your computer have a parallel port cable?
11:34 PM rue_mohr: er, port
11:34 PM rue_mohr: parallel port
11:35 PM x7C3: nope
11:35 PM rue_mohr: does your computer havea serial port
11:35 PM rue_mohr: (old serial, not usb)
11:36 PM x7C3: rs232? nope
11:36 PM rue_mohr: do you have a usb cord you can butcher up?
11:37 PM rue_mohr: possibly for an obsolete apple phone?
11:38 PM x7C3: gonna take a time out, i'll talk to you later :)
11:38 PM rue_mohr: 8-|
11:39 PM rue_mohr: but, I think we can use usb to generate a clock
11:40 PM rue_mohr: if I could finda picture of your programmer, we could also prolly grab a clock line off'a it, but I cant tell which one you have
11:40 PM rue_mohr: I think its in a silver and blue case
11:40 PM rue_mohr: the dragon is prolly the worst disaster
11:42 PM rue_mohr: omg I think my stm32 programmer is really a jtag mk1 knockoff
11:42 PM rue_mohr: ok, what was important before that distraction happened