#avr | Logs for 2015-04-09

Back
[05:16:03] <jaggz> can tom's usbtinymk be used to program an esp8266?
[05:16:48] <LeoNerd> From what I gather, the ESPs use some sort of UART serial connection for programming
[05:16:57] <LeoNerd> So presumably any sort of serial link will suffice
[05:17:00] <jaggz> ttyl
[05:17:00] <jaggz> ttl
[05:17:05] <jaggz> heh, not ttyl
[05:17:28] <LeoNerd> Transistor-Transistor-Yokel Logic
[05:18:57] <LeoNerd> A fusion of silicon and banjo-strings
[05:19:03] <jaggz> heh
[05:19:43] <jaggz> just debating over doing avr programming, which I already have done a couple times -- and hooking it up to an esp8266, or trying to program the esp directly
[05:20:52] <LeoNerd> Well, do you have size/power/cost budget concerns?
[05:21:07] <LeoNerd> Fewer parts obviously wins on all three of those
[05:21:38] <jaggz> none of those are restrictions at the time.. and not wasting time would be preferable
[05:21:46] <jaggz> so I think I should get started with one hooked up to avr ..
[05:21:59] <jaggz> but I guess I should order a usb-ttl adaptor to have it on hand
[05:23:51] <LeoNerd> Ah, those are useful to have
[05:24:13] <LeoNerd> I have.. hrm... effectively three. I have a real FTDI cable that came with an Arduino Mini Pro, a Bus Pirate, and a PL2302 cable.
[05:24:34] <LeoNerd> That last one is lovely - cost £1 from Amazon, is a USB-A plug with a 4-pin wire out of it, but the wire is +5, GND, Tx, Rx.
[05:25:48] <jaggz> not finding pl2302's on amazon..
[05:26:40] <LeoNerd> http://www.amazon.co.uk/niceeshop-PL2303HX-RS232-Module-Converter/dp/B00F26T9AO
[05:26:48] <jaggz> something like t.. ahh.. k
[05:26:51] <Xark> http://www.amazon.com/PL2303HX-RS232-Cable-Module-Converter/dp/B008AGDTA4
[05:27:12] <jaggz> well that's 2303 :)
[05:27:22] <Xark> Even better. :)
[05:27:24] <LeoNerd> Yeah.. those are lovely. Admittedly you only get Tx/Rx and none of the other handshaking, but if that's all you need then they're good
[05:27:30] <LeoNerd> Er.. I mistyped. Yah. 2303
[05:27:58] <LeoNerd> Sometime I'd like to buy some PL2303SA chips - that's the SOIC8 packaged version. Lovely little things
[05:28:00] <Xark> Doesn't have handy reset signal/DTR though...
[05:28:02] <LeoNerd> But I can't seem to find aaaaanyway
[05:28:23] <LeoNerd> Xark: Yeah... so they're no good for e.g. Arduino bootloader, but if you only need Tx/Rx (e.g. on my STK500 clone) they're fine for that
[05:28:41] <Xark> LeoNerd: Yep. I use it on Raspberry Pi.
[05:29:10] <LeoNerd> So in today's fun: work out how to desolder a SOIC14.
[05:29:19] <LeoNerd> I killed a tiny. But I'd like to rescue the actual board if I can
[05:29:30] * RattusRattus sticks with the FTDI devices. I've had too much grief with the PL2303s (long term use they keep locking up - I need to reset them roughly weekly)
[05:29:34] <LeoNerd> I suspect I may have to cut the legs off individually then clean up the pads
[05:30:00] <LeoNerd> RattusRattus: I've had too much grief with FTDI bricking devices with stupid Windows drivers to ever trust them to make things again
[05:30:00] <RattusRattus> but for stuff that isn't on 24x7 they are pretty good
[05:30:21] * RattusRattus doesn't use 'doze....
[05:32:43] <LeoNerd> No but I can't say the same for my customers. :)
[05:32:50] <jaggz> LeoNerd: I'm thinking I could get one of these kits, then I could use the esp01 on an avr for now, but would be all ready to start coding the esp directly later on.. http://www.ebay.com/itm/ESP8266-ESP-01-USB-TTL-Serial-800ma-Brd-Mother-Brd-Assembled-Arr-1-10-Biz-Days-/281519483801?pt=LH_DefaultDomain_0&hash=item418bde6b99
[05:32:59] <LeoNerd> So I'm not going to give them something that might break when they use it
[05:33:33] <jaggz> by "kit" I mean.. bundle.. with the usb-ttl, motherboard, psu.. etc.
[05:33:50] <LeoNerd> jaggz: I don't really know the ESP enough to comment on that
[05:34:07] <LeoNerd> I've seen pictures of it, lots of twitter posts about it, but that's all :)
[05:34:30] <jaggz> :)
[05:34:55] <jaggz> I was avoiding it but now it'd come in useful.. since my dog-is-walking-to-bathroom motion sensor is occupying my raspberry pi right now
[05:35:23] <jaggz> also, I need a thermometer for when I'm preparing medicine for a family member..
[05:35:47] <jaggz> they inform the computer in the livingroom to alarm :)
[05:36:02] <jaggz> but right now they're using the rpi, so I have to switch it between the two ..
[05:36:38] <jaggz> although with the temp sensor I'll need to get i2c working on the avr
[05:37:38] <LeoNerd> AVR I2C isn't hard
[05:42:27] <jaggz> I found a library for it.. would probably just use that, no?
[05:43:36] <jaggz> oh.. no it's not so bad http://www.embedds.com/programming-avr-i2c-interface/
[05:45:44] <jaggz> I'd still end up just copying/pasting everything though
[07:24:48] <DO9XE> is anyone good with I²C on mega32u4?
[07:25:14] <DO9XE> I am using the LUFA implementation, but my chip is not giving back an ack
[07:25:46] <DO9XE> also i have 9 Clock pulses per package, not 8.
[07:26:07] <DO9XE> shouldn't it be address (7) + ack (1)
[07:26:08] <DO9XE> ?
[07:26:36] <LeoNerd> 8 for the address + RW bit, then 1 for the ACK
[07:26:50] <LeoNerd> Each I2C byte cycle is 9 clocks - 8 for the transmitter and 1 for the receiver's ACK
[07:28:25] <DO9XE> ah, okay.
[07:29:08] <DO9XE> so this piece of code is right? :
[07:29:14] <DO9XE> if (TWI_StartTransmission(Address, 1) == 0)
[07:29:21] <DO9XE> {
[07:29:23] <DO9XE> }
[07:30:22] <Tom_itx> ;
[09:04:50] <avrdude> i want to use an external crystal, and i noticed another board i have with the same crystal has its fuse set to EXTXOSC_3MHZ_8MHZ_16KCK_65MS
[09:05:03] <avrdude> what exactly does this mean? why are there two frequencies in that name?
[09:05:09] <LeoNerd> It's a range
[09:05:24] <LeoNerd> Some chips have different clock select bits for different speeds of crystal
[09:05:25] <avrdude> oh
[09:05:52] <avrdude> what about the other parameters?
[09:07:13] <LeoNerd> Those are the startup time
[09:08:27] <avrdude> are they important?
[09:08:56] <avrdude> also, is there any particular order i should set my fuse bytes?
[09:09:00] <LeoNerd> Depends how accurate you want your timing at startup
[09:09:01] <avrdude> i dont want to brick my chip
[09:09:07] <LeoNerd> No, the fuses are independent
[09:09:20] <avrdude> can i brick it though?
[09:09:22] <LeoNerd> Presumably you want *some* accuracy or else you'd be using the INT8MHz
[09:09:32] <LeoNerd> Define "brick"
[09:09:51] <avrdude> well, if i somehow disable jtag or something
[09:10:08] <LeoNerd> I don't believe it's possible to brick an AVR chip short of actual hardware damage; just sometimes you might end up needing odd clocking setups, or HVSP/HVPP to change it
[09:10:08] <avrdude> unable to use the chip anymore, basically
[09:10:21] <LeoNerd> Are you using JTAG to program it?
[09:10:25] <avrdude> yes
[09:10:36] <avrdude> it doesnt have isp i think
[09:10:55] <LeoNerd> Ah; I don't know JTAG. I know that the ISP-enable flag isn't accessible over ISP itself, so it's harder to burn out your ability to adjust it
[10:42:57] <abferm> Hey guys I'm having trouble with lufa composite devices. Could someone give me a hand?
[10:44:07] <LeoNerd> Lots of LUFA questions in here lately...
[10:50:48] <abferm> Well, it doesn't have it's own channel as far as I could see.
[11:03:00] <LeoNerd> Ohyes, not complaining about their presence here; it seems fairly ontopic. Plus it's quiet channel most of the time anyway. :) Just noting a sudden upsurge recently
[12:34:04] <hyrixo> Hello, could someone look at this , http://pastebin.com/5yMXwR16, i'm trying to setup a timer to overflow every 5µs, but my logic analyzer is saying it's more than 2ms, it's a ATmega 328, 16Mhz
[12:34:58] <LeoNerd> What's fCPU ?
[12:35:41] <hyrixo> Freq of my cpu ? 16Mhz
[12:36:33] <LeoNerd> So.. 16MHz with prescale /8 suggests clock tick at 2MHz (500nsec); OCR = 10 suggests 5000nsec = 5µsec
[12:37:03] <LeoNerd> But that only gives you 80 instructions of time to do something interesting in your interrupt of course
[12:37:14] <LeoNerd> What are you doing in the interrupt handler?
[12:37:20] <hyrixo> Just a counter++
[12:37:44] <hyrixo> Could it be my analyser ? it's just a saleae
[12:37:44] <LeoNerd> So what's the logic analyser looking at?
[12:37:53] <hyrixo> A pin getting toggled
[12:38:26] <LeoNerd> How is that toggled?
[12:38:50] <hyrixo> well it's in arduino , so digitalwrite
[12:38:59] <LeoNerd> Hahah
[12:39:04] <LeoNerd> Riiight.
[12:39:09] <LeoNerd> That'll be your 80 instructions and then some
[12:39:12] <hyrixo> Takes to long ? :p
[12:39:23] <LeoNerd> Have you seen the crazy that digitalWrite does?
[12:39:29] <hyrixo> Not rly no :p
[12:39:36] <LeoNerd> Also, consider using the OCR pins directly?
[12:39:38] <hyrixo> I thought i'd just set the pin to 1
[12:39:42] <LeoNerd> They toggle in hardware
[12:39:48] <hyrixo> Ye i thought it did the same tbh :p
[12:39:55] <LeoNerd> It does *effectively* do that, it just does it via a verrrrry longwinded method
[12:40:11] <LeoNerd> Arduino wastes a hell of a lot of CPU cycles just mapping from their silly renumbered pins into real hardware ideas
[12:40:23] <hyrixo> kk i'll do that
[12:40:26] <LeoNerd> You're far better off writing PORTx ^= _BV(n); to toggle pin n of port x
[12:40:36] <LeoNerd> That's doable in 3 cycles
[12:40:46] <hyrixo> well that's a huge win :p
[12:40:49] <hyrixo> Thanks for the help !
[12:40:50] <LeoNerd> (IN, EOR, OUT)
[12:41:38] <hyrixo> Well that'll improve my pwm's