#avr | Logs for 2016-06-27

Back
[01:11:17] <eszett> hi
[01:12:01] <Casper> low
[01:12:46] <eszett> when i connect a toggle switch (On-On function) to my AVR, with one pin connected to GND, other to a GPIO, do i have to put a resistor inbetween somewhere, or can i go without it?
[01:14:01] <Casper> yes and no
[01:14:08] <eszett> uhm, yes?
[01:14:28] <Casper> you need something to bring the pin to VCC, else the pin just float into the unknown
[01:14:58] <Casper> there is 2 main ways to do this: use a resistor to VCC or use the internal pullup function of the avr
[01:15:39] <eszett> if the GPIO is D4, then i use the internal pullup, and check by a routine if D4 i hi or low (shorted to GND by the toggle) , isnt it?
[01:15:44] <eszett> ah ok..
[01:16:04] <eszett> thx
[01:16:23] <Casper> also, you need to know that a switch bounce when you press it, think of 2 hammer head that you slam together
[01:16:37] <Casper> it can and will give multiple signal before settling
[01:17:06] <Casper> it may have to be addressed in software or hardware (extra component needed for in hardware) if it is an issue
[01:17:29] <eszett> the unbouncing routine is made by software
[01:17:30] <Casper> like if you make a button press counter, you may find that a single press cause more count, a delay can fix it
[01:17:35] <eszett> its not that hard actually
[01:17:41] <eszett> ye.. i know
[01:18:08] <eszett> or lets say.. it *is* hard, but I dont write it by my own, just copy&paste =)
[01:18:44] <Casper> cheater :D
[01:20:29] <eszett> im pretty interested in learning that C++ stuff, later, but too busy with pcb and case design ATM
[01:31:26] <eszett> anyway, thank you casper and cu
[05:48:03] <_ami_> http://www.mikrocontroller.net/articles/AVR_Bootloader_in_C_-_eine_einfache_Anleitung
[05:48:18] <_ami_> probably best article on how to write bootloader for AVR
[05:49:08] <_ami_> do we have more articles on this topic which are actually originally written in english? :)
[05:58:34] <_ami_> Jartza: you should write a bootloader tutorial for newbies :D
[06:30:00] <LeoNerd> Wow, cute if minimalistic chip - MCP3221
[06:30:15] <LeoNerd> It's a 5-pin SOT-shaped ADC. The pins are power/ground, SDA/SCL, analog in. That's it
[06:30:42] <LeoNerd> No addressing lines, no interrupt output, nothing. You don't even configure an address; you order the right one of 8 variants with the address preburned in
[06:31:25] <Lambda-Aurigae> cute.
[06:35:46] <LeoNerd> Though I can't help thinking a 6pin version to add an INT output would be nice. I hate polling
[06:37:51] <Lambda-Aurigae> that would complicate the whole software side of it too.
[07:01:46] <LeoNerd> Complicate? It would -simplify- the software side
[07:01:53] <LeoNerd> I wouldn't have to keep polling it until it's done
[08:09:50] <Jartza> I wish I had time to write more tutorials
[08:10:20] <LeoNerd> Eh.. maybe
[08:25:15] <LeoNerd> Anyone know if it's possible to buy pre-made R-2R ladders in pre-made and calibrated packages?
[08:25:26] <LeoNerd> E.g. similar to those simple SIL resistor packs
[08:37:26] <bss36504> I googled "R2R ladder" and google presented me with an ad for some Bourne's precision resistor networks. I'd say they exist
[08:44:20] <bss36504> See if you can find a source for a 628L104TR4
[08:46:50] <twnqx> alibaba :P
[08:47:18] <LeoNerd> Oh I don't want to buy one, I'm just trying to identify a part that someone has in a DAC
[08:47:26] <LeoNerd> If it was such a prepackaged ladder that would explain it
[08:48:14] <bss36504> Oh. Well they do, in fact, exist if that answers your question
[08:51:07] <twnqx> or did
[08:57:13] <bss36504> That too. The 628... i mentioned can't be found at digikey or mouser, and its from a company I don't know of so maybe they don't exist anymore.
[09:06:01] <twnqx> given it's on obsoletepartfinder...
[09:16:36] <rue_house> LeoNerd, an R-2R would use a standard resistor pack
[09:17:12] <rue_house> oh wait, its a 10k
[09:17:19] <rue_house> hah
[13:14:09] <phinxy> the AT24C32 eeprom module had a fun caveat. no problem reading a page at 400khz but writing a page only works on 100khz
[13:14:31] <LeoNerd> Oopsie
[13:14:34] <phinxy> it manages to write 8 bytes at 400khz but it always fail at bye 9-12
[13:14:38] <LeoNerd> Smallprint
[13:15:41] <phinxy> oh, it is not supposed to work @ 400khz with 3.3V
[13:15:56] <LeoNerd> Ah.. the fun of voltage/frequency envelope curves
[13:28:32] <antto> phinxy are you respecting the "page" ?
[13:28:46] <phinxy> it should roll over
[13:29:01] <antto> is it an eeprom with pagesize=8?
[13:29:17] <phinxy> 32 bytes per page
[13:29:19] <phinxy> 128 pages
[13:29:31] <antto> okay, so it's not what i suspected ;P~
[13:30:00] <phinxy> its working now with 100khz
[13:30:12] <antto> I2C?
[13:31:58] <phinxy> Yes
[13:32:14] <phinxy> i run the reads at 400khz and writes at 100khz
[13:32:31] <phinxy> the datasheet only guarantees 400khz with 5V
[13:32:51] <antto> meh.. SPI ftw
[13:41:14] <bss36504> It's not a limitation of I2C per se, but flash cells (EEPROM) takes a comparatively long time to write in these little serial memories. Reads are basically instantaneous though, thus the higher supported speed. Any SPI flash you find will have a Write In Progress flag that you have to poll while the write completes. The only real benefit of SPI in
[13:41:14] <bss36504> this case is that some of the serial memories let you clock an entire page in all at once at a high speed, then wait for the write to complete. But for a handful of bytes, the speed gain with SPI vs I2C is probably negligible.
[14:43:53] <phinxy> any idea why a I2C transaction fails after 4 bytes if the data is 0x00? when data is memset to 0xff or 0x55 all 32 bytes are clocked
[14:45:30] <phinxy> tried memset all bytes to 1 and they fail
[14:48:09] <LeoNerd> Are your power supply arrangements properly done?
[14:48:29] <LeoNerd> I could imagine if power supply wasn't quite right, the chip just managed to power itself enough from the high edges in non-all-bits-zero SDA
[14:48:36] <LeoNerd> I've had that before
[14:57:59] <phinxy> looks like youre right
[14:58:09] <phinxy> switched out the battery the module is powered by
[14:58:11] <phinxy> and its working
[15:02:23] <LeoNerd> :)
[15:02:40] <LeoNerd> Honestly, about 2/3 of all my "why is this chip not working?" issues usually come down to power... often just adding a decoupling cap will help
[16:27:10] <xa0z> So, I connected a cheap Digispark ATTINY85 USB dongle to my PC and it shows ugen1.3 connect, then instantly disconnect. Does this have a DFU mode to put into?
[16:41:24] <jaggz> Who was the guy that sold those USB programmers in here?
[16:42:41] <jaggz> Casper you here?
[16:52:23] <Casper> jaggz: am I?
[16:52:43] <Casper> jaggz: tom_itx is the one that does
[16:58:57] <jaggz> Casper, tx!
[16:59:15] <theBear> tom, he's "the man", and also "our man" in re: coollittle programmers
[16:59:18] <Casper> texas? :D :p
[16:59:27] <theBear> xa0z, if that
[17:00:39] <theBear> if it preloaded bootloaded kinda deal like i guessing, usual deal is that you got a short window for the tiny to see either a certain pin pulled hi/lo to indicate programming, or more often on low-pincount tiny ones like that, it just waits "a few moments" to see if it is talked at by a programmer, and if not boots normally
[17:02:32] <jaggz> Can't find the URL to his programmer
[17:02:53] <jaggz> I've never used it still and wanted to see what i got
[17:03:23] <jaggz> Does it function as usb-ttl device too?
[17:04:20] <jaggz> Thebear/casper
[17:06:50] <theBear> it's famous these days i think, like 1/2 of all simple-programmer pages/things use it
[17:06:52] <theBear> the ummmm
[17:06:55] <theBear> maybe
[17:07:03] <theBear> you looked at the stuff in the topic ?
[17:08:08] <theBear> woopsy stupid button
[17:08:21] <theBear> it's called like, pfft, tiny-usb or something
[17:15:26] <Casper> his web site appear kinda down
[17:15:58] <theBear> mumma mia !
[17:16:35] <theBear> you really need to order one jaggz ? not that they aint nice, but if you capable of programming SOME avr you already got, that's usually enough to make yer own
[17:16:51] <jaggz> Hmm.. thanks
[17:17:39] <jaggz> Yeah i can make my own ttl device probably. I have some attiny's on usb boards already..
[17:18:19] <Casper> I guess tom have some connectivity issues
[17:19:19] <jaggz> http://www.ebay.com/itm/like/172141528673
[17:19:29] <jaggz> I have a couple of those
[17:19:51] <jaggz> Those type things
[17:24:37] <Lambda-Aurigae> http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[17:24:41] <Lambda-Aurigae> there's tom's programmer
[17:25:30] <Lambda-Aurigae> the link is right in the channel topic.
[17:27:12] <Casper> yes that one
[17:29:27] <Lambda-Aurigae> the only problem I ever saw with it was when people tried to use it on windows with atmel studio.
[17:29:32] <Lambda-Aurigae> on linux I've not had any problem with mine.
[17:31:07] <jaggz> Well, i never got bare chips so I've never used the programmer still
[17:31:19] <Lambda-Aurigae> I gots bare chips everywhere.
[17:32:25] <jaggz> I haven't a single perfboard to my name
[17:34:04] <jaggz> " This forum has about 10000000000000000 posts from people failing to get software serial working on Tiny85."
[17:37:48] <Lambda-Aurigae> depending on how it's done, it should be no different from any other avr.
[17:50:22] <Casper> I wish atmel hasn'T butchered the serial on the 85
[17:51:59] <Lambda-Aurigae> I haven't done much with the 85 other than playing with v-usb crystal-less on it.
[17:52:44] <Lambda-Aurigae> turned a few into usb-i2c and usb-spi adapters.
[17:55:05] <theBear> i had several i got MANY years ago put aside ever since, literally not taken one outta the farnells original tube they shipped in.... thought about them a few times tho, likely gonna do the same yours did, one day <grin>
[17:55:47] <Lambda-Aurigae> haven't touched them in like 7 years or so though.
[17:55:56] <Lambda-Aurigae> most of my usb stuff the last few years has been pic based.
[17:59:07] <Casper> Lambda-Aurigae: the uart can not do async serial
[18:17:47] <theBear> yeah, but try getting anything with only 8 pins that can !
[18:26:22] <jaggz> maybe I can do computer over wifi over esp to ttl?
[18:26:25] <jaggz> damn.. my wifi has gone bad here
[18:27:18] <Lambda-Aurigae> I seem to remember an esp8266 avr programmer.
[18:27:35] <jaggz> I have my promicro16's too
[19:28:14] <balrog> so I've got a jtagice3 that shows up as AT32UC3A3256 DFU. What gives? :P
[19:28:24] <balrog> I figure they forgot to program the bootloader at the factory, so it's a brick
[19:32:13] <Lambda-Aurigae> sounds like they programmed the bootloader but not the main system.
[19:32:24] <balrog> Lambda-Aurigae: they programmed the bootloader with the wrong bootloader firmware.
[19:32:30] <balrog> or so it seems.
[19:32:47] <balrog> well, thing is useless. Obviously the good ones I have contain secured firmware.
[19:32:53] <balrog> (yes, I tried)
[19:33:12] <Lambda-Aurigae> oh, that's not the chip on the device?
[19:33:26] <Lambda-Aurigae> I've never had one of either that chip or a jtagice to play with.
[19:33:28] <balrog> the AT32UC3A3256 is the chip on the device, but the "normal" jtagice3 bootloader is different from the DFU.
[19:33:43] <balrog> the normal bootloader flashes in an encrypted firmware image
[22:37:03] <rue_bed> hmm