#avr | Logs for 2016-01-14

Back
[02:24:00] <Haohmaru> there seems to be an inconsistency in the io headers for xmega timer/counter type 0..
[02:24:26] <Haohmaru> TC0_BYTEM_bm is defined 0x01, but the datasheet shows two bits, so it should be 0x03
[02:24:49] <Haohmaru> that's in avrgcc headers
[03:19:39] <MarkX> what would prevent an interrupt from occuring?
[03:19:43] <MarkX> TCCR1B = (1 << WGM12) | (1 << CS11) | (1 << CS10); // Set Timer1 as CTC and set a prescaler (64)
[03:19:43] <MarkX> TIMSK1 = (1 << TOIE1); // Enable Timer1 overflow interrupt so we can count up our elapsed millis
[03:19:44] <MarkX> OCR1AL = 250; // Set Timer1 TOP as 250 because it will take 250 ticks to get 1 millisecond
[03:19:56] <MarkX> ISR(TIMER1_OVF_vect)
[03:19:56] <MarkX> {
[03:19:56] <MarkX> millis++;
[03:19:56] <MarkX> }
[03:20:07] <MarkX> pretty simple, with sei() in the main routine
[03:32:36] <phinxy> MarkX im newbie but dont you want TCCR1B |=
[03:33:32] <phinxy> nevermind x)
[03:34:33] <phinxy> this is how my TIMSK looks like TIMSK3 |= (1 << OCIE3A);
[03:34:46] <phinxy> its OCIE not TOIE
[03:35:10] <phinxy> otherwise mine is not different
[03:35:30] <phinxy> and im doing a 1s interrupt for a clock
[03:36:17] <Haohmaru> r u ticking me
[03:37:00] <phinxy> okay so TOIE is overflow-interrupt and OCIE is compare match interrupt
[03:38:04] <phinxy> ISR(TIMER3_COMPA_vect) for overflow
[03:38:15] <phinxy> i mean for compare match
[03:39:04] <MarkX> figured it out
[03:39:46] <MarkX> the issue is that the timer sets the overflow flag at MAX (255). but i have it never going to MAX. in CTC the timer gets cleared as soon as it hits the TOP which in my case is 250
[03:40:03] <MarkX> so i can;t be looking at the overflow interrupt, i have to look at the compareA interrupt
[03:40:11] <MarkX> compare A match interrupt*
[11:10:15] <LeoNerd> Anyone played much with the ATmega TWI ("I²C") interface? I was using it last night, and I have it working, even though I don't quite understand /why/ it works.
[11:10:28] <LeoNerd> Most notably, I don't really follow how the interface knows if it's supposed to be sending, or receiving a byte
[11:12:13] <nuxil> dosent the datasheet tell you ?
[11:12:24] <LeoNerd> Not really... the datasheets rarely explain the inner workings of the chips
[11:12:44] <LeoNerd> It says what steps you should follow to perform a task, and I follow those steps, and it works. I'm just not sure I understand why
[11:13:08] <nuxil> heh. aint that fun :p
[11:17:25] <gevorg> hmmm, you tell it through reigsters, whether it will receieve or send
[11:17:34] <LeoNerd> Which register?
[11:17:46] <LeoNerd> Which control register and which bit tells it it's in transmit or receive mode? I don't see one
[11:17:54] <gevorg> gimme a sec
[11:18:17] <LeoNerd> Hint: I have successfully written code to talk I2C and I didn't have to program in such a register bit
[11:18:17] <LeoNerd> :)
[11:18:54] <nuxil> http://electronics.stackexchange.com/questions/57940/establishing-a-proper-twi-i2c-communication-between-a-pair-of-atmega32
[11:18:55] <LeoNerd> The only thing I can imagine might be happening is that the TWI controller remembers the value of the addressing byte it sent, and remembers if it was addressing for write or read
[11:18:59] <nuxil> of any help ?
[11:19:40] <LeoNerd> Nope
[11:20:28] <LeoNerd> Again to be clear: most of the instructions I'm reading simply say "Do A and B to achieve X". I have done A and B and I observe I did achieve X. My code is workign fine. I just don't as an engineer understand how X can be achieved simply by doing A and B
[11:23:55] <gevorg> hmmm I guess it would have to do with TWEA bit.. try not setting it, see if you get any data (read I mean)
[11:28:10] <gevorg> hmmm, yeah it has to do with the address, once you set the TWSTA bit, starting a transmission, it checks the R/W bit, and depending on that, using TWEA you choose to send a recv_ack or recv_nack
[11:28:47] <LeoNerd> Hmmm
[11:29:02] <LeoNerd> I imagined it must have to yes, as I couldn't work out any other way it would know
[11:29:08] <gevorg> "In order to enter MT mode, SLA+W must be transmitted. This is done by writing SLA+W to TWDR.
[11:29:12] <gevorg> Thereafter the TWINT bit should be cleared (by writing it to one) to continue the transfer."
[11:29:20] <gevorg> MT - master transmit
[11:30:22] <gevorg> yeah, this describes it better
[11:30:24] <gevorg> "The format of the
[11:30:24] <gevorg> following address packet determines whether Master Transmitter or Master Receiver mode is to be entered. If
[11:30:27] <gevorg> SLA+W is transmitted, MT mode is entered, if SLA+R is transmitted, MR mode is entered."
[11:30:47] <LeoNerd> Ahhhh yes, that sounds likely
[11:30:48] <LeoNerd> Where's that?
[11:30:52] <gevorg> following to the start condition, that is
[11:31:12] <gevorg> in my case its Atmega644a page 218, want a link ?
[11:31:39] <LeoNerd> I'm reading the 328P here, so it's likely a bit differen.. what's the section heading name?
[11:31:48] <LeoNerd> Usually the names at least match up, even if the numbers/pages don't
[11:31:55] <gevorg> or in TWI -> Transmission modes -> Master receive mode
[11:32:06] <gevorg> yeah, probably the texts match as well
[11:32:17] <gevorg> surely they are not rewriting it everytime
[11:32:26] <LeoNerd> Hopefully :)
[11:32:37] <LeoNerd> I've often wanted Atmel to do little overview + link-based docs on these chips
[11:32:58] <LeoNerd> Having one giant ~400 page document is all well and good, but when I use any of about 20 chips, what I'd like to see is "can I reuse the same code as I did on that last chip?"
[11:33:24] <LeoNerd> It would be nice to simply note what peripheral units each chip has and what "version" or variant they are, and then document those variants in their own documents
[11:33:59] <gevorg> yeaah, that'd be neat
[11:34:06] <LeoNerd> Especially timers
[11:34:26] <LeoNerd> They're the things that vary the most... because there's many of them with different kinds, at different locations
[11:34:56] <LeoNerd> Ahh and yes I'e just found the text you quoted in my DS here
[11:36:30] <gevorg> I wonder, does atmel have a special group that writes datasheets, and if so, how much do they get paid
[11:36:52] <LeoNerd> Hah.. Not very much, if I guess correctly by the number of stupid typoes and spelling mistakes I find in them
[11:37:04] <LeoNerd> I found a /really/ subtle mistake in the HVSP docs of the attiny84, also
[11:37:21] <LeoNerd> I say "mistake" - it might not be.. there's a small chance it's an intentional one
[11:37:46] <gevorg> .. intriguing
[11:38:08] <gevorg> what is it, may I ask
[11:38:22] <LeoNerd> It's around the bitpattern tables explaining how HVSP mode works...
[11:39:03] <LeoNerd> The bit patterns around (IIRC) EEPROM writing imply a toggling of a status line that doesn't actually make sense at that moment in time. It doesn't break the transfer, it's just not necessary
[11:39:17] <gevorg> ahh, well hvsp is used only when you messed up the fuses, I suppose nobody updated it for years now :D
[11:40:02] <LeoNerd> Nah.. I use it on the little 8pin tinys
[11:40:22] <LeoNerd> It's useful for working with reset disabled, so you get 6 GPIOs instead of 5
[11:40:40] <gevorg> ahh, well that's a plus for 8 pins
[11:40:51] <LeoNerd> Less useful on a giant 40pin monster, say..
[11:40:55] <gevorg> but you have to unplug it from the system, don't you ?
[11:40:59] <LeoNerd> Sometimes
[11:41:02] <LeoNerd> Depends on the circuit
[11:41:21] <LeoNerd> E.g. a setup I use it in, the reset pin is a flying probe that's not actually connected to the rest of the circuit anyway
[11:41:30] <LeoNerd> So it's quite OK to just put +12V into that
[11:43:13] <gevorg> interesting :3
[11:48:34] <LeoNerd> Huh.. ohwow.. the TWI slave module in the tiny1634 is nothing like the TWI master/slave module in an ATmega
[11:50:40] <gevorg> is it called USI ?
[11:51:16] <LeoNerd> Nono...
[11:51:30] <LeoNerd> Most of the ATtinys have a USI... the tiny1634 in addition has a full I²C slave module
[11:51:42] <LeoNerd> because it turns out that using the USI to implement an I²C slave is actually really hard
[11:51:46] <LeoNerd> so most people don't
[11:52:02] <gevorg> I think attiny441 has I2C slave (TWI) as well
[11:52:11] <LeoNerd> Mm.. yah; possibly other chips do
[11:52:26] <LeoNerd> The USI slightly annoys me on the 'tiny chips, because there's only one
[11:52:39] <LeoNerd> On an ATmega there's a separate SPI and I²C module, with separate pins on each, so you can talk both buses at once
[11:53:00] <LeoNerd> But on an ATtiny, the USI doesn't have switcable pins so you can't talk both SPI and I²C
[11:53:30] <gevorg> yeah, well that's why they are tiny
[11:53:37] * LeoNerd really really really wants switchable peripheral <-> pin mappings
[11:53:38] <gevorg> with USI implementing i2c, is partly software, partly hardware, and it gets messy
[11:53:47] <gevorg> well pic has them
[11:53:51] <LeoNerd> Yah..
[11:53:59] <LeoNerd> Ohoho.. and now Microchip has bought Atmel
[11:54:03] <LeoNerd> so maybe we'll get them on AVRs :)
[11:54:11] <gevorg> altough, isn't there a bot to kick people out of this chennel when it sees PIC in their message
[11:54:28] <gevorg> *channel
[11:54:41] <LeoNerd> hehehe
[11:55:09] <LeoNerd> I dunno.. I generally much prefer AVRs, but the PICs do have a few nice tricks it'd be great to see come over to AVR
[11:55:22] <gevorg> yeah, it would
[11:55:24] <LeoNerd> Remappable IO pins is one... another is the more flexible reference voltage unit in the PIC
[11:55:40] <LeoNerd> On an AVR, you can either use Vcc, or the internal bandgap at 1.024V. That's it
[11:55:59] <nuxil> oh, atmel sold to microchip?
[11:56:02] <LeoNerd> On a PIC, they have a 16-tap divider chain between those, so you can pick some fraction of it
[11:56:04] <gevorg> and *vref*
[11:56:15] <LeoNerd> Wellyes, and external Vref
[11:56:56] <gevorg> yeah, we would have to wait to see
[11:57:04] <LeoNerd> Butyeah... switchable IO pins would be very nice
[11:57:08] <LeoNerd> Then I wouldn't be stuck on the 32U4
[11:57:21] <LeoNerd> 32U4 shares UARTs and I²C' pins, with the four INTn pins
[11:57:36] <gevorg> hah, good planing on their side
[11:57:46] <LeoNerd> So you do get 4 external interrupt pins, but... only if you don't want to use any I²C slaves.
[11:58:10] <LeoNerd> If you /are/ using I²C, it's quite likely you'll need an INT line or two, no? ;) Seems reasonable
[11:58:21] <LeoNerd> But that's OK... you stil have two of them. Oh.. only they're shared with the UART
[11:58:30] <gevorg> lol
[11:58:41] <LeoNerd> This Wouldn't Happen On A PIC
[11:58:53] <LeoNerd> (or an LPC810 or an STM32 or ...)
[12:54:25] <cehteh> ok .. at 62.5kHz clock one can still do 300 baud :D
[12:54:46] <LeoNerd> Cute
[12:55:01] <cehteh> debugging in slowmotion :D
[12:56:16] <LeoNerd> Mmmm
[12:56:32] <cehteh> mhm may try 150 baud
[12:56:51] <cehteh> because at 16Mhz 150 baud was too slow, divider overflow :D
[12:58:12] <cehteh> with my scheduler i use the buildin led (arduino nano, D13) to indicate whenever the cpu is busy and turn it off while going to sleep
[12:58:37] <LeoNerd> ooooh
[12:58:39] <LeoNerd> I should do that
[12:58:49] <LeoNerd> That's actually a really cute idea :)
[12:58:54] <cehteh> at slomo one can see each wakeup, and using dmm hz/duty cycle to measure cpu load :D
[12:59:39] <cehteh> blinking led at 2hz gives 2.55% cpu load at 62.5khz
[13:00:01] <LeoNerd> Ohyes, you can just measure the duty cycle
[13:00:13] <LeoNerd> Hrm.. or use it to power a slow RC filter and measure the output voltage
[13:00:37] <cehteh> i whish i had a oscilloscope ..
[13:00:52] <LeoNerd> Ah.. yes.. definitely :)
[13:00:54] <cehteh> anyway this works nicely for me now
[13:01:03] <LeoNerd> I have one and a week after I started using it I was like "man I wish I'd got this years ago"
[13:01:09] <LeoNerd> well, except that it wasn't available years ago...
[13:01:14] <gevorg_> what works, you got a 2000 fps camera there ?
[13:01:34] <cehteh> http://www.amazon.de/gp/product/B00OK3NC26 is on my wishlist :D
[13:01:58] <LeoNerd> Hrm.. how does that compare to the Rigol DS1054Z?
[13:02:05] <cehteh> huuuuge display
[13:02:11] <LeoNerd> .. ohman yes it is huge
[13:02:17] <LeoNerd> Though only 2 channel. I do like my 4
[13:02:55] <cehteh> and much more memory
[13:03:13] <LeoNerd> How much..?
[13:03:57] <LeoNerd> Hm.. I don't see the sample memory quoted
[13:04:37] <cehteh> 10m
[13:04:46] <cehteh> http://www.owon.co.uk/wsb4318264101/SDS%20series%20A.asp
[13:04:57] <LeoNerd> Hm.. yah; the Rigol has 24Msample
[13:05:11] <cehteh> oh different rigol then
[13:05:25] <LeoNerd> Curious that they're claiming 100MHz though, then saying the analog frontend only does 60
[13:05:32] <cehteh> yeah
[13:05:44] <cehteh> well 60mhz is already plenty for what i would need it
[13:05:49] <cehteh> the more the better
[13:05:52] <LeoNerd> Mm.. yeah mine is only 50
[13:06:17] <gevorg_> 60+ would be for RF applications
[13:06:22] <cehteh> but there is no reason to choose by only mhz .. with digital stuff memory depth is much more important
[13:06:38] <LeoNerd> Eh...
[13:06:50] <LeoNerd> For digital stuff I have my Saleae(clone) + sigrok
[13:06:56] <LeoNerd> I wouldn't use a scope for digital signals
[13:06:56] <cehteh> and i really need to look for the price, that owon is already more than i'd like to pay, but its specs seem quite good
[13:07:48] <cehteh> hobbyist here, i need something rudimentary which can do a lot things at once, maybe not everything perfectly
[13:08:01] * LeoNerd nod
[13:08:16] <LeoNerd> Get one of those dirtcheap £20 saleae clones and run sigrok (free opensource) against it
[13:08:16] <cehteh> for a professional lab ofc one want to buy different tihngs
[13:08:23] <LeoNerd> Those are really useful for any sort of digital stuff
[13:08:44] <cehteh> maybe
[13:09:16] <gevorg_> is sigrok good with linux ?
[13:09:25] <cehteh> anyway .. i am just innovative by blinking leds and measuring duty cycles
[13:09:27] <LeoNerd> It primarily runs on Linux :)
[13:09:33] <LeoNerd> It's C++ / Qt based
[13:10:15] <gevorg_> nice, I need to investigate in that more
[13:10:16] <cehteh> i need something more versatile, sometimes (light) digital things, 2 channel are mostly ok then
[13:10:29] <cehteh> sometimes analog
[13:10:41] <LeoNerd> Ah... so not really "digital" things like SPI/I²C/etc..
[13:10:52] <cehteh> well for now it stays in my wishlist not buying it anytime soon
[13:10:55] <LeoNerd> I find sigrok really useful there
[13:11:13] <gevorg_> how many channels does your clone give ?
[13:11:26] <LeoNerd> You can say "Ohyes these lines are an SPI port", and get SPI byte number sout, and then say "Ohyes, and attached to that is an nRF24L01 radio module", and then it understands the config registers and bitflags and all sorts :)
[13:11:32] <LeoNerd> No scope would ever do that
[13:11:36] <LeoNerd> 8
[13:11:40] <cehteh> http://www.amazon.de/Saleae-Analyzer-8Channel-saleae-support/dp/B00EEWBPU4
[13:11:42] <cehteh> mhm
[13:12:03] <LeoNerd> I might oneday get a /real/ Saleae Pro unit... but for now my £20 clone is just fine :)
[13:12:15] <LeoNerd> It has problems going much beyond 8Mbit, but eh.. that's fine for me
[13:13:19] <gevorg_> hmmm
[13:13:42] <cehteh> http://www.amazon.de/Saleae-Analyzer-8Channel-saleae-support/dp/B00DPCDEV2
[13:13:46] <gevorg_> those guys are like 7 bucks on ebay
[13:13:50] <cehteh> guess i shall just order that ..
[13:14:06] <LeoNerd> Hah
[13:14:09] <LeoNerd> Ohyeah, that's a clone
[13:14:13] <LeoNerd> That's most definitely not a real unit :)
[13:14:21] <LeoNerd> Butyes, that's the same one I have
[13:14:54] <LeoNerd> You might want to do with it what Idid to mine, and you see in the second photo, those tiiiiny little black DIL4 chip resistor packs? heatgun them off the board
[13:15:02] <LeoNerd> They are stupidstupidstupid 10k pullups on the probe lines
[13:15:22] <LeoNerd> If you leave them attached then your probes will apply 10k of pullup-to-Vcc wherever you attach them in your circuit
[13:15:23] <cehteh> lol ok
[13:15:42] <gevorg_> well, what if someone was playing a joke, selling the real thing for $7
[13:15:42] <gevorg_> most probably not
[13:15:43] <LeoNerd> And this will drive you /insane/ trying to work out whatthefuck is going on, until you discover this
[13:16:12] <LeoNerd> The downside is that floating probes will now give you lots of noise on the level display, but you can ignore that
[13:16:22] <LeoNerd> small price to pay for not loading your circuit-under-test
[13:18:24] <cehteh> maybe replace it with 1M pullups
[13:18:43] <LeoNerd> Eh.. possibly? but even so... any kind of pullup upsets some of the circuits I have
[13:18:50] <cehteh> yeah
[13:18:54] <LeoNerd> I'm using a bidirectional "bus-keeper" level shifter
[13:18:59] <cehteh> ok .. 1M switchable pullups :D
[13:19:06] <LeoNerd> maaaaybe 1M would be OK.. I'm not sure
[13:19:40] <cehteh> anyway .. i just ordered it
[13:19:50] <LeoNerd> :)
[13:22:12] <cehteh> but you are right 10k pullup is waaaay to low, that'll interfere with almost anything
[13:22:51] <cehteh> would be nice to have a programmable pullup/pulldown with few values selectable, per channel
[13:23:05] <LeoNerd> Mhmm
[13:23:18] <LeoNerd> But now we're getting away from £20/unit ;)
[13:23:54] <cehteh> lala
[13:26:38] <cehteh> https://www.saleae.com/counterfeit
[13:27:12] <cehteh> 95% of what makes Logic a fantastic tool is its software ... i dont use their software so i dont need to feel ashamed using a clone :D
[13:29:27] <gevorg> totally
[13:29:59] <LeoNerd> Yah
[13:30:08] <gevorg> how the hell is their name pronounced ?
[13:30:22] <LeoNerd> sigh - grock
[13:30:30] <LeoNerd> Or maybe sig - rock
[13:30:32] <LeoNerd> I'm not sure
[13:30:52] <LeoNerd> OHwait; them... Sal - ee - ay
[13:32:30] <gevorg> sal like in salt, ee like ee, and ay like Ayyy
[13:34:31] <gevorg> weird name, that's why they don't make much money
[13:44:31] <cehteh> when you want to make money you choose a simple name .. like 'apple' :D
[13:44:57] <gevorg> yeah :D
[13:55:11] <nuxil> anyone of you ever used LTspice ?
[13:55:26] <Thrashbarg> yeah what's up?
[13:56:30] <nuxil> i just installed it.. quick question,, where in gods name are components like Led's, Transistors etc. all i see is basic stuff on the menubar ;E
[13:56:44] <nuxil> like resistors, normal diods
[13:57:15] <Thrashbarg> there's an AND gate there, if you click on it it'll bring up a window with external definitions
[13:58:41] <nuxil> huh.. be more spesific. i see alot of and logic blocks around here.
[13:59:39] <Thrashbarg> you've got buttons for resistors, capacitors, inductors, diodes and one that looks like an AND gate on the top toolbar
[14:00:06] <Thrashbarg> click on it and it'll open a window with a list of files for component symbols
[14:00:38] <nuxil> found it :)
[14:01:15] <Thrashbarg> good
[14:01:22] <nuxil> thx
[14:01:34] <Thrashbarg> no problem
[14:02:33] <Thrashbarg> there's a bit of a learning curve on SPICE. LTspice makes it easier but it makes a lot of sense when you figure it out
[14:02:49] <nuxil> yea i guess.
[14:03:00] <nuxil> + its gui is soo 1995 :p
[14:03:08] <Thrashbarg> yea
[14:03:45] <Thrashbarg> the way the scroll wheel and moving things about behave drives me nuts sometimes
[14:04:14] <nuxil> haha.. was about to say that.. its just crap :p
[14:04:34] <Thrashbarg> heh
[14:04:50] <Thrashbarg> http://www.falstad.com/circuit/ <-- I use this one sometimes too, helps to visualise how the circuit works
[14:05:57] * cehteh too
[14:06:05] <cehteh> but its not always correct :D
[14:06:10] <Thrashbarg> yup
[14:06:16] <Thrashbarg> good for simple stuff
[14:13:48] <cehteh> down to 50 baud .. lets try 15 :D
[14:14:38] <cehteh> mhm no
[14:15:54] <cehteh> ohnoes .. 30 doesnt work either :D
[14:20:09] <cehteh> guess there is some lower limit what the ftdi can do too
[14:23:58] <lorenzo> talking about ltspice, I've finally figured out how to produce a square wave :D
[14:36:09] <Jartza> evening
[14:38:28] <LeoNerd> RikusW: Hi... So I worked something out a while ago...
[14:38:45] <RikusW> Hi LeoNerd
[14:39:29] <LeoNerd> RikusW: youknow I was having trouble with UART timing on that tiny841? I've recently been looking at an entirely unrelated project, which wants a 32kHz RTC crystal and a 14.7456MHz UART crystal, so I've been reading all about load capacitance
[14:39:54] <RikusW> ah yes
[14:39:57] <LeoNerd> So whne it says a crystal wants a "load cap 18pF", say.. that doesn't mean, as I did, that you should put two 18pF caps, one on each side
[14:40:36] <LeoNerd> it means it wants to see 18pF in total.. so given a stray of perhaps 3pF on a good PCB layout, that leaves 15pF it wants to see, for both load caps. so maybe 2x 30pF caps are what's wanting there
[14:40:41] <LeoNerd> "oops" :)
[14:41:29] <RikusW> 2x30 ?..
[14:50:57] <LeoNerd> So the "load" capacitors are effectively in parallel
[14:51:02] <LeoNerd> xtal to ground, each.
[14:51:11] <LeoNerd> Er.. series
[14:51:19] <LeoNerd> series, across the xtal
[14:51:31] <LeoNerd> 2 30pF caps in series like that look like 15pF
[14:54:14] <RikusW> iirc the atmel datasheets specifies 18-22pF x 2
[14:56:27] <LeoNerd> Well, it depends more on the crystal
[14:56:51] <LeoNerd> The crystal is tuned for some total amount of load capacitance, of which the oscillator pins of the chip and the PCB contribute some... the rest needs to come from those caps
[15:10:00] <LeoNerd> Anyway, in summary I think to improve/fix my HVSP controller board, I just need to increase the timer xtal caps a bit
[15:14:23] <RikusW> try and let me know
[15:14:36] <RikusW> anyways, I'm getting really sleepy
[16:15:51] <keithbrown> i need some help
[16:16:37] <keithbrown> i cant seem to burn the arduino bootloader onto an atmega328p au chip
[16:17:17] <keithbrown> i prototyped everything on a bread board then i decided to order a board from oshpark
[16:17:26] <keithbrown> and went smd
[16:17:59] <keithbrown> now after i assembled everything i cant connect
[16:18:11] <keithbrown> using a usbasp
[16:18:58] <LeoNerd> That ought to work... check oscillator setup, right pins, etc...?
[16:19:18] <keithbrown> 16mhz crystal
[16:19:40] <keithbrown> i basically coppied the setup from the opensource nano sch
[16:20:19] <LeoNerd> Make sure you've got MISO/MOSI the right way round
[16:20:22] <LeoNerd> I'm forever making that mistake
[16:20:34] <keithbrown> my device has a BLE chip and i was going to play with bluetooth input and output
[16:20:57] <keithbrown> LeoNerd: 5,000 x checked everything
[16:21:23] <keithbrown> LeoNerd: would you mind looking at my sch
[16:22:24] <LeoNerd> sure
[16:23:35] <keithbrown> how should i get it too you
[16:23:51] <keithbrown> (new to irc)
[16:26:11] <keithbrown> @LeoNerd it would be great if you could help. i've been googling and whatnot for weeks.
[16:26:44] <LeoNerd> Some sort of web link woudl be traditional
[16:26:57] <keithbrown> @LeoNerd these are the errors btw
[16:27:02] <keithbrown> avrdude: auto set sck period (because given equals null)
[16:27:02] <keithbrown> avrdude: warning: cannot set sck period. please check for usbasp firmware update.
[16:27:02] <keithbrown> avrdude: error: programm enable: target doesn't answer. 1
[16:27:04] <keithbrown> avrdude: initialization failed, rc=-1
[16:27:06] <keithbrown> Double check connections and try again, or use -F to override
[16:27:08] <keithbrown> this check.
[16:27:51] <LeoNerd> Yeah, that's just the generic avrdude "eh, I couldn't talk to the chip" complaint
[16:27:53] <LeoNerd> could be anything.
[16:28:05] <LeoNerd> Do you have a logic probe/analyser? you could watch the actual lines on the chip
[16:28:23] <keithbrown> no i dont
[16:28:26] <keithbrown> https://www.dropbox.com/s/hvv9f45vnpm7ct6/MOBLE_Driver.sch?dl=0
[16:29:24] <LeoNerd> Hrm. what sort of file is this?
[16:29:40] <keithbrown> eagle
[16:29:53] <LeoNerd> Ah, it's an eagle
[16:30:04] <LeoNerd> I don't think kicad can open those
[16:30:13] <LeoNerd> maybe you could export it as a plain image of some kind? PDF maybe?
[16:30:55] <keithbrown> sure one sec
[16:32:15] <keithbrown> https://www.dropbox.com/s/oq4ova0u89ksyr0/MOBLE_Driver.pdf?dl=0
[16:32:36] <Jartza> keithbrown: have you tried -B4 parameter for avrdude?
[16:32:39] <Jartza> or -B8
[16:32:55] <keithbrown> Jartza:
[16:32:59] <keithbrown> Jartza: no
[16:33:02] <Jartza> try that
[16:33:13] <keithbrown> (what does that do?)
[16:33:19] <Jartza> slows down the programming speed
[16:33:21] <LeoNerd> I'm not sure that MISO is in the right place
[16:34:13] <LeoNerd> PB3/4/5 it should be
[16:34:25] <LeoNerd> You've got MOSI on PD7
[16:34:34] <LeoNerd> and MISO on PB0
[16:34:47] <keithbrown> i used this as a ref: http://www.hobbytronics.co.uk/image/data/tutorial/arduino-hardcore/atmega328-tqfp-arduino-pinout.jpg
[16:35:09] <LeoNerd> I'd use the real datasheet :)
[16:35:13] * LeoNerd is reading it
[16:35:54] <LeoNerd> Though again, even that one has MOSI/MISO/SCK on PB3/4/5
[16:36:04] <Jartza> MOSI = PB3 (17), MISO = PB4 (18), SCK = PB5 (19)
[16:36:15] <Jartza> RESET = PC6 (1)
[16:37:13] <keithbrown> crap!
[16:38:17] <keithbrown> ok, there is still hope
[16:38:37] <keithbrown> ill just use the "led pads i have
[16:39:08] <LeoNerd> Mmm :)
[16:39:20] <Jartza> oh sorry, pin numbers I gave you were pdip
[16:39:23] <Jartza> you have tqfp?
[16:39:32] <keithbrown> yes
[16:39:40] <LeoNerd> Don't forget that the pin numbers vary per package
[16:39:50] <Jartza> yep
[16:39:50] <LeoNerd> The functions you want are the named things - PB3 PB4 PB5
[16:40:19] <keithbrown> led 7,8,9
[16:40:24] <keithbrown> on my sch
[16:40:44] <keithbrown> ?
[16:41:02] <LeoNerd> I believe so
[16:41:07] <Jartza> looks like that yes
[16:41:26] <LeoNerd> In kicad, the ATmega328 part has reminders of all the pin function names on them
[16:41:34] <LeoNerd> It seems this eagle one isn't as helpful :/
[16:41:46] <keithbrown> yeah
[16:42:53] <keithbrown> so its PB3 (Mosi) PB4 (miso) PB5 (sck)
[16:43:29] <LeoNerd> Yup
[16:43:36] <keithbrown> wow
[16:43:39] <keithbrown> lol
[16:43:45] <keithbrown> what amess i made
[16:44:33] <LeoNerd> :)
[16:45:07] <keithbrown> thank you for your help..ill try later tonight...hve to feed the kids or else the authorities will come after me.. lol
[17:31:36] <stanreg> Would an AVR with USB capabilities sitting in parralel on a USB connection be able to capture all passing USB packets?
[17:36:12] <Lambda_Aurigae> not likely.
[17:36:25] <Lambda_Aurigae> might be possible to program it to listen only but,,,
[17:38:54] <lorenzo> stanreg: I doubt you'd have the throughput to capture
[17:39:07] <lorenzo> or even the memory to store in a circular buffer and then flush to pc
[17:39:43] <stanreg> lorenzo, usb 1.1 speeds shouldn't be problematic to handle, nay?
[17:40:05] <lorenzo> it tops at 12 Mbit/s iirc
[17:40:37] <lorenzo> stanreg: anyway, if you're just trying to sniff the interaction between a device and your computer you can do that in wireshark
[17:43:44] <stanreg> I understand about wireshark. I suppose that I was curious about the capabilities of a USB-enabled AVR and whether it could handle sniffing 12Mbit/s USB packets.
[17:47:37] <phinxy> this is my code, how do i put the big data blocks in a separate file? http://pastebin.com/3NyLR0Em
[17:53:04] <keithbrown> LeoNerd: still there?
[17:53:17] <keithbrown> Jartza: you too?
[17:53:49] <LeoNerd> hi
[17:53:56] <phinxy> i accidentally fed 5V to my atmega128 input pin while it was not powered. it was just for a second but i saw it start. it seems to work fine, is there any way of testing if a port is fried?
[17:54:28] <keithbrown> hey i changed the wires to the pads we talked about and am still getting the same error
[17:56:38] <keithbrown> LeoNerd: frustrating
[18:04:04] <Lambda_Aurigae> phinxy, write a program to test the pins as inputs and outputs.
[18:09:17] <LeoNerd> keithbrown: have you got reset in the right place too?
[18:09:38] <keithbrown> LeoNerd: yeah i believe that is right
[18:09:43] <keithbrown> do i need a pullup
[18:09:55] <LeoNerd> Not usually
[18:10:01] <keithbrown> pc6
[18:10:51] <keithbrown> i even tried an external 5v gnd
[18:11:01] <keithbrown> other than the ussasp
[18:11:08] <keithbrown> usbasp
[18:11:17] <keithbrown> do i need to update the firmware
[18:13:25] <Lambda_Aurigae> what is your clock source on the AVR?
[18:14:11] <keithbrown> not sure (how do i check)
[18:14:31] <keithbrown> i have a 16mhz crystal
[18:15:21] <keithbrown> https://www.dropbox.com/s/86dbh97kcdxdgcx/Photo%20Jan%2014%2C%205%2004%2041%20PM.jpg?dl=0
[18:15:34] <Lambda_Aurigae> and are the fuses set to use the crystal?
[18:15:36] <keithbrown> https://www.dropbox.com/s/t0ozl4lgsth7sqe/Photo%20Jan%2014%2C%205%2005%2019%20PM.jpg?dl=0
[18:15:53] <keithbrown> i cant even communicate with it
[18:16:05] <keithbrown> not letting me set anything
[18:16:38] <Lambda_Aurigae> what else is connected to the SPI pins on the AVR?
[18:16:58] <Lambda_Aurigae> is that wifi module connected SPI or UART?
[18:17:20] <keithbrown> https://www.dropbox.com/s/oq4ova0u89ksyr0/MOBLE_Driver.pdf?dl=0
[18:19:42] <Lambda_Aurigae> so, you are connecting to miso, mosi, sck, rst, and GND from the programmer?
[18:19:50] <Lambda_Aurigae> remember, miso to miso,,,,mosi to mosi...
[18:20:00] <keithbrown> yes
[18:23:32] <keithbrown> i tried this command
[18:23:52] <keithbrown> avrdude -c usbasp -p m328p -v -B4
[18:23:56] <keithbrown> got this
[18:24:05] <keithbrown> https://www.dropbox.com/s/xy5rf4kvhe7ds68/output.png?dl=0
[18:26:07] <Lambda_Aurigae> so update the usbasp?
[18:26:27] <keithbrown> i cant. i dont have another programmer
[18:26:48] <Lambda_Aurigae> looks like a usbasp issue to me.
[18:27:05] <Lambda_Aurigae> yet another.
[18:27:35] <keithbrown> but i can program my arduinos and other stuff with it
[18:27:39] <Lambda_Aurigae> usbasp is cheap and you get what you pay for.....use the usbasp to build and program another usbasp and put new firmware on it.
[18:28:11] <keithbrown> what about the fuses do you think they are right
[18:28:25] <Lambda_Aurigae> then use an ardweeny to upload the new firmware to the usbasp
[18:28:35] <Lambda_Aurigae> no clue about whether they are right or wrong.
[18:28:43] <Lambda_Aurigae> need to be able to talk to the chip to find out.
[18:28:45] <keithbrown> whats an ardweeny
[18:28:51] <Lambda_Aurigae> ardweeny/arduino
[18:29:07] <LeoNerd> Eh... my usbasp works fiiiine
[18:29:21] <LeoNerd> Though you should test yours with a known-working other board first, just to check
[18:29:32] <keithbrown> it workd with an uno
[18:29:42] <LeoNerd> OK
[18:29:48] <Lambda_Aurigae> LeoNerd, mine does too....but it seems people have more problems with usbasp than any other programmer....probably because there are so many of them out there.
[18:30:09] <Lambda_Aurigae> looks like his usbasp can't change programming speed and is unable to talk to the chip in question.
[18:30:21] <LeoNerd> Mine always complains about that
[18:30:23] <LeoNerd> I just ignore it
[18:30:36] <keithbrown> should i use b8 or b4
[18:30:50] <Lambda_Aurigae> LeoNerd, but his isn't working atall it seems.
[18:31:09] <keithbrown> it programs my other arduinos
[18:31:26] <LeoNerd> http://pastie.org/10690713 <== e.g. what mine said about 3 minutes ago
[18:32:12] <keithbrown> it might be my fuses
[18:32:29] <LeoNerd> ICSP does require a working oscillator, indeed
[18:34:08] <keithbrown> i know nothing about fuses
[18:34:38] <LeoNerd> Well, where'd the chip originally come from?
[18:34:56] <LeoNerd> As shipped by Atmel they're usually configured for internal 8MHz oscillator with DIV8 set
[18:35:12] <LeoNerd> Which /may/ mean you'll have to apply the slow clock hack
[18:35:23] <keithbrown> LeoNerd: element14
[18:35:29] <LeoNerd> Since avrdude can't set sck this way, try using the "slow clock" jumper
[18:35:52] <keithbrown> where do i place the jumper
[18:36:21] <LeoNerd> If your board is like mine, it's JP3, up in the top corner near the USB connector
[18:36:38] <LeoNerd> But no telling where it'll be on anyone else's board ;)
[18:36:47] <LeoNerd> usbasp isn't so much a standard, as more a ... vague handwavy suggestion
[18:38:31] <keithbrown> i have this one:
[18:38:32] <keithbrown> http://www.neuby.de/wp/wp-content/uploads/2013/06/USBasp.jpg
[18:39:15] <LeoNerd> Ah curious.. that's a little different from mine
[18:39:39] <LeoNerd> Also no voltage selector header
[18:41:22] <keithbrown> no there is a resistor
[18:41:35] <keithbrown> with a 3.3/5v>
[18:42:06] <keithbrown> wich means its probably 3.3
[18:42:21] <keithbrown> if i remove the TINY resister it prob 5v
[18:42:29] <keithbrown> dont want to do that
[18:44:56] <keithbrown> LeoNerd: http://www.avrfreaks.net/forum/automatic-software-controlled-clock-jumper-free-usbasp?name=PNphpBB2&file=viewtopic&t=129677
[18:46:12] <Lambda_Aurigae> that says you have to have a specific firmware to support that feature.
[18:46:28] <keithbrown> i dont have a jp3
[18:46:37] <keithbrown> just jp2
[18:46:40] <keithbrown> looks like
[18:47:09] <Lambda_Aurigae> so you have to figure out what version firmware you have on there and if it's too old, update it.
[18:47:25] <Lambda_Aurigae> you can use an arduino as a programmer....someone else will have to tell you how.
[18:47:55] <keithbrown> can i set the b#
[18:48:06] <keithbrown> i dont know what to
[18:49:54] <keithbrown> (this is so frusrating
[18:52:00] <Lambda_Aurigae> from the error you are getting, setting b# does no good with the current version of firmware on the usbasp.
[18:52:19] <Lambda_Aurigae> hence the need for the slowdown jumper.
[18:52:56] <Lambda_Aurigae> or to update to a firmware that can accept and use the b# command
[19:02:34] <keithbrown> ARG!
[19:04:45] <Lambda_Aurigae> use an arduino to program the target in question.
[19:04:54] <Lambda_Aurigae> arduino can be programmed to become a programmer
[19:05:05] <Lambda_Aurigae> there's a "sketch" or three out for it.
[19:05:08] <keithbrown> now as soon as i put the arduino isp sketch on the arduino it falls off the serial port and i cant... JESUS
[19:06:04] <Lambda_Aurigae> beyond that I know nothing...hopefully someone who uses arduino can help you.
[19:55:31] <keithbrown> Lambda_Aurigae: still there?
[19:55:49] <keithbrown> Lambda_Aurigae: im getting the error avrdude: stk500_recv(): programmer is not responding
[20:12:55] <keithbrown> anyone here
[20:13:43] <Casper> no
[20:13:55] <keithbrown> lol
[20:15:03] <Casper> sorry, I don't play league of legend
[20:15:04] <keithbrown> im now using the arduino as isp to burn to atmega328p au and i cant burn the bootloader
[20:15:52] <Casper> are you sure that your 328 is empty?
[20:16:38] <keithbrown> just got it from element14 and soldered it on
[20:16:56] <keithbrown> tqfp
[20:17:43] <Casper> can you identify it?
[20:19:13] <keithbrown> visually yeah lol
[20:19:30] <keithbrown> not from the command line
[20:20:20] <keithbrown> Keiths-iMac:~ keithbrown$ avrdude -c arduino -p m328p -v
[20:20:20] <keithbrown> avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
[20:20:20] <keithbrown> Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
[20:20:22] <keithbrown> Copyright (c) 2007-2009 Joerg Wunsch
[20:20:24] <keithbrown> System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
[20:20:26] <keithbrown> User configuration file is "/Users/keithbrown/.avrduderc"
[20:20:28] <keithbrown> User configuration file does not exist or is not a regular file, skipping
[20:20:30] <keithbrown> Using Port : unknown
[20:20:32] <keithbrown> Using Programmer : arduino
[20:20:34] <keithbrown> avrdude: ser_open(): can't open device "unknown": No such file or directory
[20:20:36] <keithbrown> ioctl("TIOCMGET"): Inappropriate ioctl for device
[20:20:38] <keithbrown> avrdude done. Thank you.
[20:21:28] <Casper> ah I see
[20:21:42] <phinxy> which is more effective if i want to loop trough a set number of values in a byte? use modulo % or an if(x>max) ?
[20:21:48] <Casper> did you actually flashed a programmer program on your arduinono?
[20:22:12] <keithbrown> my what?
[20:22:29] <Casper> the arduinono...
[20:22:36] * Casper don't likes those arduino... no...
[20:24:32] <keithbrown> yes i uploaded the arduino isp sketch
[20:26:33] <keithbrown> ok im getting somewhere (changed the reset pin) and now im getting this :
[20:26:37] <keithbrown> avrdude: Device signature = 0x000000
[20:26:37] <keithbrown> avrdude: Yikes! Invalid device signature.
[20:26:37] <keithbrown> Double check connections and try again, or use -F to override
[20:26:39] <keithbrown> this check.
[20:28:16] <Casper> that is a big step forward
[20:28:28] <Casper> it appear like the programmer work now<
[20:29:00] <Casper> as the message say, double check the connections
[20:29:12] <Casper> might be a miso-mosi issue
[20:30:11] <keithbrown> i swapped them no luck
[20:30:14] <keithbrown> same error
[20:30:49] <keithbrown> im using a 16mhz crystal...do i need to change fuse settings
[20:32:37] <Casper> on the programmer, the code need to match the clock speed. The fuses must match the clock source
[20:34:18] <keithbrown> sorry, not entirely sure what that means
[20:36:33] <keithbrown> Vtarget : 0.0 V
[20:36:33] <keithbrown> Varef : 0.0 V
[20:36:33] <keithbrown> Oscillator : Off
[20:36:35] <keithbrown> SCK period : 0.1 us
[20:53:51] <studdentt> who his familiiar with can bus ?
[20:55:16] <studdentt> i've got a transmitter node that sends K L M and a receiver node but it receives M K L, shoudlnt that be either KLM or MLK ?
[21:39:39] <keithbrown> Casper: still getting the signature error
[21:50:30] <WormFood> [06:27:00] <julius> WormFood, is the code you use to flash chips over ethernet open source? <-- Yes. It's part of Nut/OS. http://www.ethernut.de/en/software/index.html
[21:52:37] <WormFood> http://www.ethernut.de/en/eboot/index.html Ethernet Boot Loaders for AVR
[21:54:50] <Casper> keithbrown: your arduino code must be configured to whatever clock source you have.... might require a crystal
[21:55:18] <keithbrown> i have a crystal 16mhz
[22:07:28] <keithbrown> Casper: how can i figure out the clock i need to provide
[22:17:45] <WormFood> keithbrown, try using -c wiring with avrdude
[22:18:28] <keithbrown> WormFood: im getting further
[22:18:33] <keithbrown> avrdude: Device signature = 0x00ffff
[22:18:33] <keithbrown> avrdude: Expected signature for ATmega32U4 is 1E 95 87
[22:19:31] <keithbrown> avrdude: Device signature = 0xff0000
[22:19:31] <keithbrown> avrdude: Expected signature for ATMEGA328P is 1E 95 0F
[22:20:33] <WormFood> what command are you using?
[22:21:03] <keithbrown> WormFood: sudo avrdude -c stk500v1 -P /dev/tty.usbserial-A98RRP9D -p m328p -v -v
[22:21:17] <WormFood> it's an arduino?
[22:21:59] <keithbrown> yes
[22:22:22] <WormFood> did you change the programmer type to "wiring"?
[22:22:44] <keithbrown> let me try now
[22:23:34] <studdentt> heres what i used : avrdude -p c128 -P /dev/ttyUSB0 -c stk500 -U flash:w:receiver.hex
[22:24:12] <WormFood> studdentt, without knowing what hardware you're using, that's meaningless.
[22:24:22] <keithbrown> avrdude: wiring_open(): releasing DTR/RTS
[22:24:22] <keithbrown> avrdude: wiring_open(): asserting DTR/RTS
[22:24:22] <keithbrown> avrdude: ser_recv(): programmer is not responding
[22:24:24] <keithbrown> avrdude: stk500v2_ReceiveMessage(): timeout
[22:24:26] <keithbrown> avrdude: ser_recv(): programmer is not responding
[22:24:28] <keithbrown> avrdude: stk500v2_ReceiveMessage(): timeout
[22:24:30] <keithbrown> avrdude: ser_recv(): programmer is not responding
[22:24:32] <keithbrown> avrdude: stk500v2_ReceiveMessage(): timeout
[22:24:34] <keithbrown> avrdude: ser_recv(): programmer is not responding
[22:24:36] <keithbrown> avrdude: stk500v2_ReceiveMessage(): timeout
[22:24:37] <studdentt> this was to show the options
[22:24:38] <keithbrown> avrdude: ser_recv(): programmer is not responding
[22:24:40] <keithbrown> avrdude: stk500v2_ReceiveMessage(): timeout
[22:24:42] <keithbrown> avrdude: ser_recv(): programmer is not responding
[22:24:44] <keithbrown> avrdude: stk500v2_ReceiveMessage(): timeout
[22:24:46] <keithbrown> avrdude: stk500v2_getsync(): timeout communicating with programmer
[22:25:53] <WormFood> Jesus dude, you didn't need to spam the channel, just to say it's giving you a timeout error.
[22:27:26] <WormFood> You may need to change the port you're using. I've found that "wiring" is the most reliable for arduino, and that's what they use with the arduino IDE
[22:27:29] <keithbrown> WormFood: sorry new to irc
[22:27:58] <WormFood> It's not an irc issue.
[22:28:13] <keithbrown> WormFood: how would i change the port?
[22:28:23] <WormFood> Anyways, I need to head out, and go to a neighboring city (东莞).
[22:28:59] <WormFood> Look in your log files for what it creates when you plug it in. Mine was /dev/usb/ttyUSB0 or something like that.
[22:29:03] <keithbrown> WormFood: thanks for helping
[22:29:58] <WormFood> some /dev entries are cooked, and some are raw. You may be getting the wrong one, by using what you are. I'd need to see it in more detail to know for sure. Anyways, since it stopped raining, I gotta split. Good luck.
[22:30:02] <studdentt> -P then your port
[22:30:37] <WormFood> studdentt, he's using -P, but I'm suggesting the device he's picked may be the wrong type.
[22:31:01] <keithbrown> WormFood: its an arduino nano
[22:31:10] <keithbrown> throught the ide
[22:31:14] <studdentt> keithbrown: try this dmesg | grep tty
[22:31:15] <keithbrown> through
[22:31:29] <studdentt> see the port is it attached to
[22:32:23] <keithbrown> it didnt do anything
[22:32:57] <studdentt> is your arduino plugged in a usb port ?
[22:33:04] <keithbrown> yes
[22:33:55] <keithbrown> dev/tty.usbserial-A98RRP9D
[22:34:51] <studdentt> how do you know
[22:35:19] <keithbrown> arduino ide
[22:37:23] <studdentt> wait illtry here
[22:37:27] <keithbrown> how can i change the device signature from 0x000000