#avr | Logs for 2015-08-06

Back
[00:21:07] <Casper> can gcc actually build up a lookup table?
[00:21:21] <Casper> or you have to generate it yourself?
[00:25:41] <rue_school> hmm
[00:25:54] <rue_school> make a C program to make it as an include file
[00:26:08] <Casper> yeah, that is what I will have to do...
[00:26:24] <Casper> I have 2 project that need an NTC
[00:26:56] <Casper> the formula to calculate it is just... too complex
[00:27:53] <Casper> 8 division, 2 multiplication, a natural log, a substraction and an addition, all in float
[00:28:36] <Casper> I think last time I tried, it took 13k of flash
[00:28:45] <Casper> and the formula was wrong :D
[00:32:29] <Thrashbarg> That's a RIGHT triangle you idiot! D'oh!
[00:36:23] <Casper> Thrashbarg: you're talking to yourself now?
[00:36:49] <Thrashbarg> just reminded me when Homer tried to recite Pythagoras and got it wrong
[00:45:31] <Casper> bed time
[00:45:33] <Casper> nite
[01:45:09] <rue_school> just use a blooming lookup table
[01:45:23] <rue_school> if you want more resolution then interpolate the result points
[02:00:25] <megal0maniac> rue_school: I very nearly searched for "blooming lookup table"
[02:00:36] <megal0maniac> Thought it was some special type of LUT
[02:00:51] <megal0maniac> Glad I didn't get as far as actually searching
[02:02:12] <megal0maniac> +1 for LUT though @ Casper - you save the computation time and you can store the whole thing in flash
[02:05:49] <Jartza> http://www.verkkokauppa.com/fi/product/61543/gcdns/Tagsu-elektroninen-nimilappu
[02:05:51] <Jartza> :)
[03:35:36] <LeoNerd> megal0maniac: Perhaps that's a LUT that uses a Bloom filter
[03:51:38] <Jartza> display lead time 45 days
[04:01:20] <tkoskine> Jartza: I would have though that volumes for Tagsu are too low to make sense to sell it for "ordinary" customers via Verkkokauppa.com.
[04:10:49] <Jartza> tkoskine: I thought so too
[04:11:14] <Jartza> but they asked to sell it
[04:14:14] <Jartza> and sold out in 3 hours
[04:19:06] <tkoskine> Nice.
[04:42:06] <LeoNerd> Huh.. So apparently my osciloscope's quoted vertical accuracy is 4%, and that's considered OK...?
[04:42:47] <LeoNerd> A DC supply measuring 5.120V according to my meter, reads as 5.21, 5.18, 5.17 or 5.30V on the scope
[04:43:48] <LeoNerd> That worst channel is 0.18V off.. 3.5% error
[04:44:18] <LeoNerd> Which is also why trying to use the MATH channel to do current reading is stupid.. hence I feel at least a little validated in my design :)
[05:40:39] <ferdna> LeoNerd, hmmm... what kind of multimeter are you using to take your measurements?
[06:09:31] <LeoNerd> ferdna: A Uni-Trend 61E
[06:09:43] <LeoNerd> So.. not *great*, but it claims 0.1% accuracy, and it agrees to the digit with two other meters I have
[06:10:06] <LeoNerd> 5.12, 5.12, 5.120 on respectively, a 20yearold Precision Gold, a 10yearold LCR, and a brand new UniTrend
[06:10:27] <LeoNerd> And anywhere between 5.18 and 5.30(!) on my new Rigol scope, across the various channels
[06:18:04] <ferdna> LeoNerd, what a dilemma
[06:18:05] <ferdna> hehehe
[06:21:57] <LeoNerd> Hrm... so it's not just the cheap ones. This scope is sub-$500 and has 4% gain accuracy. Right up the other end of the range, Rigol makes one at a whisker under $10,000 and that still only claims 2%
[06:31:16] <ferdna> LeoNerd, didnt know that
[06:31:21] <ferdna> i too own a rigol...
[06:31:32] <ferdna> and they come with a certifacte
[06:31:38] <ferdna> calibration certificate.
[06:59:38] <phinxy> Can anyone identify this stator in the bottom left corner. Can you see if its a single-phase or a three-phase? https://web.archive.org/web/20110809091352/http://www.fullgas4strokesquad.be/images_info/electrical/SkyST50ST110.jpg
[07:44:42] * LeoNerd reads http://www.cmicrotek.com/Accurate_current_measurements_with_oscilloscopes.pdf
[10:08:18] <day> i bought a buttload of atmega88 on ebay from china...i start to wonder if they are fake too
[10:08:38] <day> ups wasnt at the bottom
[10:09:03] <Emil_> day: they probably are fake
[10:09:06] <Emil_> but who cares?
[10:09:12] <Emil_> They usually perform a bit better
[10:09:26] <Emil_> though they aren't tested nearly as rigorously
[10:09:33] <Emil_> I heard they are usually some arm variant
[10:19:02] <day> Emil_: you mean they emulate the µC on a different one?
[10:20:08] <day> it looks like a daunting task to me, to reverse engineer the hardware of an µC and actually create a working copy
[10:24:52] <twnqx> nah
[10:25:02] <twnqx> not if it's as simple as an 8bit
[11:11:27] <Emil_> day: what twnqx said
[13:53:32] <Jordan_U> I am using asserts in Atmel studio, and when an assertion fails I would like to be able to easily tell which assert failed and why. Ideally I would like to be able to start a debug session and have it break exactly where the assertion failed so that I can examine relevant variables. How would you suggest accomplishing this? I now have a working solution, a no-op function with a breakpoint that gets called when an assertion ...
[13:53:38] <Jordan_U> ... fails, which I then step out of, but I'm still hoping that there is something less cludgy available.
[14:00:51] <Mr_Sheesh> Jordan_U - Put a unique identifier in the asserts (or have them include source file name and line number)
[14:01:15] <Mr_Sheesh> send those out your debug comms line
[14:01:29] <Jordan_U> Mr_Sheesh: I don't currently have a debug comms line.
[14:02:01] <Mr_Sheesh> Aaah. I tend to have ttl serial or something so I can debug easier; Eats a little code space but can really help
[14:02:52] <Mr_Sheesh> Send something like "AF filename.c 1234\n" and that's pretty clear (AF for Assert Failed)
[14:04:38] <Mr_Sheesh> If you have an oscope you could send a pulse train that'd communicate the unique ID?
[14:06:42] <Mr_Sheesh> just do short pulse then 1 med pulse for a '1', long for a '0', 2 med for a '2' etc.
[14:09:58] <Jordan_U> Mr_Sheesh: Right now my ugly breakpoint solution actually gives me more than that, as I can step back into the function where the assertion failed and debug normally. But I may consider those options for other use cases.
[15:01:03] <bss36504|2> IJordan_U: I think your solution is probably the best to catch assertion fails during debug. I cant see any other way to do what youre doing, as you'd basically be asking for this feature to be built into the assert feature.
[15:24:49] <aep> does the avr328p come from the factory with external clock fuses set?
[15:25:01] <aep> cant flash mine. looks like its missing a clock according to the internet :/
[15:25:52] <bss36504|2> aep: Dean Camera told us once that there are certian product codes that come that way, and others that do not. The product codes may not necessarly be available or easily understood when just looking at a digikey page.
[15:26:27] <sebus> aep nope
[15:26:39] <aep> hm ;/
[15:26:42] <sebus> You can try use external clock or crystal
[15:26:48] <aep> yeah trying that now
[15:27:04] <sebus> are you sure your programmer / wiring is ok?
[15:27:23] <bss36504|2> I mean, if it didnt work without a crystal,and it does with, and he reads the fuses and they come back that way, then I think it would mean that atmel *does* in fact ship them that way
[15:27:36] <aep> no. i'm not sure of anything. this is my own board and its the first run
[15:27:47] <bss36504|2> ooh how fun
[15:28:57] <sebus> aep anything tied to the spi bus?
[15:29:02] <aep> well, i put a clock on xtal1 as suggested by http://www.avrfreaks.net/forum/device-signature-0x000000
[15:29:05] <aep> didnt work
[15:29:07] <aep> hmm yes
[15:29:08] <sebus> use multimeter, check everything...
[15:29:15] <sebus> and then double check.
[15:29:33] <sebus> use breadboard and try to read / write chip there
[15:29:48] <aep> too small stuff. the whole circuit worked on a breakboard
[15:29:52] <aep> with a preflashed bootloader tho :/
[15:30:24] <aep> so yeah there's something on SDA/SCL. is that an issue?
[15:30:24] <bss36504|2> aep: do you have a pcb schematic, or part of one, that you;d like us to look at? Also, try turning your programming header around. Seems to work for me. Must be related to the "three-state USB plug" paradox. Also, I have had cases where supplying a ttl clock didnt work but a real crystal did. I think you need to ground Xtal0 though if you use the external clock signal.
[15:30:32] <aep> sure
[15:30:33] <bss36504|2> That could do it.
[15:32:31] <bss36504> Hope i didnt miss anything.
[15:33:54] <aep> bss36504: https://drive.google.com/file/d/0B9Ztc5nN1-bjdHU3aWJ5TXhPTHM/view
[15:34:09] <aep> note i did NOT populate the crystal
[15:34:50] <aep> most of it is a direct copy of the arduino
[15:36:00] <bss36504> aep: I notice you dont have a dedicated programming header, so wiring from your programmer to the board could be the problem.
[15:37:30] <aep> uuh
[15:37:39] <aep> its JP7
[15:37:49] <aep> miso mosi rst and clk
[15:37:51] <aep> all there
[15:38:44] <bss36504> aep: sidebar; I have had *horrible* luck with the MIC5205. Maybe I got a dud batch, but the load regulation was terrible. The input source had like 700mV pp at like 1Khz, and it couldnt filter it even with 470uF caps on the input and output
[15:39:07] <bss36504> aep: As for the header, I just meant you didnt use the 6 pin "atmel" connector
[15:39:23] <bss36504> so maybe the interconnect between your programmer and JP7 is the issue
[15:39:25] <aep> yeah. not a great part. but for now i'm directly powering it through vcc anyway
[15:39:31] <aep> oh
[15:39:46] <aep> well that wiring worked on a circuit board
[15:39:47] <bss36504> I love TI TPS731xx regulators. More expensive, but so good.
[15:39:52] <aep> yah
[15:40:05] <bss36504> ok, well then maybe not the wiring.
[15:40:20] <aep> i have a 16Mhz resonator. i'll throw it on it and see
[15:40:32] <aep> supplying a clock through another arduino didnt help
[15:40:52] <bss36504> might be the easiest solution for a quick check. Like I said, i've had limited success with the "recovery clock" thing.
[15:41:11] <aep> i was assuming they ship with internal clock D:
[15:41:20] <aep> sad
[15:41:21] <bss36504> I feel ya
[15:41:27] <bss36504> but that would make way too much sense.
[15:42:17] <bss36504> But hey, at least you put the footprint for the resonator on the board. I dont know what package youre using, but at least youre not trying to solder a can crystal and two caps to the pads next to a QFN.
[15:43:10] <aep> yeah, i have a SMD resonator. going to bondwire it
[15:43:17] <aep> i prepared for all sorts of crap :D
[15:43:28] <aep> there's a million solder jumpers in case my RTC circuit doesnt work
[15:44:43] <bss36504> I noticed that, those are great. theyre annoying if you have to switch them around a lot, but for debugging early boards you cant beat them.
[15:47:00] <aep> btw is the reset fine this way with the cap?
[15:47:10] <aep> copied it from arduino. seemed to work on breadboard
[15:47:17] <aep> i'm worried reset might not work and thats the reason
[15:48:29] <Lambda_Aurigae> cap on the reset is part of the ardweeny bootloader init stuff as I recall.
[15:49:08] <aep> yeah i coped it from arduino
[15:50:10] <aep> crystal didnt help
[15:52:49] <aep> hm not sure what crystals are supposed to look like on an osciloscope, but this isnt just a sine
[15:53:23] <learath> heh
[15:53:27] <Lambda_Aurigae> do you have the two caps connected to the crystal?
[15:53:28] <learath> crystals do not produce a sine wave :P
[15:53:44] <aep> its a resonator. so should be all in there :)
[15:53:53] <aep> learath: what do they do?
[15:54:00] <learath> "resonator" usually refers to not a crystal?
[15:54:02] <Lambda_Aurigae> then it's not a crystal
[15:54:15] <Lambda_Aurigae> resonator is a ceramic thing.
[15:54:22] <Lambda_Aurigae> crystal is usually a quartz core.
[15:54:28] <aep> yeah
[15:54:45] <Lambda_Aurigae> different settings in the AVR for them.
[15:54:59] <aep> oh crap really?
[15:55:10] <aep> that might be why it wont boot :(
[15:55:31] <learath> I'm trying to find a good picture of just a crystal... it goes high then low, but it's by no means a sine wave
[15:55:34] <Lambda_Aurigae> you haven't read the datasheet?
[15:55:41] <learath> (and it entirely depends on the crystal)
[15:55:48] <learath> well. not "entirely"
[15:55:49] <aep> well i kinda did and selected the resonator it said it supported
[15:55:54] <aep> didnt know you had to set fuses
[15:55:55] <bss36504> Isnt it asso pretty hard to measure a crystal?
[15:56:05] <Lambda_Aurigae> fuses is how you set the different clock sources.
[15:56:13] <bss36504> I thought when you put a scope proboe on one it destabilizes the oscillations.
[15:56:20] <learath> bss36504: it depends
[15:56:23] <aep> ah
[15:56:27] <learath> but that's entirely possible
[15:56:28] <Lambda_Aurigae> a crystal, or a resonator, does not produce anything but a single pulse in response to a pulse sent to it.
[15:56:50] <Lambda_Aurigae> the speed of that response determines the frequency.
[15:57:00] <aep> makes sense
[15:57:17] <aep> maybe my scope isnt good enough for 16Mhz /me checks datasheet
[15:58:10] <Lambda_Aurigae> the crystal or resonator just completes an oscillator circuit that oscillates depending on the response of the crystal or resonator.
[15:58:20] <aep> 50Mhz bandwidth. i guess thats ok?
[15:58:31] <bss36504> yeah you'd be able to see something, if there was something to see.
[15:58:40] <aep> i see something. alot of noise
[15:58:41] <learath> should be plenty.
[15:58:53] <bss36504> what package is this 328 in?
[15:59:05] <Lambda_Aurigae> feed the chip with a clock pulse in the order of 500KHz.
[15:59:06] <aep> tqfp
[15:59:21] <aep> Lambda_Aurigae: did that with another arduino
[15:59:24] <aep> didnt help :/
[15:59:42] <bss36504> Lambda_Aurigae: Does he need to ground XTAL2? I thought that was necessary for the clock-in configuration
[15:59:52] <aep> is there a way i can check if the chip is alive at all? the circuitry is good and eating exactly the ampage i expect from an alive avr
[15:59:57] <Lambda_Aurigae> I don't remember...check the datasheet.
[16:00:06] <aep> oooh
[16:00:37] <aep> i'll just try that. its all hopeless as this point anyway :D
[16:00:50] <aep> although i wonder why it wont come up with the exact resonator it specifies in the datasheet
[16:01:00] <Lambda_Aurigae> or buy/make/acquire a high voltage programmer.
[16:01:03] <aep> still wondering if its my reset
[16:01:26] <Lambda_Aurigae> get the cap off the reset line and pull it high with a 10Kohm resistor.
[16:01:41] <aep> hmyeah, might try that as well
[16:02:01] <bss36504> Section 9.2.1 : Default Clock Source
[16:02:01] <bss36504> The device is shipped with internal RC oscillator at 8.0MHz and with the fuse CKDIV8 programmed, resulting in
[16:02:01] <bss36504> 1.0MHz system clock.
[16:02:08] <aep> hmm
[16:02:16] <Lambda_Aurigae> unless you have the rest of the ardweeny circuit tied to it, that's what you need to do....the resistor isn't needed for programming as your programmer will pull the reset line low..
[16:02:40] <Lambda_Aurigae> but the resistor should be there for runtime.
[16:03:41] <bss36504> aep: I dont think that cap will cause problems. It's just hanging off into space, unless DTR is connected to something else.
[16:04:04] <bss36504> Check the reset line with a scope. See if there is any funny business besides what the programmer does to it.
[16:04:12] <Lambda_Aurigae> aep, how are you programming this thing? what hardware?
[16:04:23] <aep> oh yah, let me try that first
[16:04:26] <aep> with another arduino
[16:04:48] <Lambda_Aurigae> ISP?
[16:04:48] <aep> with the "arduino as an isp" thing
[16:04:51] <aep> yah
[16:05:08] <Lambda_Aurigae> well, I'm gonna back out of this conversation.
[16:05:31] <aep> aw thanks for helping
[16:05:32] <Lambda_Aurigae> due to too much arduino.
[16:05:38] <aep> heh
[16:07:14] <aep> yeah reset doesnt go low
[16:07:16] <aep> checked with a scope
[16:14:03] <bss36504> Lambda_Aurigae: lol
[16:14:17] <bss36504> aep: Oh well that would be the problem. No reset Low, no ISP.
[16:14:42] <aep> desoldered everything and wired reset to the mcu directly
[16:14:43] <bss36504> aep: wait, you did connect the reset to your "programmer", right?
[16:14:45] <aep> not much luck
[16:14:48] <aep> heh yes
[16:15:00] <bss36504> Also just buy a bare board Atmel ICE. $35USD.
[16:15:02] <aep> i have some tinyusb based one as well. would need to fix it.
[16:15:16] <aep> i think i even have a dragon
[16:15:18] <aep> somewhere
[16:15:32] <aep> it worked with the arduino thing tho, and the atmel stuff never works on linux :(
[16:15:57] <Lambda_Aurigae> avr-gcc works just fine on linux.
[16:15:59] <bss36504> Not even close to the same thing. I have a dragon, and I never used it. I was like "I have to wire the F-ing programmer to make it talk to the chip? No way" and I bought a JTAGICE3
[16:16:02] <Lambda_Aurigae> never needed anything more.
[16:16:19] <aep> nah, i mean their programmer
[16:16:28] <aep> had to use windows and their IDE to get it working
[16:16:34] <aep> never worked with avrdude
[16:16:35] <Lambda_Aurigae> stk200, stk500, avrdragon, all work on linux.
[16:16:48] <Lambda_Aurigae> avrdude works on linux and windows both.
[16:16:50] <aep> wait. let me look up the thing i have
[16:16:59] <Lambda_Aurigae> and mac for that matter.
[16:16:59] <bss36504> aep: The dragon needs configuration wiring if i recall. It was stupid.
[16:17:09] <aep> the box says jtagice3
[16:17:09] <Lambda_Aurigae> my dragon just needed hooked to the chip.
[16:17:17] <bss36504> aep: USE THAT
[16:17:19] <aep> i think i sent back the dragon because it was annoying
[16:17:22] <bss36504> so so so much better.
[16:17:29] <bss36504> haha exactly my thoughts.
[16:17:29] <aep> okay okay :D
[16:17:32] <Lambda_Aurigae> dragon is nice because it can do hvsp/hvpp
[16:17:34] <aep> let me wire it up
[16:17:43] <bss36504> Lambda_Aurigae: The one redemming quality :P
[16:17:53] <Lambda_Aurigae> only thing I ever use it for actually.
[16:18:15] <Lambda_Aurigae> it was cheap..got the dragon and an stk500 for less than the cost of either back when digikey had a sale many years ago.
[16:18:33] <bss36504> It's like having a breadboard project that you actually need to keep intact. I'm always afraid Im going to short it out or lose a configuration wire.
[16:18:45] <bss36504> Thats a good deal
[16:18:56] <Lambda_Aurigae> yeah..was like 45 dollars for the pair or something like that.
[16:19:01] <Lambda_Aurigae> I don't remember exactly
[16:19:12] <Lambda_Aurigae> but it was like, "buy one and we will pay you to take the other!"
[16:24:44] <aep> anyone knows the pinout of this thing? https://goo.gl/photos/RfGXGSjNTyqEaNLYA
[16:24:53] <aep> no clue where 1 is
[16:25:16] <aep> according to this http://www.avrfreaks.net/sites/default/files/ISP%20wiring.jpg one side is all GND, but it isnt
[16:26:12] <Lambda_Aurigae> VTG is power/vcc
[16:26:15] <aep> im just going to assume the top left is 1
[16:26:29] <bss36504> aep: http://www.elechouse.com/elechouse/images/product/Atmel%20AVRISP%20STK500%20USB%20ISP%20Programmer/avr_isp.jpg
[16:26:43] <bss36504> Readacted
[16:26:50] <bss36504> sorry. I didnt look at your second link
[16:26:52] <aep> bss36504: yeah but which one is 1 :D
[16:27:24] <bss36504> I mean, I usualy plug it in until it works :P
[16:28:54] <aep> yeah thats what i usually do
[16:28:59] <aep> but in this case nothing works
[16:29:02] <aep> so kinda hard to test
[16:30:33] <bss36504> well use it on your arduino then.
[16:30:43] <aep> good idea
[16:33:17] <bss36504> aep: im headed out for the night. I hope you get it. I'll check back tomorrow
[16:33:46] <aep> thanks!
[16:35:02] <aep> hm. doesnt work either way round on the arduino
[16:52:55] <aep> cant get it to work on anything
[16:53:02] <aep> i guess this is why i dont use the jtagice
[16:53:21] <aep> Lambda_Aurigae: halp ;)
[17:05:28] <aep> wtf it started working magically with the arduino as an isp
[21:39:24] <FoxGT> Tom_itx, are you still selling programmers?
[21:43:55] <Tom_itx> not actively but i have a few
[21:44:07] <Tom_itx> iirc i have some blue ones
[21:45:27] <Tom_itx> been physically unable to assemble them for a while but recovering
[21:48:47] <FoxGT> Uh oh... what happened?
[21:51:56] <rue_school> technology difference of oppinion
[21:52:24] <rue_school> have an eta on getting that dealt with?