#avr | Logs for 2016-08-09

Back
[00:53:19] <anton02> using an mk2, is it possible to debug? Or do you need a serial port like arduinos have via the USB connection?
[01:01:47] <Casper> you need DW or jtag
[09:00:08] <rue_bed> its important to PROGRESSIVLY write software, so that you only intoduce a limited number of bug points at once, you test each part of the code as you go, makings sure it works properly.
[09:00:49] <rue_bed> you should never need more than 1 or 2 points to change an io pin to debug your software
[09:01:38] <rue_bed> if your writing piles of code at once, putting it all togethor, and expecting it to work, you will always be knee deep in bugs
[09:02:52] <rue_bed> Lambda_Aurigae, floppy for the C64 or generically?
[09:02:53] <Emil> Anyone has experience with the 32-bit avrs?
[09:03:10] <Emil> I have a crawing for the dma channels
[09:03:21] <Emil> Though xmegas also have them
[09:04:02] <rue_bed> not to discourage large avrs, but have you looked at arms?
[09:04:18] <Emil> rue_bed: I have and would love to translate to them
[09:04:39] <Emil> but I am completely against nonfree shit, iar and guis
[09:04:57] <Emil> And haven't found any good tutorials that do without them
[09:05:09] <rue_bed> openocd, stm32F1xx
[09:05:33] <Emil> But if you know of such, please let me know. The AVR platform is superb to getting started and for a lot of products but arms offer a fuckton of things for quarter the price :D
[09:05:43] <rue_bed> 8 bit avrs are a good way to do simple control of things tho.
[09:06:54] <Emil> And they have a superb commandline env
[10:09:57] <rain1> are there 4 bit avrs?
[10:12:32] <Emil> No, but some with very little resources
[10:12:50] <Emil> You basically get nothing in return for 4 bits compared to 8
[10:13:01] <Emil> manufacturing 4bit devices is as useless as it gets nowadays
[10:13:40] <rain1> aw alright
[10:13:49] <Emil> Why so?
[10:14:01] <Jartza> I got VGA picture out of the tiniest avr :)
[10:14:10] <Emil> You can artificially limit yourself to 4 bits with bitfields, though
[10:14:22] <rain1> it just seems cool
[10:14:26] <Jartza> which has 6 pins, 512 bytes of flash and 32 bytes of ram
[10:14:45] <rain1> what kind of picture?
[10:14:46] <Jartza> using external 12MHz oscillator, so I had to drive VGA out from 3 pins
[10:15:22] <Jartza> rain1: https://www.youtube.com/watch?v=iPWX989ex5M
[10:15:46] <Jartza> https://www.youtube.com/watch?v=g0IYBAw0j0Y
[10:16:20] <Jartza> technically attiny4 is the smallest AVR but it's availability is hard
[10:16:29] <Jartza> attiny5 is same chip, but with added ADC
[10:16:38] <Jartza> same core, flash and ram amount on both
[10:17:15] <rain1> very nice :D
[10:17:23] <rain1> that looks great
[10:18:57] <cehteh> Jartza: and you dont need ADC for vga :D
[10:19:08] <Jartza> no I don't
[10:19:13] <Jartza> so the same code would run on attiny4 too
[10:19:29] <cehteh> but anyway you can get 32 bit chips in smaller form factors than AVR's
[10:19:30] <Jartza> I just already had attiny5 chips and I didn't find attiny4 from any distributor
[10:20:30] <cehteh> a lot old pocket calculators are 4 bit ... BCD based
[10:20:37] <rain1> my idea is using 2 AVRs
[10:20:47] <rain1> one to drive the TV (or VGA)
[10:21:00] <rain1> and the other does calculutaions and sends the driver the letters to display via serial
[10:21:08] <cehteh> but i dont know any actual use case for a 4bit cpu .. esp programming in C would be impossible or major pita at least
[10:21:08] <rain1> do you think this is practical?
[10:21:33] <cehteh> rain1: Jartza does that with one :D
[10:21:40] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxbTQ5WVVRTTRsa3M/view
[10:21:57] <rain1> they are tiny!
[10:22:13] <rain1> that's really fun
[10:22:17] <Jartza> on left red breakout there's attiny5, on right breakout it's oscillator
[10:22:25] <Jartza> rain1: oh, I have VGA controller for you
[10:22:33] <Skippy_42> Do you think it works to overwrite a conversion operator for an atmega on arduino in c++? ^^
[10:22:37] <Jartza> it inputs serial data from uart @ 9600bps
[10:22:46] <Jartza> outputs 32x16 characters on VGA output
[10:22:50] <Jartza> and parses ANSI escapes
[10:22:51] <rain1> :D
[10:22:58] <rain1> that's just the sort of thing i imagined
[10:23:04] <Jartza> with attiny85
[10:23:07] <Jartza> :D
[10:23:13] <rain1> I would love to try it out
[10:23:20] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxaFFxam1uVW05NlE/view
[10:23:39] <rain1> wow :D
[10:23:39] <Jartza> https://www.youtube.com/watch?v=Vw5xGuLFy8Q
[10:23:43] <rain1> that's very compact
[10:23:59] <cehteh> http://www.wired.com/2013/02/freescales-tiny-arm-chip/ .. these are small :D
[10:24:01] <Jartza> then I made another version, which runs three attinys in parallel :D
[10:24:11] <rain1> this video is fastantic
[10:24:13] <cehteh> well yuu can get some AVR's as bga dies
[10:24:14] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxRXVzSUNCT1h2NHM/view
[10:24:17] <Jartza> this one
[10:24:26] <Skippy_42> looks like when a pokemon attacks you, on the old black and white gameboy versions
[10:24:27] <rain1> 3 in parallel??
[10:24:27] <Jartza> here's the output: https://www.youtube.com/watch?v=G1QWNDck0yU
[10:24:30] <Jartza> yes
[10:24:34] <rain1> does it let you do R G B :P
[10:24:35] <Jartza> check the video
[10:24:46] <Jartza> the second video :)
[10:24:51] <rain1> watching!
[10:25:13] <rain1> I really like this!!!
[10:25:13] <Jartza> https://github.com/rakettitiede/octapentaveega
[10:25:19] <cehteh> the only problem is that coding that needs superhuman coding skillz and plenty time
[10:25:21] <Jartza> there's source code, schematics etc.
[10:25:40] <rain1> thansk!
[10:25:50] <Jartza> rain1: attiny85 has 512 bytes of ram
[10:25:56] <Jartza> 32x16 = 512 :)
[10:26:04] <Jartza> so, it uses 100% of ram as screen buffer
[10:26:11] <Jartza> all the variables are just CPU registers
[10:26:26] <rain1> WOW :D
[10:26:31] <rain1> that's pushing the limit
[10:26:39] <Jartza> and font data is of course read from flash then
[10:27:01] <Jartza> and because attiny85 doesn't have real uart, the uart is also sampled during vga picture drawing
[10:27:08] <Jartza> it's sorta like... crazy code
[10:27:16] <Jartza> but anyhow, lunch time for me!
[10:27:33] <cehteh> things get interesting if you want to change something or add a feature :D
[10:28:51] <Jartza> yeah :)
[10:32:00] <Jartza> rain1: all-in-all, nobody in their right mind would use attiny85 as vga adapter, it's crazy even as an idea :P
[10:32:04] <Jartza> :D
[10:32:07] <rain1> hahaha
[10:32:14] <rain1> but i love it!
[10:33:09] <Jartza> it was fun to make :)
[10:47:35] <dunz0r> Hmm... I wonder if something like an Atmega328 can do 3 colour output with VGA
[10:48:21] <dunz0r> At least in theory, it's got 2kB of RAM, and that's more than 3 times the RAM of an Attiny85 :)
[10:51:18] <Skippy_42> can someone tell me why in this line, it does not recognize the enum, only the value http://pastebin.com/QqjDJe1A
[10:51:56] <Jartza> dunz0r: sure it can
[10:52:18] <Jartza> even attiny85 can
[10:52:58] <Jartza> I once calculated that 16x8 characters would be possible with single attiny
[10:53:01] <Jartza> 8 colors
[10:53:27] <Chillum> you can do a lot with a tiny85
[10:53:38] <Jartza> yea
[10:53:39] <bss36504> Skippy_42: Try qualifying 'getFirmwareVersion' as 'PN532Cmd.getFirmwareVersion'
[10:53:55] <Jartza> if attiny5 can do RGB too :)
[10:54:03] <dunz0r> I've got a bunch of Attiny85s at home, really need to play with them more
[10:54:58] <bss36504> Skippy_42: Also that trailing comma in the enum list might cause an issue, don't know for sure
[10:55:03] <Skippy_42> bss36504 then it says "expected primary-expression before '.' token"
[10:55:58] <Jartza> I wanted as much text on screen as possible, that's the reason I settled with single color
[10:56:00] <Skippy_42> well... I guess that trailing comma thing was the problem, at least I got different errors now (from other parts)
[10:56:13] <bss36504> Oh good.
[10:56:18] <bss36504> -ish...haha
[10:56:22] <Jartza> and then I added attinys running in parallel, just for the kicks
[10:56:35] <bss36504> C compilers are weird with where they give errors sometimes.
[10:58:22] <Skippy_42> yeah.. not it works, the downward comma trailing list thing was the problem....
[10:58:50] <Skippy_42> oh wait... now it works again
[10:59:10] <Skippy_42> oooooohhh I think I had enums named like methods in the class....
[11:00:09] <bss36504> That'll do it
[11:24:43] <GilDev> Hi, I'm having trouble understanding something in ATtiny13A's datasheet. Is it possible to wake my AVR from a Watchdog interrupt in Power-down mode?
[11:25:35] <GilDev> It says so in the 7-1 table, but in the 7.1.3 paragraph, it says only a Watchdog Reset will wake up the MCU
[11:25:48] <GilDev> What should I trust?
[11:26:41] <cehteh> simple thing: just try it :D
[11:27:12] <GilDev> Meh… =/ I'll do that, it's just that I'm very new with pure AVR programming
[11:27:34] <cehteh> i used the watchdog as interrupt source on tiny13, but did only idle sleep not powerdown
[11:28:28] <cehteh> but it could be that there is some flag/fuse to configure the watchdog to be on/off at powerdown, i cant remember, have to read the datasheet too
[11:29:00] <GilDev> By the way, I'm trying to do a low-voltage cutoff with my tiny13 (this may seem overpowered, whatever). I have a transistor to power my system. I would like my system to wake up once every ~8 seconds (max WDT timer) to check my battery's voltage and stop my transistor if it's below a certain level
[11:29:04] <cehteh> anyway .. i try not to use the watchdog in some fancy ways
[11:29:18] <GilDev> M'kay
[11:29:35] <cehteh> ah i made such a circruit with tiny45
[11:29:48] <GilDev> Okay maybe I'm not too crazy so =)
[11:29:56] <cehteh> but also only normal sleeps not powerdown and not watchdog, but normal timer
[11:30:07] <GilDev> I don't have time right now to learn assembly so I try to make it in pure C
[11:30:25] <cehteh> *but* i use the watchdog osc to clock the main clock .. 128khz
[11:30:36] <cehteh> C here too
[11:30:37] <GilDev> Yeah, I would really like to use those power saving functions, to train me and optimize as most as I can
[11:30:48] <cehteh> http://git.pipapo.org/?p=battswitch.git;a=blob;f=src/battswitch.c fyi
[11:30:50] <GilDev> Sure 128 kHz too
[11:30:56] <GilDev> Thanks!
[11:31:01] <GilDev> Well it does not work
[11:31:21] <cehteh> but thats for biggier batteries where the power doesnt matter it only goes into deep powerdown when the battery is really empty
[11:31:21] <GilDev> I mean your link cehteh
[11:31:32] <Jartza> rain1: http://hackaday.com/2014/11/30/transferring-audio-to-an-avr-at-12kbps/
[11:31:34] <Jartza> :P
[11:31:35] <cehteh> works for me
[11:31:40] <GilDev> Found it
[11:32:07] <GilDev> Yeah I know it must not too big of a concern but I like things clean =)
[11:32:14] <cehteh> i first wanted to use a tiny13, but it got a bit too big and i have 45 layin around too
[11:32:32] <GilDev> What a complicated Makefile
[11:32:34] <cehteh> doing more things, blinking leds, showning state, measuring current etc
[11:32:59] <cehteh> complicated`
[11:33:01] <cehteh> ?
[11:33:21] <GilDev> Yeah pretty new to this too, I was using Arduino before
[11:33:30] <GilDev> With Arturo because CLI > All of course
[11:33:39] <cehteh> just generic hacked together, meanwhile it grown a lot bigger for my mµOS with more options, tracking variables etc
[11:33:51] <rain1> Jartza, that kicks ass!
[11:34:13] <Jartza> I've been sort of... obsessed, with attiny85
[11:34:20] <rain1> I can tell :P
[11:34:25] <Jartza> but of course that would also work with other avr chips
[11:34:37] <Jartza> actually any avr that has pcint
[11:35:06] <cehteh> well i use makefiles to drive the whole project, flashing the chip, generating documentation, even publishing to the website now :D
[11:35:44] <cehteh> the tiny 25/45/85 are a impressive line of workhorses
[11:35:52] <GilDev> Nice
[11:36:09] <cehteh> well 25 is often a bit too small, for the featureset the chip has, if you want to use most of it
[11:36:25] <GilDev> I'm really having too much fun with those AVR chips
[11:36:28] <cehteh> GilDev: http://public.pipapo.org/Battswitch2.png btw
[11:36:38] <Jartza> cehteh: yeah they are
[11:36:50] <Jartza> actually, attinies are
[11:37:01] <GilDev> Nice
[11:37:06] <Jartza> for some strange reason attiny85 has gotten some kind of popularity
[11:37:12] <cehteh> GilDev: what kind of battery do you want to use?
[11:37:18] <GilDev> Li-Ion
[11:37:24] <cehteh> size?
[11:37:27] <Jartza> even though, attiny84 for example is nice chip too and if plenty of gpio is needed, attiny88
[11:37:28] <GilDev> 2600 mAh
[11:37:38] <GilDev> No protection circuit, t's just to power a few LEDs
[11:37:48] <cehteh> that what i am doing too, well there you dont need to overly care for the power consumption
[11:37:56] <cehteh> because the leds will already draw much more :D
[11:38:17] <GilDev> Yeah but you know, I want that to be perfect =) And I also want to train myself at AVR programming and understanding the hardware
[11:38:29] <cehteh> but .. one thing aside. i have minor glitch, that the voltage divider draws always power
[11:38:43] <cehteh> next time i should switch it off at powerdown
[11:39:05] <cehteh> (and then dont measure current, which was just a experiment anyway)
[11:39:10] <GilDev> Yeah I thought of that too, what's the solution to this?
[11:39:15] <cehteh> measuring current by the voltage drop over the FET
[11:39:20] <GilDev> Driving the pin high?
[11:39:35] <cehteh> be careful pins allow at most vcc+0.5V
[11:39:38] <Jartza> I'm thinking of integrating that VGA to my 3D printer
[11:39:53] <GilDev> No problems I got a 5V booster
[11:39:54] <cehteh> you can make it highz -- but then it may see the fill battery voltage
[11:39:55] <Jartza> and to replace that stupid 20x4 LCD with 32x16 VGA :)
[11:40:04] <cehteh> one cell only?
[11:40:08] <GilDev> Yeah
[11:40:14] <cehteh> i dont meant to boost it
[11:40:34] <cehteh> actually at 158khz the chip should run at 1.8 to 5v
[11:40:57] <cehteh> better dont use the booster but use slightly massaged battery voltage directly
[11:40:58] <GilDev> My system have this booster anyway
[11:41:05] <cehteh> ok then
[11:41:19] <GilDev> How could I stop the voltage divider from consuming some current?
[11:41:19] <cehteh> and use the internal 1.1V reference, not vcc
[11:41:23] <cehteh> thats to unreliable
[11:41:24] <GilDev> Sure
[11:42:12] <cehteh> i havent thought about a really good idea yet to solve that, one pin for sure to switch it somehow, but i have nothing in mind from which i can say it works for sure
[11:42:29] <GilDev> Transistor?
[11:42:47] <cehteh> and see my code, a bit oversampling and integration, low pass filtering
[11:42:58] <cehteh> maybe opamp rather
[11:43:07] <GilDev> Yeah I don't know that =)
[11:43:16] <GilDev> I mean never looked at it yet
[11:43:29] <cehteh> i also have RC filters on the ADC inputs .. just because they are simple to do
[11:43:47] <cehteh> 1k 100nF... whats laying around
[11:45:11] <GilDev> Yeah I see
[11:54:21] <GilDev> cehteh: “WDTON fuse set to “0“ means programmed and “1“ means unprogrammed.” What's this? Should I care?
[11:54:34] <cehteh> yes you should care :D
[11:54:43] <Jartza> probably you don't want to enable watchdog always :)
[11:54:49] <cehteh> i'd suggest *not* using the watchdog :D
[11:54:54] <Jartza> unless in production stuff, and maybe not there either
[11:55:10] <Jartza> watchdog is nice, when and if you know how to use it :)
[11:55:15] <cehteh> or if you do, you should fully understand it, with all consequences
[11:55:23] <Jartza> yep
[11:55:30] <GilDev> T_T
[11:55:35] <Jartza> what it does is, it resets your chip
[11:55:37] <GilDev> Seems like something great
[11:55:41] <Jartza> and it resets it pretty quick
[11:55:44] <cehteh> and abusing the watchdog for other things can become major pita
[11:55:49] <Jartza> UNLESS you constantly "feed" the dog
[11:55:51] <GilDev> Yeah I would like to use the watchdog interrupt
[11:56:00] <cehteh> dont do that, use a normal timer
[11:56:05] <GilDev> =/
[11:56:15] <cehteh> i did that on a old project
[11:56:17] <Jartza> you can still use watchdog interrupt, even if you don't enable watchdog fuse
[11:56:19] <GilDev> That power down mode looked great
[11:56:20] <Jartza> that's different thing
[11:56:23] <cehteh> it worked somewhat, but its really not meant for that
[11:56:30] <Jartza> and you can still use power down mode too
[11:56:35] <GilDev> Yeah I don't want to enable wdt fuse
[11:56:45] <cehteh> iirc timer1 can run in powerdown mode
[11:56:51] <GilDev> Oh
[11:56:52] <cehteh> maybe not on tiny13
[11:56:55] <Jartza> if you burn the watchdog fuse, the watchdog is always enabled, which means, your code needs to feed the watchdog constantly or it'll reset
[11:56:56] <GilDev> Mhhh…
[11:57:06] <cehteh> read datasheet
[11:57:08] <GilDev> Yeah I saw that, that's not what I want
[11:57:13] <GilDev> I'm doing it! x)
[11:57:36] <cehteh> timer1 on tiny25/45/85 is crazy :;D
[11:57:49] <cehteh> can run at 64mhz :D
[11:57:58] <Jartza> naah
[11:58:01] <Jartza> it can run much faster
[11:58:07] <cehteh> haha
[11:58:07] <Jartza> :D
[11:58:11] <cehteh> oh by datasheet
[11:58:16] <GilDev> Crazy how a simple low-voltage detection system is that complicated to do
[11:58:18] <cehteh> not overclocking
[11:58:20] <Jartza> just tickle the osccal register
[11:58:28] <GilDev> Sure I'm just starting off but yeah…
[11:58:29] <Jartza> and pump it to over 90MHz
[11:58:41] <Jartza> with that, attiny can work as FM transmitter ;)
[11:58:58] <cehteh> GilDev: watchdog as interrupt is pain because it disables itself to make a reset the next time a watchdog interrupt happens
[11:59:21] <GilDev> Mhhh
[11:59:21] <cehteh> normal timer is much more proper, needs a bit less code and more flexible, without all these side effects
[11:59:42] <cehteh> if you aim for low power you can still use the 128khz watchdog osc as main clock
[11:59:54] <GilDev> Mhhh alright
[12:00:05] <GilDev> But what's the… Maximum delay time for a timer?
[12:00:07] <cehteh> check my code, for development i use the 'normal' osc but prescale it to 125khz
[12:00:26] <cehteh> and finally for production i fuse the 128khz osc
[12:00:38] <GilDev> I already set the fuse
[12:00:44] <cehteh> somewhere in the startup is a check for that
[12:00:54] <cehteh> then you have a problem
[12:01:07] <cehteh> you now can program it only ultra slowly :D
[12:02:05] <cehteh> try to keep fuses, esp clock fuses at default, do as much in software, on other chips where you have an external osc fuse for that, but dont try tricks with fuses, easy to shoot in the foot
[12:02:07] <GilDev> Did not seem so slow, but whatever =)
[12:02:20] <cehteh> then something is wrong :D
[12:02:30] <GilDev> Sleep mode table does not says a timer can wake up the MCU
[12:02:42] <cehteh> maybe it still runs on the internal osc 8mhz with clkdiv8 .. default is 1mhz
[12:02:59] <GilDev> Mhhh… Maybe… ._.
[12:03:17] <cehteh> consider to switch to tiny45 .. not more expensive, much more comfortable
[12:03:27] <cehteh> read datasheet first
[12:03:42] <GilDev> Yeah I got some but I would like to use my tiny13 for this
[12:04:29] <cehteh> ah yes tiny13 has only one timer which cant wake the chiop
[12:04:30] <GilDev> This is pretty hard for a begineer
[12:04:54] <cehteh> but look at how much current it draws at normal idle sleep at 128khz
[12:05:27] <GilDev> Yeah but… You know =)
[12:06:01] <GilDev> Omg ADC looks freaking complicated too
[12:06:10] <cehteh> 0.025mA :D
[12:06:25] <GilDev> Too much! =)
[12:06:34] <GilDev> I just want to learn how to use those features
[12:06:41] <cehteh> also you can configure the ADC that it gets started by the timer, not by your interrupt
[12:07:08] <cehteh> then you only handle the ADC-finished interrupt, thats the only thing where your chip is really running
[12:07:22] <GilDev> Mhhh, that may be interesting
[12:07:30] <cehteh> and with oversampling you want sample a bit faster, like every 250ms or so
[12:08:09] <GilDev> A 10s sampling is fine for me
[12:08:10] <cehteh> note that the ADC is pretty fast and it does not sample the average since the last sample .. but what it sees in a blink of an eye
[12:08:24] <cehteh> that might be some glich in the noise
[12:08:37] <cehteh> which can be pretty inaccurate
[12:08:52] <GilDev> Oh yeah okay
[12:09:04] <cehteh> and 10bit is barely enouhg for li-ion
[12:09:28] <cehteh> see my code and oversampling trick, which gives a bit more resolution
[12:10:09] <rain1> Jartza, wow modem.c -- How is the code so short!
[12:10:21] <GilDev> Okay
[12:10:38] <rain1> I see how it works.. just counting pulse length
[12:10:46] <rain1> awesome
[12:15:21] <cehteh> GilDev: also you may either use a trimmer for the voltage divider, and/or use some software calibration, because of all kinds of tolerances
[12:15:45] <cehteh> and even using expensive 1% or better resistors wont help you, .. add calibration :)
[12:16:01] <GilDev> Okay okay
[12:16:28] <cehteh> (and everything in integer math)
[12:20:48] <GilDev> Sure =)
[12:33:10] <Lambda_Aurigae> rue_bed, it was generic dual 1541 emulator
[12:44:23] <rain1> some more AT tiny http://elm-chan.org/works/tiny/report.html
[12:46:01] <cehteh> mhm?
[12:46:18] <cehteh> note that 11, 12 and 15 dont have any RAM ..
[12:46:42] <cehteh> not worth the pita
[12:47:37] <cehteh> if you have some product which you sell in 100000's and need something really small, mmkay, but for a hobbyist or even small scale professional product they make no sense
[12:47:52] <cehteh> the 10 cent (or less) you can save make no sense
[12:54:23] <GilDev> cehteh: https://gist.github.com/GilDev/2a78642bf7b7151adb9778fa6b928c1e
[12:54:54] <GilDev> This does not work in power down or idle mode (it blinks the LED only once), but works if I replace the 3 last lines with an infinite loop
[12:55:00] <cehteh> yes
[12:55:18] <cehteh> you need to put your sleep into a infinite loop
[12:55:26] <GilDev> oO'
[12:55:46] <cehteh> because a interrupt wakes the cpu, the interrupt handler is executed and then it returns past the sleep instruction
[12:56:03] <cehteh> and delay() is baaaaaad :D
[12:56:15] <cehteh> esp in ISR's
[12:56:23] <GilDev> Oh
[12:56:26] <cehteh> may work there, but never ever do that
[12:56:36] <GilDev> Yeah that was some code I found online just to try
[12:56:47] <GilDev> Just the sleep_mode() in an infinite loop?
[12:56:48] <cehteh> delay needs F_CPU being defined, you do that somewhere else?
[12:56:56] <GilDev> Oh, of course not
[12:56:58] <GilDev> 8-)
[12:58:09] <GilDev> Yeah, that works!
[12:58:11] <cehteh> you dont need the cli() .. initially interrupts are disabled
[12:58:21] <GilDev> Oh alright
[12:58:23] <GilDev> Thanks
[12:58:37] <GilDev> 2 bytes less, nice
[12:58:42] <cehteh> lol
[12:59:00] <GilDev> Okay just need to know how to use the ADC now and I'll be happy!
[12:59:05] <GilDev> Gotta go, bye, and thanks! =)
[12:59:28] <cehteh> ... by writing to PINB you can toggle a output
[12:59:38] <cehteh> saves some more bytes and doesnt need the delay
[12:59:47] <cehteh> welll .. bye cu later
[13:00:48] <cehteh> ISR(WDT_vect) { PINB = 1<<PB4; }
[13:01:26] <cehteh> mhm and dont you need to reenable the wd isr? i think that depends on the fuses
[13:02:09] <cehteh> anyway the delay() there wastes all power you safed on the power down :d
[13:02:15] <cehteh> eh yes bye ..
[13:34:11] <Skippy_42> does anyone know how I can get serial.print like output with an atmel ice over jtag?
[13:37:31] <bss36504> That would be pretty cool. I second the motion
[13:38:13] <bss36504> Though my guess is that it's not possible
[13:38:59] <Skippy_42> I found this: http://www.avrfreaks.net/forum/using-jtag-print-console
[13:39:10] <Skippy_42> but I couldnt find more information yet
[13:42:28] <bss36504> Skippy_42: http://www.avrfreaks.net/forum/printf-jtag
[13:42:29] <bss36504> ?
[13:44:49] <Skippy_42> ty, I will check that later, doing something else right now
[13:58:14] <Skippy_42> the atmel ice jtag debugging is crap
[13:59:23] <Skippy_42> I need a damn output, I tried it with fprintf(stderr, "test") but no window in atmel studio does output something
[14:01:14] <bss36504> Isn't there a console or output window that shows what the debugger is generally doing?
[14:03:51] <Skippy_42> I have all kind of windows, but nothing that show output from my printf(stderr, "test")
[14:05:22] <APic> ,o0(Windows suck ;)))
[14:05:38] <Skippy_42> I keep testing functions and libs
[14:05:38] <bss36504> APic: This is not a windows problem.
[14:05:45] <bss36504> So just dont...yeesh
[14:05:48] <APic> bss36504: I was just trying to be funny.
[14:05:56] <bss36504> Alright :)
[14:06:20] <bss36504> I just didnt have the energy for another linux vs. windows circle-jerk haha
[14:07:00] <bss36504> Skippy_42: looking now to see if there is just a way to send raw data via the debugger. If you can do that, then redirecting the streams to should be as easy as it is using the uart with printf (and friends)
[14:07:29] <Skippy_42> jtag is over uart?
[14:08:03] <bss36504> no no no, you can set up printf (and others) to use the uart
[14:08:25] <bss36504> I was just saying, if there is a way to send raw data over JTAG, then we can just close the gap and configure printf to use JTAG.
[14:08:47] <Skippy_42> ah, ye
[14:09:03] <bss36504> (side note, you could also set up printf to write to an LCD, etc. since you provide a getChar and putChar function pointer when you set up the stream)
[14:09:50] <bss36504> But, I dont know if it's possible. I dont even know where I would look. The datasheet probably wont help since it's just very generically about the JTAG port, and Atmel is weirdly proprietary about the debugging system.
[14:10:27] <Skippy_42> I found a tutorial that says it does the redirect stuff you said, but atm It looks like the easiest way is to just use my logic analyzer
[14:10:48] <bss36504> Haha well that's certainly an option. Or use a uart
[14:35:47] <bss36504> Skippy_42: I posted the question on EE.SE. If I don't get a reply in a couple days I'll offer a bounty. http://electronics.stackexchange.com/questions/251522/is-it-possible-to-redirect-print-streams-to-debugger-in-atmel-system
[14:59:00] <GilDev> cehteh: Yeah sorry not very smart code ;-) But no, no need to reenable WDT, works great
[15:20:00] <bss36504> Skippy_42: Check out my SE question. We have a decent answer
[15:22:51] <Jartza> rain1: well, it's short because stupid ideas are simple :D
[15:23:02] <Jartza> and because it's so stupid, it's actually ingenious
[15:23:13] <Jartza> I've later found out it also works over FM radio
[15:23:27] <Jartza> and using comparator, the speed can be bumped up to 16kbps
[18:41:56] <cehteh> GilDev: i didnt checked the datasheet, but would you notice when the chip resets after every isr? :D ... add some bootup blinking sequence in main()
[18:42:21] <GilDev> cehteh: Oh, not a bad idea at all, thanks!
[18:45:12] <cehteh> had that before :D
[18:45:48] <cehteh> sometimes one cant easily distinguish between a reset loop and correct code, at least at such simple tests
[18:46:17] <cehteh> but as soon you keep some state it starts to look weird and you wtf
[18:47:15] <GilDev> Yeah I imagine =)
[18:49:31] <Tom_itx> pet the dog or shoot it