#avr | Logs for 2015-06-16

Back
[01:48:06] <rue_bed> let me guess, 2 bit DAC
[07:15:25] <mzbotre_> I'm trying to use SPI pins of my ATMega328 to pull the entire range of memory in a bricked BIOS(8 pin dip, using a breadboard+noninv. hex buffer, all wired).
[07:15:44] <mzbotre_> Could someone help me along some parts of writing+uploading the code to my board to do this?
[07:16:02] <twnqx> lulz
[07:16:15] <twnqx> ping me in ~6-7h
[07:16:17] <mzbotre_> I have an SD card that I could use to write this, but I'm using AVRdude so I think I should be able to alloc memory in the master box before I send it
[07:16:36] <twnqx> when i have access to my full spi rom code
[07:16:40] <twnqx> spi flash*
[07:16:48] <mzbotre_> (: thanks man
[07:20:25] <kdehl> If I program an AVR to use an external clock source that I don't have, it renders it unresponsive until I connect that very clock source. But, can I use high-voltage programming to save it too, or does that still require that I use the external clock?
[07:26:25] <gjm> you can
[07:29:07] <twnqx> HVP works always, yes
[07:32:44] <kdehl> Alright, thanks!
[07:34:59] <LeoNerd> HV{S,P}P is always a thing you can do, unless the chip is faulty/destroyed
[07:45:18] <twnqx> hm
[07:45:33] <twnqx> is HVSP support on the same pins as ISP?
[07:46:15] <LeoNerd> No, usually different
[07:46:27] <twnqx> damn
[07:46:27] <LeoNerd> Needs more pins anyway; HVSP needs 7 lines in total
[07:46:51] <twnqx> i have a 32u4 that doesn't respond to ISP and doesn't seem to run a program (nothing on USB)
[07:47:03] <LeoNerd> 32U4 is HVPP
[07:47:04] <twnqx> might have been worth a try, but not with more effort :P
[07:47:14] <LeoNerd> The only HVSP parts are the small 8 or 14-pin ATtiny chips
[07:47:27] <LeoNerd> Anything with enough pins to do parallel uses HVPP instead
[07:48:05] <LeoNerd> HVSP is *effectively* just HVPP internals, with a couple of shift registers in front of the parallel lines, driven by serial + clock pins to get the IO pin count down small enough
[07:53:51] <mzbotre_> I want to push my ATMega328's clock to 1MHz from 4Mhz, Using direct port manipulation+bin ops, can this be done?
[07:54:05] <LeoNerd> Huh?
[07:54:37] <gjm> u wot m8
[07:57:14] <mzbotre_> ok better as this, I have a BIOS chip I'm working on
[07:57:52] <mzbotre_> I can set the size addressed in my reads, SPSR, and hope that I read the right sized buffers.
[07:58:00] <mzbotre_> or shift the right sized buffers
[08:03:38] <mzbotre_> better question. I'm pulling data from an EEPROM array all hooked up to my atmega. I have code to do this which I can upload with avrdude. When I'm doing this, I want to be saving the bits I read to a file allocated on my main computer (not the atmega I upload the code to).
[08:03:44] <mzbotre_> this is possible right?
[09:47:42] <rue_house> sure, somewhere I have firmware that will dump to serial in IHEX records
[12:45:52] <LeoNerd> Since it's quiet I'm going to think out loud + take a little survey of opinions
[12:46:42] <LeoNerd> I recently got an oscillioscope, and one thing I want to measure with it is current consumption of small projects, often USB-powered. So I'm thinking of making a little current-shunt amp. The core of the design will be some sort of bus-powered shunt amp, that outputs a voltage proportional to the current drop across some shunt resistor.
[12:47:29] <LeoNerd> I have a few in mind. But now I'm considering on features, and how far to take it. It's a thing I probably want to make+sell on Tindie, so some amount of considering what things people might like seems prudent. E.g. I'll definitely want USB in/out sockets to place it inline in a USB powered project.. but what about other things like screw posts?
[12:49:09] <LeoNerd> For outputs: probably some simple header pins, plus maybe a couple of BNC outputs for voltage/current so I can tap that directly to the scope. But then I start to think further...
[12:49:32] <LeoNerd> Maybe if it was self-powered as well it could hold some kind of MCU.. use the ADC inputs to drive an LED display so it works self-contained without the scope as well.
[12:50:18] <LeoNerd> Maybe add a big FET on the power input side of things, give the MCU shutdown control. Shut it down if it goes over-current, or outside of voltage range.
[12:50:33] <LeoNerd> Maybe use a USB-capable chip, give it USB-TMD support...
[12:50:43] <LeoNerd> And then it starts to run away a bit ;) Ideas? Thoughts?
[13:09:02] <LeoNerd> ... nobody? <.<
[13:41:11] <sebus> LeoNerd wago screw clamps are useful in such stuff
[13:42:38] <LeoNerd> E.g. these things? http://www.alpha-crucis.com/en/connectors-en/3468-screw-terminal-block-2-pin-35-mm-pitch-side-entry-4-pack-3700386724442.html
[13:42:49] <sebus> yep
[13:42:56] <LeoNerd> Yeah.. that sounds reasonable
[13:43:02] <sebus> if you need something more power-hungry
[13:43:04] <LeoNerd> I'm just wondering more how far to take the circuit
[13:43:11] <LeoNerd> It's probably going ot be <500mA
[13:43:20] <sebus> such things can deliver more than 2A
[13:43:22] <LeoNerd> I don't really go high
[13:43:22] <LeoNerd> Yeah
[13:43:29] <LeoNerd> But usually I don't make things that far
[13:43:34] <sebus> but even without it... you can just use any wire to your protoboard
[13:43:52] <mzbotre_> Anyone got some good source to throw in avr-gcc to setup SPI communication with a BIOS chip as my EEPROM slave? '
[13:44:28] <LeoNerd> SPI is.. er... about 4 lines of code
[13:45:12] <mzbotre_> all for combinations of low/low, low/high, high,high, high,low?
[13:45:20] <mzbotre_> for the slave selection?
[13:45:34] <mzbotre_> the rest of the payload being just dumb shifts?
[13:45:36] <LeoNerd> Mmm?
[13:45:52] <mzbotre_> (: then I'm right! Thank you
[13:46:02] <mzbotre_> Never done this before, first time deblobbing
[13:48:36] <sebus> LeoNerd http://oi58.tinypic.com/34pf2xk.jpg
[13:48:50] <sebus> wago256 2.5
[13:49:00] <LeoNerd> hmmm
[13:49:01] <sebus> there are more... :>
[13:49:14] <LeoNerd> Connectors aren't really the main question area
[13:49:31] <LeoNerd> It was more a matter of how far to take the other side... MCU with bargraphs/LED segments? Overcurrent trip?
[13:49:33] <LeoNerd> USB control?
[13:49:49] <sebus> USB / serial control + app
[13:50:03] <LeoNerd> I'm sure I *would* use all such features at some point, but they'd push the cost up sufficiently far that maybe people wouldn't want to pay that for features they're not going to use
[13:50:37] <sebus> a code that send stuff over serial can be useful
[13:50:47] <sebus> like eg. datalogging in putty or something
[13:50:50] <LeoNerd> Wellsure
[13:51:01] <LeoNerd> Prettymuch every feature *could* be useful
[13:51:09] <LeoNerd> I'm trying to draw the line of justification; features vs. cost
[13:51:33] <sebus> and now decide how small stuff you want to measure
[13:51:48] <sebus> microamps? miliamps? resolution?
[13:51:51] <LeoNerd> 1mA res. would be nice
[13:52:10] <LeoNerd> Thing is, resolution isn't really the problem if it has analog outputs from the currnet sense amp
[13:52:22] <LeoNerd> Accuracy is though. the thing I have an eye on is 0.5%, which seems reasonable
[13:52:39] <LeoNerd> Though I can't find any currentsense shunt resistors less than 1% :(
[13:53:00] <sebus> wait
[13:53:13] * sebus is looking for some on disk
[13:54:01] <LeoNerd> Oh I did find some 0.1% but they're like... £3 each or something craaaazy
[13:54:27] <LeoNerd> Hm.. Doesn't gaussian suggest that if I put (2? 4?) 1% resistors together I'll get within 0.5%?
[13:57:11] * LeoNerd awaits further opinion
[14:00:05] <sebus> FC4L110R050FER this one is good
[14:00:37] <sebus> but price... I can have some under €2.20
[14:01:36] <sebus> 50 mOhms 50 ppm
[14:01:44] <LeoNerd> Hrmmm
[14:01:45] <sebus> 1% but still
[14:02:21] <sebus> now second stuff... good op-amps
[14:02:39] <LeoNerd> TS1102
[14:02:55] <LeoNerd> It's a SOT23-sized shunt amp, that has the fun property that it's line-powered.
[14:03:20] <LeoNerd> So literally just that chip and the sense resistor, and that's *it*. No need for external power supply, and straight away you put two BNCs on that board and you have a voltage/current sensor board
[14:03:21] <sebus> something like.. INA12x, 19x series?
[14:03:32] <LeoNerd> The INAs are similar yes, but those want external VCC
[14:04:48] <sebus> wow
[14:04:56] <sebus> silabs stuff
[14:13:13] <RikusW> mzbotre_: SPI is easy, but you'll need the eeprom chip datasheet to get its commands and registers
[14:37:52] <LeoNerd> RikusW: Hi. Howgoes?
[14:38:21] <RikusW> Hi LeoNerd, just reading some news website
[14:38:45] <RikusW> alternet
[14:38:51] <LeoNerd> I might actually get around to the dW hackery soon. Seems my HVSP controller is being better behaved too
[14:39:10] <RikusW> and your uart problems ?
[14:39:19] <LeoNerd> Sorted
[14:39:29] <LeoNerd> Was dodgy soldering on the crystal somewhere
[14:39:40] <LeoNerd> I just reflowed the lot and now it's happier
[14:39:55] <RikusW> good :)
[14:39:57] <LeoNerd> All it needed was me to buy a £300 'scope to watch the lines ;)
[14:40:11] <LeoNerd> But hey... I have a scope now, so... can't complain
[14:40:33] <RikusW> yep
[14:41:04] <LeoNerd> Would you have any thoughts on my current sense probe? see above about 2h ago
[14:42:04] <RikusW> zlog
[14:42:37] <LeoNerd> Oh huh, yeah you joimed just after \i asked
[14:48:52] <RikusW> if you do put a shunt resistor in the usb ground line, your device's ground won't be 0V anymore, unless its milliohms...
[14:49:05] <LeoNerd> Highside shunt
[14:49:38] <LeoNerd> I'm more at thus point asking for opinions on which features people would like
[14:49:40] <LeoNerd> this
[14:50:06] <RikusW> with differential amp ?
[14:50:31] <LeoNerd> Yeah; see TS1101
[14:50:41] <LeoNerd> 1102 even
[15:06:44] <RikusW> nice ic :)
[15:07:28] <RikusW> though I'm confused as to which side of the resistor RS+ should be connected
[15:08:43] <RikusW> ah, RS+ is connected to the - of the opamp...
[15:10:36] <LeoNerd> That soudns... odd.. I forget offhand
[15:10:57] <LeoNerd> In any case, the minimal configuration is just that + resistor on a tiny board. USB -> sensor -> USB; then a tap for current/voltage out to scope.
[15:10:58] <RikusW> RS+ is to the battery side
[15:12:13] <RikusW> Did you ever consider using an AVR to measure inductance/capacitance ?
[15:12:25] <LeoNerd> Hrm.. not yet. Notsure how
[15:12:34] <LeoNerd> Doesn't seem like a good fit for this yet
[15:13:22] <sebus> that might be good for another project RikusW
[15:13:29] <RikusW> indeed
[15:13:35] <sebus> L/C / esr meter
[15:13:43] <LeoNerd> Yeah the general aim of this is "power monitoring/management of small USB or similarly powered projects"
[15:13:57] <LeoNerd> Just something that can tell me "oops you shorted that out so I shut you down you numpty"
[15:14:01] <RikusW> there are some nice ones from PEAK, but its expensive...
[15:14:12] <LeoNerd> I have a PEAK component analyser
[15:14:21] <LeoNerd> I have an LCR too, just not a PEAK one. Different thing.
[15:14:29] <sebus> LeoNerd maybe some overload protection that can be set?
[15:14:33] <LeoNerd> It's a Maplin rebadge job, I don't know who made it originally
[15:14:53] <LeoNerd> sebus: wlel maybe; yes. That's one possible idea for a feature. That's definitely under the "MCU control" end of things, not the simple probe
[15:15:12] <RikusW> your peak one is for diodes and transistors ?
[15:15:24] <LeoNerd> Yeah - it tells me what's what. DCA55
[15:15:47] <LeoNerd> Really useful for SMT LEDs. Just slap it on the breakout either way around, then measure it to mark A/K afterwards ;)
[15:15:53] <LeoNerd> http://www.peakelec.co.uk/acatalog/jz_dca55.html
[15:16:11] <RikusW> I just check for mosfet / bipolar / broken using a simple diode tester
[15:16:27] <LeoNerd> 'tis what I did last night to make these => https://twitter.com/cpan_pevans/status/610582779223515136
[15:16:48] <LeoNerd> Notice the black/white painting on the boards
[15:20:49] <RikusW> Vbc usually measures slightly lower than Vbe
[15:24:16] <LeoNerd> Well anyhow.. I think we've drifted from the question :)
[15:28:29] <LeoNerd> Doh
[15:37:41] <sebus> http://imgur.com/HlQrBsJ
[15:37:55] <sebus> look what I've found...
[15:38:11] <sebus> anybody knows who made them?
[16:58:13] <Jan-> hihi :)
[16:58:39] <Jan-> I have a few nrf24l01 radio modules. does the plus version take the same electrical interface? are the non-plus ones I have so obsolete I should throw them out?
[16:58:54] <LeoNerd> Basically the same, yup
[16:59:10] <LeoNerd> I think the only real difference is that the + can do the special low-bitrate high-sensitivity 250kbit/sec mode
[16:59:18] <Jan-> oh, handy
[16:59:34] <Jan-> so I can just dev with what I have, then tweak for the plus version later?
[16:59:47] <LeoNerd> Physically and electrically they are identical
[16:59:57] <Jan-> the ones I have are the onboard antenna modules
[17:00:03] <LeoNerd> The + version just defines a few more bits in config registers and the like, that previously were "zero"
[17:00:03] <Jan-> so they probably blow as regards range and so on
[17:00:05] <Jan-> but for dev, etc.
[17:00:13] <LeoNerd> I've got reasonable range out of them
[17:00:18] <Jan-> I only need tens of feet.
[17:00:52] <LeoNerd> I recently managed probably a good 50 feet or so, in a crowded (~600people) stage hall, between one of those, and one with the little rubberduck antenna
[17:00:55] <Jan-> I read a piece with some guy who had some amplified ones (?) and he was getting 1000m or more.
[17:01:05] <Jan-> I'm not sure how legal they are, worldwide, though
[17:01:09] <Jan-> that must be 100mw plus surely
[17:02:46] <LeoNerd> Hah
[17:02:55] <LeoNerd> Yeah.. I doubt you could get 1km off these
[17:03:34] <Jan-> I guess it's way better with a proper antenna.
[17:04:06] <Jan-> I would just see about connecting an antenna to these but that would involve getting involved with microwave blackmagic
[17:05:38] <Jan-> they have a lot of features.
[17:05:46] * Jan- hides behind the sofa, from all the features
[17:05:49] <Jan-> a lot of featres :/
[17:07:51] <Jan-> oh dear they require 3.3v
[17:08:10] <LeoNerd> That's not a particularly hard problem though ;)
[17:08:13] <Jan-> no.
[17:08:21] <Jan-> oh, on the upside it has 5v tolerant inputs.
[17:08:24] <Jan-> :D
[17:08:25] <LeoNerd> Yah
[17:08:44] <LeoNerd> I run my handheld remote entirely at 3.3V, using a LiFePO4 cell
[17:09:43] <Jan-> they're pretty complicated.
[17:09:51] <Jan-> it's like a whole other world of radio system in there
[17:09:55] <LeoNerd> Mmmhm
[17:10:28] <Jan-> how are these things so cheap
[17:10:30] <Jan-> it's crazy
[17:10:40] <Jan-> I remember when anything radio cost an internal organ and your firstborn child.
[17:10:44] * Jan- feels old
[17:10:45] <LeoNerd> Yeah indeed
[17:10:53] <LeoNerd> I last bought a pack of four for £5
[17:10:55] <LeoNerd> Crazy times
[17:11:01] <LeoNerd> Today my lunch cost me nearly double that
[17:12:57] <Jan-> uhhuh
[17:13:14] <Jan-> I want to make a widget I can stick on the head end of my guitar and send midi change messages to my processor
[17:13:19] * Jan- ponders
[17:28:49] <Jan-> is a function called GetReg specific to the code I have here, or is that some generic AVR thing I should know about?
[17:29:03] <LeoNerd> Never heard of it
[17:29:44] <Jartza> sounds specific to your code
[17:29:56] <Jartza> avr libc functions are all lowercase
[17:30:18] <Jan-> buhh
[17:30:29] <Jan-> it's used here, with no explanation: http://gizmosnack.blogspot.co.uk/2013/04/tutorial-nrf24l01-and-avr.html
[17:50:32] * Jan- gets it now
[17:51:27] <kdehl> Pull-up resistors on pins configured as input are disabled by default, no? I'm trying to find that very info in the datasheet, but it only tells you how to toggle it, as far as I can find.
[17:51:46] <kdehl> But when I test it it seems like it's disabled.
[17:51:52] <kdehl> I'm using ATmega1284P.
[18:34:18] <LeoNerd> Woo.. well my IR-based proximity/gesture sensor is now working nicely reliably
[18:34:26] <LeoNerd> I can detect left- or right-swipes across the board
[18:35:32] <Lambda_Aurigae> what kind of range?
[18:36:24] <LeoNerd> Oh only about 15cm
[18:36:31] <LeoNerd> It detects hands across a set of buttons
[18:36:45] <LeoNerd> The prox part is so I can dimly light up some leds set behind each button, to see them in the dark
[18:37:01] <LeoNerd> The swipe part is to have a gesture-based control in addition to the buttons
[18:37:05] <Lambda_Aurigae> have you ever worked with LEDs as sensors?
[18:37:15] <LeoNerd> Basically because I can; it's an easy addition to make with a second IR LED
[18:38:41] <Lambda_Aurigae> there was an article some years back about a guy who was using an 8x8 led matrix as both input and output device.
[18:39:31] <Casper> now
[18:39:42] <Casper> convert it from IR to capacitive!
[18:40:21] <Lambda_Aurigae> using the LEDs as capacitive sensors!
[18:40:57] <LeoNerd> I have cap sensors as well
[18:41:03] <LeoNerd> They're must closer .. they're basically touch only
[18:41:08] <LeoNerd> I'll get a photo of this setup later
[19:50:28] <mzbotre_> Can someone share an SPI library for avr-gcc/g++ to work with EEPROM memory?
[19:50:37] <mzbotre_> A single master, 8 pins, ATMEGA328.
[19:51:06] <mzbotre_> Need good read/write functionality and a good way to select the buffer length
[19:52:56] <Lambda_Aurigae> hmm.
[19:54:27] <Lambda_Aurigae> have you looked at procyon avrlib?
[19:54:31] <Lambda_Aurigae> it's old but it works.
[19:56:53] <mzbotre_> No not yet, thanks for the ref
[19:57:25] <Lambda_Aurigae> http://www.procyonengineering.com/embedded/avr/avrlib/docs/html/index.html
[19:57:45] <Lambda_Aurigae> will give you a starting point if nothing else.
[19:58:14] <Lambda_Aurigae> looks like the spi eeprom lib is not fully tested but it should work.
[20:29:18] <mzbotre_> I think the include directory for my avr-gcc has been lost
[20:29:31] <mzbotre_> for example, #include <avr/io.h> is not found in any path.
[20:29:39] <mzbotre_> I've set path to include this file's directory
[20:29:43] <mzbotre_> and use -I$PATH
[20:29:45] <mzbotre_> no use.
[20:29:47] <mzbotre_> help
[20:30:29] <mzbotre_> oh wow
[20:30:31] <mzbotre_> wrong binary
[20:30:32] <mzbotre_> sorry