#avr | Logs for 2015-07-18

Back
[00:00:06] <Casper> and my guess is 2 or 16 times slower, which one?
[02:08:27] <Hexum064_2> sry q_bert, I went out for a run and dinner with some friends.
[02:09:11] <Hexum064_2> If you're using the gcc compiler, it's already on.
[02:10:37] <Hexum064_2> I'm just saying that if you set F_CPU to 16000000 and your times don't make, then the CPU clock source isn't set to use a 16mhz clock. For the xmegas, by default I believe, it's set at 2mhz from the internal osc.
[02:25:39] <redspl> hi guys
[02:30:23] <Hexum064_2> hey redspl.
[05:18:30] <ankur> hey guys does atmega8 support can bus?
[05:20:38] <specing> with one hand
[05:23:20] <ankur> ??
[05:24:37] <ketul> I think ankur has Atmega8 and he want to test can bus with some other hardware (like bbb,rpi ) . Is it ankur ?
[05:26:17] <ankur> yes ketul. I want to connect atmega8 with bbb via can bus
[05:29:48] <ketul> ankur: great. But I don't have much idea about it :( . specing or anyone can help :)
[05:44:09] <specing> Alright then
[05:44:27] <specing> the question should have been 'Does atmega8 have a hardware CAN bus'
[05:44:51] <specing> and the answer to 'Does AVR XYZ have ABC' is always 'check the datasheet'
[05:45:37] <specing> no need to waste everyone's time asking dumb questions
[05:46:00] <specing> even more so because for implementing CAN you will have to eventually consult the datasheet anyway
[05:46:08] <specing> or doing anything else with said chip
[06:35:53] <LeoNerd> http://www.element14.com/community/servlet/JiveServlet/showImage/38-17216-206141/770219589.jpg <== an entire PCB panel from OSHpark... in case anyone's interested in what they look like
[08:25:17] <apo_> Was almost about to start pushing registers around to prevent having to make a backup, because moving them uses 3 but the backup needs 8 cycles... then realized that for big numbers of oscillators (>=3) it's slower (backup happens once, moving happens for every oscillator), and for small numbers it doesn't matter...
[08:30:17] <naquad> any example on how to init USART on 2313A? getting 'f' instead of 'A'
[08:30:52] <Tom_itx> baud, parity etc ok?
[08:32:20] <naquad> https://gist.github.com/9cd0afeb28a568050f60 - supposedly, CPU frequency is fused to 1MHz (8MHz internal oscillator + 8 divisor)
[08:32:37] <Tom_itx> should be
[08:35:28] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/avr/Toasteroven/4bit_mode/
[08:35:31] <Tom_itx> look at main.c
[08:35:44] <Tom_itx> has cereal init in-it
[08:36:19] <Tom_itx> at 1mhz stock conf iirc
[08:40:28] <Tom_itx> also look for your baudrate error percent at different baudrates
[08:41:27] <Lambda_Aurigae> https://sites.google.com/site/progic2/a_serial
[08:41:32] <Lambda_Aurigae> gotta love autobaud!
[08:41:45] <Tom_itx> http://wormfood.net/avrbaudcalc.php
[08:42:04] <WormFood> :D
[08:47:25] <Tom_itx> sometimes i feel like i'm typing into the abyss
[08:47:27] <LeoNerd> The internal oscillator isn't often very good for UART rstes
[08:47:29] <LeoNerd> rates
[08:47:47] <naquad> looks like the problem is not with the code
[08:48:14] <naquad> i've been building the source for 2313
[08:48:27] <naquad> now trying to figure out how to tell avrdude about 2313a
[08:48:41] <Tom_itx> add it to avrdude.conf
[08:49:10] <naquad> i wish i knew what to add there
[08:49:13] <naquad> googling it
[08:49:27] <Tom_itx> copy the 2313 and make a couple id changes
[08:50:11] <Tom_itx> or google for one alredy done
[08:50:11] <naquad> and i'll get the same problem i have now. compiled for 2313a, but fused as 2313 still gives the same problem
[08:50:51] <Tom_itx> compare the register changes
[08:52:22] <Tom_itx> afk
[09:05:06] <naquad> https://gist.github.com/naquad/9280ef3030aabc045848 - i've configured USART for 8N1 frame, 9600 baud rate, 1MHz clock (fused explicit values according to fuse calculator) and still in terminal i get some insane values :( what am i doing wrong?
[09:08:43] <Lambda_Aurigae> using the internal rc oscillator at 1MHz?
[09:10:03] <Lambda_Aurigae> don't in your code where you are setting that UBRRH_VALUE and UBRRL_VALUE...
[09:10:51] <Lambda_Aurigae> oh..nevermind..they are defined in setbaud.h
[09:11:19] <Lambda_Aurigae> but you never define your baud rate.
[09:12:01] <Lambda_Aurigae> using macros that require a definition without setting that definition won't work.
[09:12:21] <Lambda_Aurigae> #define BAUD 9600
[09:12:46] <Lambda_Aurigae> needs to be before the #include <util/setbaud.h> from the looks of the example on the avr-libc user manual pages.
[09:13:49] <naquad> it is in the build line
[09:13:52] <naquad> -DBAUD=9600
[09:14:55] <Lambda_Aurigae> is 9600 a valid bitrate for 1MHz cpu clock?
[09:15:10] <Lambda_Aurigae> and is your clock calibrated?
[09:16:09] <Lambda_Aurigae> at 1MHz, 9600 can not be matched..it is 5% or more out.
[09:17:06] <Lambda_Aurigae> 7.5% according to wormfood's calculator.
[09:17:16] <Lambda_Aurigae> so, yes, it will give you garbage.
[09:18:49] <Lambda_Aurigae> it is probably calculating a UBRR or 6 which gives you 8928.57 bits per second, not 9600.
[09:19:00] <Lambda_Aurigae> at a UBRR of 5 you get 10416.67 bits per second.
[09:19:13] <Lambda_Aurigae> so, it can't get close enough to 9600 to sync up.
[09:19:30] <Lambda_Aurigae> if you kick your processor up to 8MHz then it will likely give better results.
[09:21:33] <Lambda_Aurigae> at 8MHz you get a UBRR of 51 which gives you 9615.38 bits per second which is within the error rate, under 2%, and the UARTs can talk.
[09:22:21] <Lambda_Aurigae> at 1MHz the best you can get is 4800 bits per second.
[09:36:02] <naquad> same story :( tried to turn off the divisor
[09:36:14] <naquad> plus with atmega328p i've had serial working fine with 1MHz
[11:13:14] <jacekowski> 7.5% is actually still ok for communication
[11:13:29] <jacekowski> i wouldn't do it on daily basis but you can get away with it
[12:15:49] <inkjetunito> hello. i was wondering whether having the pin pa1/xtal2 of an attiny2313 grounded during programming would be a problem?
[12:33:55] <Tom_itx> probably
[12:46:35] <Hexum064_2> hey all
[12:46:50] <Hexum064_2> c question (because some how I still suck at pointers).
[12:47:43] <inkjetunito> Hexum064_2: go ahead
[12:47:45] <Hexum064_2> If I store an address in a normal 16bit unsigned int, how would I pass that value to a pointer argument in a method?
[12:49:44] <inkjetunito> Hexum064_2: cast it
[12:49:57] <inkjetunito> sounds like a bad thing to do though
[12:50:04] <Hexum064_2> probably
[12:50:22] <Hexum064_2> but I'm switching between too buffers
[12:50:33] <Hexum064_2> so I was probably approaching that wrong
[12:50:57] <Hexum064_2> Better way would be to? void *addr = &buff0
[12:51:12] <Hexum064_2> then after the toggle: addr = &buff1
[12:51:13] <Hexum064_2> ?
[12:54:31] <redspl> hi guys..
[12:54:39] <Hexum064_2> hey
[12:54:49] <redspl> i got some max232
[12:55:03] <redspl> but it is SMD :'''''(((
[12:55:37] <redspl> any way to "convert" smd to "normal"?
[12:55:52] <LeoNerd> Mount it on a breakout board?
[12:56:10] <redspl> what is breakout?
[12:56:21] <redspl> i perhaps dont have on
[12:56:22] <redspl> e
[12:56:24] <redspl> one*
[12:56:50] <Hexum064_2> redspl: what package? Can you dead-bug it?
[12:57:42] <redspl> Hexum064, you know, i am not good in terminology. How to determine what package i have? What is dead-bug?
[12:58:04] * redspl thinks Hexum064 facepalmed
[12:58:57] <Hexum064_2> better yet, can you take a pic of it?
[12:59:15] <Jartza> or give the _exact_ model number
[12:59:15] <Hexum064_2> And by dead-bug, I mean solder small wires directly to it.
[13:01:07] <redspl> sec, i am sending the photo
[13:01:26] <Jartza> it's called dead bug because it's "traditionally" done chip "upside down" so the legs point upwards :)
[13:01:58] <Jartza> like a... well, dead bug
[13:04:00] <Hexum064_2> Anyone here speak Japanese. Mine is not good enough to reserve the hotel room I need to get.
[13:05:13] <redspl> http://redston.prv.pl/img.jpg
[13:05:20] <redspl> whoops
[13:06:06] <Hexum064_2> lol. ya that didn't work
[13:06:18] <redspl> http://redston.prv.pl/IMG.jpg
[13:06:34] <redspl> sry for quality
[13:06:42] <Hexum064_2> np
[13:06:42] <redspl> i could give model number too
[13:07:17] <Hexum064_2> Ya, it will be hard but if you don't have a board to solder it to, your best bet is small wires soldered directly to each pin
[13:08:13] <Hexum064_2> BTW, a breakout board is just a board that has the right pads to solder that chip package on to, but has holes for pins
[13:08:19] <Hexum064_2> usualy
[13:08:40] <redspl> aa
[13:08:44] <Hexum064_2> at a standard 2.54 mm spacing, so you can mount it on a breadboard.
[13:08:46] <redspl> so i have many breakouts
[13:09:02] <Hexum064_2> do you have one for that IC's footprint?
[13:09:10] <redspl> nope
[13:09:16] <Hexum064_2> bummer!
[13:11:15] <redspl> last time i found a chip that looks like that max232. It is SMD, but it werent soldered(it has something on board that holded it)
[13:11:26] <redspl> but i dont know where is the board
[13:12:18] <Hexum064_2> sry. You can either buy one and wait till you get it or solder wires to it.
[13:12:24] <redspl> yep..
[13:12:32] <redspl> Normal pins: Plug'N'Work
[13:12:44] <redspl> SMD: Lost time and dont work
[13:13:12] <Hexum064_2> I kinda like the soldering idea though, personally, because I think it would be a fun challenge and, done right, would look kinda cool.
[13:13:28] <redspl> i am not on NO for soldering
[13:13:32] <redspl> soldering is cool
[13:13:39] <Hexum064_2> :)
[13:13:40] <redspl> soldering SMD elements is boooooring
[13:13:56] <redspl> ;p
[13:14:08] <Hexum064_2> heh
[13:14:49] <redspl> i have too big hands! Little chineese people! HELP ME!
[13:17:30] <redspl> jebany kuźwa syf z tego smd
[13:17:43] <redspl> dont ask me what i written
[13:19:24] <Hexum064_2> ok
[13:25:17] <Jartza> I like smd more than th nowadays :)
[13:25:34] <Jartza> but I have solder paste and got air
[13:25:41] <Jartza> hot air, even
[13:33:59] <Hexum064_2> wish I had those some times
[13:34:04] <Hexum064_2> GOD FINALLY!
[13:34:38] <Hexum064_2> Apparently, you cannot change the source address for a DMA channel unless you reset the whole thing. Which means wasting time re-initializing the channel.
[13:35:20] <Hexum064_2> So, now I just switch between two DMA channels, each with a separate source address, and BOOM! It works in preliminary testing!
[13:37:03] <redspl> https://www.youtube.com/watch?v=i5MNLTc7YhY .. so lets try with "EXTREME PROTOTYPE BOARD WIRING TECHNIQUES!"
[13:38:08] <redspl> award for best tutorial and best soundtrack xD
[13:44:46] <Hexum064_2> Checking it out now
[13:50:32] <Hexum064_2> wow
[13:50:43] <Hexum064_2> the potential for shorts....
[13:50:56] <Hexum064_2> the sound track is sooo Japanese
[13:51:16] <Hexum064_2> love it
[13:52:04] <redspl> i asked for the name of song in comments :)
[13:52:36] <Hexum064_2> lol
[13:52:55] <Hexum064_2> bbiab
[13:55:04] <redspl> ok, got wire cutters, prototype board, goldpins, soldering station, solder iron... few things more and fun will begin
[14:04:27] <inkjetunito> don't forget the soundtrack
[14:15:42] <redspl> spox, google will remind me when author will recomment to me :)
[14:21:19] <sabesto> hm, trying to compile a bootloader (https://github.com/nickdademo/xboot/tree/xmega_e5) for an atxmega32e5, getting this: http://hastebin.com/ecefexonum.vbs
[14:21:31] <sabesto> i cant make anything out of it
[14:25:17] <Lambda_Aurigae> sabesto, looks like you are missing a linked file somewhere.
[14:26:08] <sabesto> i'm not that good with compiler-fuu, is there an option to get more verbosity?
[14:26:12] <redspl> delete files from dir(all files, but not .c)and try compiling again
[14:26:17] <redspl> idk this could help
[14:28:15] <sabesto> i have tried that
[14:28:49] <sabesto> note that this is a fork, no mention of it not working. it does work if i select xmega32a4 as target for instance
[14:30:48] <Emil_> redspl: or just "make clean all"
[14:30:52] <Emil_> or something like that
[14:33:43] <sabesto> well, idk, line numbers doesnt seem to match, refers to the last line in the c file
[14:34:36] <sabesto> if i uncomment the macro on line 384 and 1069 it continues to fail
[14:36:30] <Lambda_Aurigae> sounds like you have a hardware difference between the two chips.
[14:36:38] <Lambda_Aurigae> and the software is written for one and not for the other.
[14:40:07] <sabesto> yeah, this is a fork which is suppose to support E5 though
[14:40:31] <Lambda_Aurigae> well, something is not right with the software.
[14:40:37] <sabesto> but i'm trying to compile on linux, ive had to patch avr-libc to get e5 to work at all
[14:40:52] <Lambda_Aurigae> never had an xmega here to futz with so no clue.
[14:41:38] <sabesto> basicly this: http://joost.damad.be/2013/08/using-atxmega32e5-under-linux.html
[14:43:38] <sabesto> xmega seems to be a little forgotten
[14:45:09] <Lambda_Aurigae> not real popular.
[14:45:19] <Lambda_Aurigae> as most people go from 8bit to full 32bit in the arm world.
[14:46:31] <Lambda_Aurigae> xmega chips seem a bit complex to me and once you hit that level of complexity you can go to a full ARM for the same price or less.
[14:47:08] <Lambda_Aurigae> kinda like the 32bit AVR....it has been dying quickly since ARM hit with full force.
[14:50:02] <sabesto> they are a lot less complex then ARM, its just an AVR with a little added functionality that you dont even have to touch to get it to work
[14:52:16] <Hexum064_2> sabesto is right. These are easy to get up and running and you have the option to try to play with the complex stuff. The payoff is that the complex stuff can really make basic chip to some incredible stuff.
[14:53:48] <Lambda_Aurigae> for me the holdback has been needing a dev board or breakout board to use them.
[14:54:29] <Lambda_Aurigae> but that's mostly because I'm a cheap lazy bastard.
[14:54:52] <Hexum064_2> well, can't argue with you there, though you really don't need the DEV board for the U series
[14:54:59] <sabesto> and i think they are even less expensive then regular megas
[14:55:04] <Lambda_Aurigae> will it fit in a solderless breadboard?
[14:55:18] <sabesto> dont think there are any DIP packages
[14:55:22] <Hexum064_2> nope
[14:55:23] <Lambda_Aurigae> bingo.
[14:55:32] <sabesto> but the xplained boards are cheap
[14:55:44] <Hexum064_2> Just saying, you can do it with a really cheap $1 breakout board
[14:55:50] <Lambda_Aurigae> then you gotta solder it on.
[14:55:59] <Lambda_Aurigae> yeah, I know, I can, but I'm lazy.
[14:56:06] <Hexum064_2> I am now playing the worlds smallest violin for you
[14:56:12] <Lambda_Aurigae> hehe.
[14:56:18] <Lambda_Aurigae> as I said, I'm cheap and lazy.
[14:56:21] <Hexum064_2> lol
[14:56:53] <Lambda_Aurigae> and work with kids in the 10 to 16 year old range teaching them how to work with microcontrollers and basic electronics.
[14:57:01] <Lambda_Aurigae> we do a lot of plug and unplug on breadboards.
[14:57:19] <Lambda_Aurigae> and I avoid the soldering iron with them.
[14:57:53] <Lambda_Aurigae> recently started having gettogethers in a library and they frown on us playing with molten metal at their conference tables.
[14:58:12] <Jartza> I use avr tinies for small stufd and cortex m for bigger
[14:58:36] <Lambda_Aurigae> I go mostly with atmega,,,a few attiny here and there,,and pic32 for higher speed and usb stuff.
[14:58:38] <Jartza> and you can get nucleo boards with ~10$
[14:58:53] <Jartza> nice devboards
[14:59:22] <Jartza> no need for external programmer etc.
[14:59:27] <Lambda_Aurigae> and I can get a pic32 with hardware usb in a dip package that runs at 50MHz from a 10MHz crystal.
[14:59:34] <Lambda_Aurigae> 80+ mips.
[14:59:36] <Hexum064_2> well, if the point is to use the xmega, you need a breakout board, but anything else, there are REALLY cheap boards already
[14:59:54] <Lambda_Aurigae> there are cheap boards for just about everything out there.
[14:59:56] <Hexum064_2> Like this mega328p in the arduino nano package
[15:00:18] <Hexum064_2> $2.50, has usb, no other dev board needed
[15:00:50] <Lambda_Aurigae> if usb-serial is all you want, it's a great little package.
[15:01:38] <Hexum064_2> ya
[15:02:23] <Jartza> I made these breadboard-adapters for nucleo
[15:02:27] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxRG41NjdWZE52NVk/edit?usp=docslist_api
[15:03:21] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxUG42TkdnUXhnM00/edit?usp=docslist_api
[15:04:58] <Hexum064_2> NICE
[15:05:04] <Hexum064_2> sry, caps
[15:05:56] <Lambda_Aurigae> I miss 64pin dip package chips..
[15:06:29] <Lambda_Aurigae> oh, wait, I have some here!
[15:06:36] * Lambda_Aurigae pats his 68000 chips.
[15:07:06] <Jartza> :)
[15:08:50] <redspl> Lambda_Aurigae, 68000=motorola68k? You like amiga as me? :D
[15:08:55] <Lambda_Aurigae> of course.
[15:09:00] <Lambda_Aurigae> don't have an amiga right now.
[15:09:02] <Lambda_Aurigae> but loved them.
[15:09:14] <Lambda_Aurigae> my favoritestestest of all times computer was my amiga2000ux
[15:09:23] <Lambda_Aurigae> well,, amiga2500ux actually.
[15:09:56] <Lambda_Aurigae> amiga2000 with a speedup processor, a 20MB harddrive, and unix/amiga-os dual booted.
[15:09:56] <Hexum064_2> they still have a pretty big following
[15:10:00] <Lambda_Aurigae> yup.
[15:10:05] <Lambda_Aurigae> a cult it is it is.
[15:10:18] <Lambda_Aurigae> hell, I still play games on my commodore vic-20.
[15:10:24] <Lambda_Aurigae> hooked to my projector
[15:10:48] <Lambda_Aurigae> with pixels nearly an inch across on the 15 foot diagonal projection screen.
[15:10:59] <Hexum064_2> lol
[15:11:17] <Lambda_Aurigae> HARDCORE retro gaming!
[15:11:56] <redspl> got a600 ks3.1 2mb chipram on desk..
[15:11:57] <redspl> 2gb hdd
[15:12:01] <redspl> ;)
[15:12:16] <Lambda_Aurigae> would love to have one but I have so much stuff now I never use, I just can't justify it.
[15:12:17] <redspl> (dont ask why i am so young and have amiga)
[15:12:20] <Jartza> Lambda_Aurigae: a finnish component store is still selling their 68000s for 1€ each
[15:12:44] <Lambda_Aurigae> I bought a bunch of 68000 dev boards about 5 years ago for $1.00 USD each.
[15:12:49] <Lambda_Aurigae> 20 of them.
[15:12:52] <Lambda_Aurigae> they still work.
[15:12:58] <redspl> 68k was not "their". Many computer used m68k processors
[15:13:02] <Jartza> why wouldn't they
[15:13:02] <Lambda_Aurigae> some brand new, some have stuff soldered on their dev areas.
[15:13:20] <Lambda_Aurigae> some even had stuff burned in the eproms.
[15:13:29] <Lambda_Aurigae> offchip eproms obviously.
[15:13:32] <redspl> I dream about 68020 ACA Turbo card. Or better! Furia turbo! that would be cool
[15:13:49] <Lambda_Aurigae> had a 68020 card in my 2500.
[15:13:51] <redspl> BTW: Mine project with max232 is for ethernet>rs232 to amiga
[15:14:14] <Lambda_Aurigae> one place I worked we had sun 3/260 workstations with 64MB of ram and 68040 processors.
[15:15:03] <Lambda_Aurigae> with 21 inch color high res RGB monitors and optical mice.
[15:15:12] <Lambda_Aurigae> in 1988.
[15:15:38] <redspl> 88 not 98?
[15:15:53] <Lambda_Aurigae> running sun unix system V release III and suntools GUI.
[15:15:56] <Lambda_Aurigae> no...1988...
[15:16:02] <Lambda_Aurigae> by 1998 I was out of the military.
[15:16:06] <redspl> 0.0!
[15:16:10] <Lambda_Aurigae> these things rocked back then.
[15:16:14] <redspl> WHOW
[15:16:19] <redspl> That rocks today!
[15:16:28] <Lambda_Aurigae> a full GUI on a unix box looong before mickysoft came out with windows.
[15:16:30] <redspl> (as retro machine)
[15:16:42] <Lambda_Aurigae> we even had framemaker software
[15:16:48] <redspl> install amigaos on it.. 64MB FAST OMGOMGOMGOMG
[15:16:51] <Lambda_Aurigae> that could create standalone hyperlinked documents.
[15:17:07] <Lambda_Aurigae> I doubt amigaos would run on it.
[15:17:11] <redspl> dont tell me i am starting to cry at mine retro machines..
[15:17:28] <Lambda_Aurigae> I think we had 1024x768 resolution on those 21inch monitors back then.
[15:17:37] <redspl> c64... a600.. atari 65xe(awful!)... that is nothing compared to 64mb fast
[15:18:04] <Lambda_Aurigae> one of my many projects is to build a neuvo-retro computer.
[15:18:08] <Lambda_Aurigae> from microcontrollers.
[15:18:34] <Lambda_Aurigae> I'm very SLOWLY porting C-64 basic OS to AVR/PIC/8052
[15:18:48] <redspl> cool
[15:19:05] <Lambda_Aurigae> while at the same time trying to make a similar C-OS rather than Basic-OS
[15:19:18] <Lambda_Aurigae> I found a C subset interpreter that rocks
[15:19:30] <Lambda_Aurigae> but trying to pare it down to run on a microcontroller is proving difficult.
[15:19:56] <Lambda_Aurigae> I recently redirected efforts from the atmega1284p to the pic32mx270f256b chip.
[15:20:49] <redspl> Lambda_Aurigae, port c64 basic IMPROVED by Blackbox
[15:20:54] <redspl> that is cooler
[15:20:57] <Lambda_Aurigae> twice the flash and 4 times the sram.
[15:20:59] <redspl> 20% cooler
[15:21:04] <Lambda_Aurigae> will look at it.
[15:21:20] <Lambda_Aurigae> I need something with good floating point and string handling.
[15:21:26] <Lambda_Aurigae> or, at least, passable.
[15:21:36] <Lambda_Aurigae> doesn't need to be fast because, of course, it's interpreted and all.
[15:21:51] <redspl> you have real c64?
[15:22:32] <Jartza> I have two
[15:22:41] <Jartza> and commodore 1084 monitor
[15:22:44] <Lambda_Aurigae> 5 of them.
[15:22:45] <Jartza> plus 1541
[15:22:46] <Lambda_Aurigae> 4 c64
[15:22:49] <Lambda_Aurigae> and 1 c64c
[15:22:59] <Lambda_Aurigae> a 1541 and 1571
[15:23:09] <Lambda_Aurigae> looking for a cheap 1581 3.5 inch drive
[15:23:18] <Lambda_Aurigae> 2 vic-20...only one works.
[15:23:20] <Jartza> my 1571 is broken, haven't had time to see what's wrong
[15:23:23] <Lambda_Aurigae> and 1 c-128
[15:23:40] <Lambda_Aurigae> not finding any english version sites for that software.
[15:24:18] <Lambda_Aurigae> my playing around with vga generation is part of this whole neuvo-retro computer build.
[15:24:53] <Jartza> I have 32*12 characters for you with attiny :D
[15:25:00] <Lambda_Aurigae> yeah.
[15:25:08] <Lambda_Aurigae> I've played with that already...is impressive.
[15:25:38] <Lambda_Aurigae> I WANT full 640x480 vga, 8 color.
[15:26:03] <Jartza> after I return from my holiday I'll optimize it a bit and add uart
[15:27:07] <Jartza> maybe get rid of the ISR completely and just run with "full force"
[15:27:09] <Lambda_Aurigae> getting closer to that with 400x300 subres from 800x600 vga display using spi sram chips.
[15:27:17] <Jartza> yeah
[15:27:47] <redspl> I am interesed in buying/getting original commodore monitors. Mine sucks
[15:27:53] <Lambda_Aurigae> doing double buffering with 2 chips gives me lots of room to work but I have to draw everything twice.
[15:27:56] <Jartza> I don't know if this attiny85 version is usable for anything, but made it just for fun
[15:28:15] <Lambda_Aurigae> Jartza, well, considering similar things sell for considerable amount of money,,,
[15:28:35] <Jartza> yeah, I know
[15:29:03] <ambro718> For SD card over SPI, how does one "wait" for a response to a command? I see I have written code to send byte 0xFF until the received byte is different from 0xFF. But I can't write anything in the spec about this :S
[15:29:13] <Jartza> but this will be all-open
[15:29:14] <Lambda_Aurigae> uvga is 30 dollars or so..but that is 80x25 16 color.
[15:30:09] <Jartza> yea, quite expensive compared to $.8 chip and osc :)
[15:30:14] <Lambda_Aurigae> yup.
[15:30:26] <Jartza> and three attinys can make 8 colors ;)
[15:30:30] <Jartza> that was fun
[15:30:34] <Lambda_Aurigae> I should see what I can make the pic32 do without an external crystal...hehe
[15:30:58] <Lambda_Aurigae> double it to 6 attinys and you can get even more colors!
[15:31:14] <Jartza> I also tried with internal oscillator but it wasn't accurate enough
[15:31:21] <Lambda_Aurigae> yeah, can imagine.
[15:31:43] <Lambda_Aurigae> pic internal oscillators tend to be a bit more stable than avr from what I've seen.
[15:32:16] <Lambda_Aurigae> haven't really done any tests with the pic32 internal oscillators.
[15:32:26] <Lambda_Aurigae> they just need to put crystals in the package dangit!
[15:33:04] <Lambda_Aurigae> these spi sram chips I have can clock out 1bit, 2bits, or 4bits at a time....
[15:33:15] <Jartza> oh, cool
[15:33:27] <Jartza> nice for vga
[15:33:30] <Lambda_Aurigae> and can stream without pauses,,,you set it to a ram location, tell it to output data, then toggle the clock and data streams out.
[15:33:33] <Lambda_Aurigae> yeah...
[15:33:36] <Lambda_Aurigae> 4bit color
[15:33:41] <Lambda_Aurigae> RGBI
[15:34:06] <Lambda_Aurigae> which, as I recall, was EGA capability...
[15:34:35] <redspl> EGA? AGA!
[15:34:36] <Lambda_Aurigae> the I bit just sets all the others higher,,,effectively shifting all the colors up a bit.
[15:34:40] <LeoNerd> At 4 bits, I'd consider instead using them as an index into some fast palette RAM and actually doing 2 or 3-bits per channel
[15:34:59] <Lambda_Aurigae> I could do 4 bits per channel by paralleling 3 chips.
[15:35:04] <LeoNerd> Nobody really needs both light and dark green, for example; but it would be nice to have orange or purple or some other non-RGBI colour
[15:35:58] <Lambda_Aurigae> http://www.microchip.com/pagehandler/en-us/products/memory/serialSRAM/home.html
[15:36:10] <Lambda_Aurigae> they come in 1Mbit packages.
[15:36:33] <Lambda_Aurigae> and, if you want nvsram, it's there too but only outputs in 1 or 2 bits at a time.
[15:37:02] <Lambda_Aurigae> the extra pins are used for the standby power.
[15:37:59] <Lambda_Aurigae> I used 8 of those chips put together with some glue logic to make a pseudo 1MByte 8bit parallel nvsram module, just for the fun of it.
[15:38:39] <Lambda_Aurigae> used an atmega32 to control it with parallel address line inputs and all.
[15:38:53] <Lambda_Aurigae> was kind of overkill but a fun wtf project.
[15:39:39] <Jartza> hehe
[15:40:04] <Lambda_Aurigae> also have used the serial sram to hold "programs" for a little simple BASIC-subset interpreter running on an attiny85.
[15:40:40] <Jartza> yea. my attiny85-vga was just for kicks because my colleague said "I don't think you can get vga out from that chip, but if you do, I own you a drink"
[15:41:22] <Lambda_Aurigae> had the attiny85, a 1Mbit serial sram, and an 8bit spi-gpio expander hooked together.
[15:41:43] <Lambda_Aurigae> heck, you show up around Des Moines Iowa area and I'll buy you pizza and a drink for that one.
[15:41:51] <Lambda_Aurigae> or a zombie burger.
[15:42:58] <Jartza> hehe, a bit far, but I'll keep that in mind
[15:43:46] <Lambda_Aurigae> oh man...microchip makes a 20MHz serial eeprom.
[15:45:19] <Lambda_Aurigae> oh heck...serial flash chips even faster!
[15:45:24] <Jartza> ohh
[15:46:05] <Lambda_Aurigae> but not in a usable package for me to play with.
[15:47:05] <Lambda_Aurigae> serial eeprom chip to hold a "background" image
[15:47:15] <Lambda_Aurigae> and serial sram to hold your volatile image.
[15:47:46] <Lambda_Aurigae> AND gate or XOR gate or something to mix the two.
[15:49:02] <Lambda_Aurigae> only single bit i/o though.
[15:49:04] <tpw_rules> xnand
[15:51:37] <Lambda_Aurigae> don't think I'm familiar with the xnand.
[15:52:40] <tpw_rules> nxnxnxnoror
[15:52:46] <tpw_rules> 3 input
[15:52:57] <Lambda_Aurigae> hmmm.
[15:53:18] <Lambda_Aurigae> useful maybe for sprites
[15:54:14] <tpw_rules> http://www.linusakesson.net/scene/bitbanger/
[15:54:30] <tpw_rules> Jartza: ^ show your friend that
[16:02:11] <martinus> Love the music. :)
[16:02:24] <tpw_rules> he has a few other great avr demos
[16:02:41] <Jartza> tpw_rules: yeah, I've seen linus's demos :)
[16:04:21] <tpw_rules> i saw a bit of a writeup of how one of the earliest 3d games worked and i want to try it on avr some time
[16:04:33] <tpw_rules> basically how it avoided doing a hell of a lot of math
[16:05:59] <Lambda_Aurigae> guess I missed that one.
[16:18:17] <Jartza> adding 2400bps uart to my vga should be relatively easy
[16:19:10] <Jartza> that's a bit slow of course, but might be usable for something
[16:19:13] <apo_> Hm, shouldn't for uint8 a,b "(a*b) >> 7" be the same as the high byte of "fmul r23, r24"?
[16:19:29] <Jartza> almost 2s to update whole screen
[16:23:59] <Jartza> other option would be to use pcint
[16:24:10] <Jartza> and fast speee, like 115200bps
[16:24:10] <Xark> tpw_rules: Someone used an LCD library I worked on and made this -> https://www.youtube.com/watch?v=8nZam2jpIqw
[16:24:29] <Jartza> that would blank the screen during update, though
[16:25:00] <tpw_rules> nah i was thinking of something that would be a lot faster
[16:25:16] <Xark> tpw_rules: What kind of output? NTSC?
[16:25:23] <tpw_rules> no to one of those things
[16:27:15] <Xark> tpw_rules: You can do video with ~20-25% of CPU remaining. Probably still more than a 6502. :) This uses 128 re-definable characters (and 128 in flash) -> https://www.youtube.com/watch?v=Imk5ony8JHI
[16:27:47] <tpw_rules> 6502 is best
[16:27:49] <Xark> tpw_rules: Can do a full bitmap too, but not great rez with <2KB framebuffer (if on 328).
[16:27:59] <tpw_rules> nah i know what i'm thinking
[16:28:09] <Xark> tpw_rules: Okay, cool.
[16:28:49] * Xark was pondering a run-length encoded video mode, that would be good for flat shaded polygons...(but hasn't implemented it).
[16:29:08] <tpw_rules> this would be some assembly
[16:29:20] <Xark> tpw_rules: Sure, that stuff is mostly assembly too.
[16:29:46] <tpw_rules> how fast can one of those 3.2 inch screens be driven? can the hardware do spi at 32mhz?
[16:30:05] <tpw_rules> with the clock at 16
[16:30:20] * Xark has some experience writing "3D" games on a 6502 -> https://www.youtube.com/watch?v=1YvYBlyzphs :)
[16:30:44] <Xark> tpw_rules: Max SPI speed is clock/2 (so 8Mhz on 16Mhz AVR).
[16:30:49] <tpw_rules> ugh
[16:30:54] <tpw_rules> that's rubbish
[16:31:15] <Xark> tpw_rules: IIRC, those cheap displays are rated for ~20MHz SPI.
[16:31:29] <tpw_rules> is an avr rated for 40 mhz? but that's cheating. i want spi faster
[16:32:26] <Xark> tpw_rules: I have code for parallel LCD shield that is quite a bit faster (but still ~13.5 FPS for full screen fill) -> https://hackaday.io/project/6038-pdqgfx-optimzed-avr-lcd-graphics
[16:32:47] <Xark> tpw_rules: 20MHz tops (although XMega is 32MHz IIRC).
[16:32:58] <tpw_rules> rrrrrgh
[16:34:07] <Xark> Also depending on part, you can overclock some. E.g., 1284P can run ~27MHz (as seen in UzeBox).
[16:34:15] <Xark> (also has nice 16KB SRAM...)
[16:34:25] <Lambda_Aurigae> is my favorite avr
[16:34:42] <Lambda_Aurigae> run them at 24MHz regularly.
[16:34:45] <tpw_rules> that's cheating though
[16:34:55] <tpw_rules> it leaves too many clock cycles to do work
[16:35:10] <tpw_rules> i want four clock cycles per byte
[16:35:11] <Xark> I was able to get a ~1MHz 6502 emulator running with NTSC video on 1284P (video took most of the cycles) -> https://imgur.com/a/dIrLJ#0
[16:36:36] <Xark> I believe XMega can DMA the video (leaving cycles available for graphics). Like this -> http://www.batsocks.co.uk/readme/XMegaExamples.htm
[16:37:45] <Lambda_Aurigae> think I can do similar on pic32mx chip too.
[16:37:53] <Lambda_Aurigae> which has 64K of sram to play with.
[16:37:59] <Xark> Lambda_Aurigae: Oh, yeah, PIC32 is a whole 'nother league. :)
[16:38:05] <Lambda_Aurigae> yup.
[16:38:20] <Lambda_Aurigae> just looking into dma from ram to the spi module.
[16:38:40] <Xark> Like https://hackaday.io/project/5507-xorya-extremely-low-cost-game-console-on-pic32/log/17474-deep-into-mandelbrot-set-in-real-time
[16:39:34] <redspl> bye for now
[16:39:37] <Xark> Heh, or "PIC-MAN" -> https://www.youtube.com/watch?v=aPfSP6Gbo8c
[16:42:32] * Xark should finish his little AVR game (currently in "tech demo" stage) -> https://i.imgur.com/IgsmEY3.png and https://i.imgur.com/gNyTb6u.jpg (using re-definable character with X & Y "fine scroll").
[16:45:01] <Thrashbarg> that looks like a lot of fun :P
[16:48:19] <Xark> Thrashbarg: Yeah. I am dusting off the project now. :) Kind of a Scramble / Caverns of Mars -ish game is envisioned. Support 3 voice wavetable audio too (outputs mixed sample every scan line).
[16:48:30] <Thrashbarg> nice
[16:48:42] <Thrashbarg> what speed is the AVR running at?
[16:48:57] <Xark> Bog standard Arduino Uno is the target (so 16MHz).
[16:49:03] <Thrashbarg> nice
[16:49:30] <Xark> 4 cycles per pixel (so ~192x192 or so).
[16:49:39] <Thrashbarg> ok so software bit shifting
[16:49:55] <Xark> Yes, full bit-bang (not using SPI).
[16:49:58] <Thrashbarg> yeah
[16:50:22] <Thrashbarg> 192x192 is enough for that sort of thing
[16:51:02] <Xark> Yeah, as is 1KB for 128 8x8 chars and ~441 for 21x21 tile map, leaves "just enough" for some stack and game variables. :)
[16:51:16] <Thrashbarg> heh you could put a 14.31818MHz crystal on the SPI bus and make it inject colour into it :P
[16:51:42] <Thrashbarg> heh
[16:51:47] <Xark> Thrashbarg: Yeah. Tempting, but then not easily runnable for Uno folks.
[16:51:53] <Thrashbarg> yeah
[16:52:17] <Xark> I wanted to "max out" TV-out "hardware". :) [Which is typically quite lo-res as full bitmap]
[16:52:27] <Thrashbarg> yup cool
[16:53:00] <Xark> If I start getting fancy, I end up using an FPGA real quick. :)
[16:53:07] <Thrashbarg> haha
[16:53:34] <Xark> Uno keeps it "nicely" constrained.
[16:53:40] <Thrashbarg> KISS etc
[16:54:29] <Xark> Hmm, seems last I was working on simple "MIDI-ish" sound driver (for music)....
[16:55:13] <Xark> (Around January)
[16:55:28] <Thrashbarg> ok
[16:55:50] <Lambda_Aurigae> hmm.
[16:56:03] <Lambda_Aurigae> wonder if I can dig up an old 8bit vga card and an 8bit soundblaster card.
[16:56:16] <Xark> Lambda_Aurigae: Bit bang some ISA signals. :)
[16:56:21] <Lambda_Aurigae> bingo.
[16:56:24] <Thrashbarg> hehe
[16:57:55] <Xark> Lambda_Aurigae: Well, in theory possible. Have you seen this? http://www.fleasystems.com/flea86.html (Full 8086 PC with bit-banged video and ISA expansion running on [fast] 8051)
[16:58:06] <Lambda_Aurigae> yup.
[16:58:57] <Xark> Lambda_Aurigae: If you forget the bit-banged video and x86 emulation, I would think AVR would be fully able to control ISA bus.
[16:59:09] <Lambda_Aurigae> of course it can.
[16:59:30] <Xark> Prove it. :)
[16:59:47] <Lambda_Aurigae> if I could find the boards I would.
[16:59:47] <Xark> Seriously, sounds like a nice "hack" idea. :)
[17:00:14] * Xark has a ISA Trident VGA...but not sure about Soundblaster...
[17:00:49] <Lambda_Aurigae> http://www.uelectronics.info/backup/isa-vga-card-avr.html
[17:00:59] <Thrashbarg> 32 bits should be enough, 8 data, 20 address, 4 for mem/IO rd/wr
[17:01:25] <Lambda_Aurigae> http://tinyvga.com/avr-isa-vga
[17:02:18] <Xark> Neat. I gather ATmega128 is same pinout as 1284P too...
[17:02:31] <Lambda_Aurigae> nope.
[17:02:36] <Lambda_Aurigae> it's a 64pin tqfp.
[17:02:48] <Xark> Not only -> http://www.mikrocontroller.net/attachment/34444/AVR_ISP.gif
[17:02:56] <Xark> (Perhaps in that project)
[17:03:24] * Xark links image with part # http://www.mikrocontroller.net/attachment/3104/ATmega128-ISP.gif
[17:05:02] <Xark> Actually, looks like you are correct. I don't see ATMega128 listed in DIP...
[17:05:35] <Xark> However, I bet a 1284 could do it...
[17:05:41] <Lambda_Aurigae> it's not.
[17:05:50] <Xark> ...or of course a pile of shift registers. :)
[17:05:54] <Lambda_Aurigae> but with a little bus magic you could do it with a 1284.
[17:06:10] <Lambda_Aurigae> many 16bit video cards can run 8bit too.
[17:06:25] <Xark> Yeah, most I would think...
[17:06:43] <Lambda_Aurigae> looks like they are using 32 address lines on that unit.
[17:07:26] <Lambda_Aurigae> I saw a card once that used an AVR to connect as an ISA device too.
[17:07:52] <Thrashbarg> that sounds more difficult
[17:07:57] <Thrashbarg> timing and things
[17:08:13] <Lambda_Aurigae> not so much as I remember...the ISA bus is very straightforward.
[17:08:25] <Lambda_Aurigae> not nearly as bad as PCI.
[17:08:48] <Thrashbarg> yes, but you'd have to respond to data before it disappears, or at least latch it externally so the AVR can catch up
[17:08:56] <Lambda_Aurigae> yup.
[17:10:32] <Lambda_Aurigae> if you stick to the 8bit bus side it's only a 4.77MHz bus.
[17:10:43] <Thrashbarg> yeah
[17:11:44] <Thrashbarg> wouldn't it be less? Assuming no DMA transfers
[17:12:10] <Thrashbarg> because it takes a few cycles at 4.77MHz for the 8088 to do anything
[17:12:22] <Lambda_Aurigae> yup.
[17:12:37] <Lambda_Aurigae> should be easily doable with an avr at some multiple of 4.77MHz
[17:12:50] <Thrashbarg> which is available on the bus
[17:12:56] <Lambda_Aurigae> yup.
[17:13:33] <Thrashbarg> 14.31818MHz divided by 3
[17:13:40] <Thrashbarg> for 4.77MHz
[17:14:14] <Thrashbarg> the 8088 needs two 33% clocks
[17:14:28] <Thrashbarg> so divide it by 3 :P
[17:14:44] <FL4SHK> They had to be alarm clocks though. Can't be without the waking up in the morning.
[17:14:57] <Thrashbarg> mmyes
[17:22:48] <apo_> gcc's asm for c = (a*b) >> 7; is weird >_>
[17:23:44] <Jartza> apo_: how come?
[17:23:53] <jacekowski> apo_: all uint8?
[17:23:56] <apo_> jacekowski: yeah
[17:25:21] <apo_> "mul r24, r25; movw r24,r0; clr r0; lsl r24; mov r24, r25; rol r24; sbc r25, r25; out 0xc, r24;" so now the result is in 0xc, r24 is (a*b)>>7, and r25 is... 255 if (a*b)&0x80, else 0?
[17:25:43] <apo_> the last instruction makes no sense at all
[17:25:55] <apo_> and ignoring that one, I think this could all be done with an fmul
[17:27:08] <jacekowski> what is that supposed to achieve
[17:27:15] <jacekowski> i mean, i don't see any applications for this
[17:28:00] <apo_> multiplying two signed values and getting something in [0:255]?
[17:29:03] <jacekowski> i know what it's doing, i just don't get why
[17:29:17] <Thrashbarg> integer DSP? :P
[17:29:33] <apo_> or DSG :P
[17:29:41] <Thrashbarg> yeah
[17:30:32] <Thrashbarg> woudln't you need to >>8 ? to shift the higher 8 bits to the lower?
[17:31:37] <Xark> apo_: Hmm, when I try that in a little test I don't get the "out" (which is odd).
[17:32:05] <Thrashbarg> 0x0C sounds like it might be a status register or something
[17:32:09] <apo_> Xark: I wrote it with *(uint8_t) 0x2C = ... just to make sure it doesn't get optimized away
[17:32:16] <apo_> hence the out
[17:32:18] <Thrashbarg> ah
[17:32:27] <Xark> I see
[17:32:47] <apo_> Thrashbarg: If I want the high byte, but I want the high byte left-shifted by 1 :p
[17:32:54] <apo_> (plus the high bit of the low byte)
[17:33:03] <Thrashbarg> righto
[17:33:10] <Thrashbarg> so divided by 128
[17:33:25] <apo_> Hence (a*b)>>7
[17:33:43] <Thrashbarg> looks like GCC is optimising it by shifting right by 8 by taking the higher byte then shifting left by 1
[17:33:49] <Thrashbarg> rather than using seven shifts
[17:34:52] * Xark links his results from same test -> http://hastebin.com/xecaqizuwa.avrasm
[17:35:48] <apo_> Xark: http://p.0au.de/a6ffc687/foo.c input, http://p.0au.de/24d7f3b8/a.s output
[17:36:43] <Xark> apo_: Similar, but not quite the same...different avr-gcc, I assume (or optimization level).
[17:36:50] <apo_> http://p.0au.de/3c16adb5/b.s and what I think it should be doing ;)
[17:36:58] <apo_> Xark: I'm doing -O3
[17:37:05] <apo_> with 4.9.2
[17:37:45] <Xark> Yeah, I am 4.8.1 with -Os
[17:38:24] <apo_> -Os does the same as -O3 for me
[17:39:05] <apo_> but yeah, similarly long
[17:40:09] <Xark> I have never seen avr-gcc use fmul TBH...
[17:40:21] <apo_> it probably doesn't know it
[17:40:32] <apo_> but still, at least that final sbc seems like nonsense to me
[17:40:37] <Xark> apo_: May need inline asm (if speed is critical here).
[17:40:44] <apo_> oh, it's not
[17:40:57] <apo_> I just wanted to see what gcc does in this case
[17:41:18] <Xark> apo_: I guess the r25 is high byte of result (...who ordered that, though)?
[17:41:57] <apo_> No, it's not
[17:42:18] <apo_> it's FF if the left-shift carries
[17:42:29] <apo_> and 0 otherwise
[17:42:33] <apo_> unless I'm mistaken?
[17:43:42] <apo_> rol r24 moves the high bit of a*b into the carry register, sbc r25,r25 sets r25 to r25-r25-C...
[17:43:48] <apo_> =-C
[17:44:10] <Xark> I see. My gcc does adc r24,r24, not a rol
[17:44:17] <apo_> that's the same, really
[17:44:51] <Xark> Very similar, but not exactly the same WRT carry.
[17:45:02] <apo_> Oh?
[17:45:21] <apo_> Oh, yeah
[17:45:29] <apo_> wait, no
[17:45:36] <Xark> I believe it is only the same if you know carry =0
[17:46:00] <Xark> (bit zero is carry)
[17:46:06] <apo_> adc r24, r24 ----> r24 = r24 + r24 + C
[17:46:16] <apo_> rol r24 ---> r24 = r24 * 2 + C
[17:46:34] <apo_> (and set carry appropriately)
[17:46:44] <apo_> those are equivalent >_>
[17:47:04] <Xark> Okay, that makes sense.
[17:47:47] <apo_> and r24 was previously the high byte of the multiplication, so now C is the high bit of that... and it subtracts that from 0
[19:20:06] <Hexum064_2> having a bit of a brain fart right now. What is the digital IC that takes in 4 bits at once and sets one of 16 outputs high?
[19:23:39] <Lambda_Aurigae> one of sixteen selector
[19:24:49] <Lambda_Aurigae> 74154
[19:24:59] <Lambda_Aurigae> 4 line to 15 line decoder/demultiplexer
[19:25:12] <Hexum064_2> yep. just found it too
[19:25:17] <Hexum064_2> tnx
[19:25:59] <Lambda_Aurigae> http://www.ti.com/product/sn74154/description
[19:26:08] <Lambda_Aurigae> https://en.wikipedia.org/wiki/List_of_7400_series_integrated_circuits
[20:25:49] <hackvana> Hmm
[20:26:27] <Lambda_Aurigae> bit low pitch
[20:26:39] <Lambda_Aurigae> have another gallon of coffee and pop at least 3 nodoze.
[20:30:37] * Thrashbarg jitters
[20:59:57] <[w_w]> is it possible to tell if an AVR is running on 5v or 3v without additional components? specifically an attiny84?
[21:01:36] <Lambda_Aurigae> hmmm.
[21:01:59] <Lambda_Aurigae> not sure.
[21:02:12] <Lambda_Aurigae> you need a reference of some kind.
[21:02:38] <Lambda_Aurigae> I suppose a pullup resistor could be a reference.
[21:03:13] <Lambda_Aurigae> maybe the ADC could do so.
[21:06:18] <tpw_rules> [w_w]: what is an additional component?
[21:06:39] <tpw_rules> i'd use a resistor divider read by the adc, but that would be 2 more resistors
[21:06:58] <Lambda_Aurigae> tpw_rules, you still need a reference.
[21:07:08] <tpw_rules> does the 84 not have an internal one?
[21:07:17] <Lambda_Aurigae> oh...duh!
[21:07:28] <Lambda_Aurigae> yeah...it does...which is not reliant on VCC, correct?
[21:07:34] <tpw_rules> correct
[21:07:51] <Lambda_Aurigae> then just tie the ADC to VCC and read it.
[21:07:53] <[w_w]> I was hoping there was some trickery i could do to not require other components beside the chip.
[21:08:10] <Lambda_Aurigae> an external wire between VCC and one ADC input.
[21:08:13] <tpw_rules> if you're asking for some magic "read vcc" register, there isn't one
[21:08:23] <tpw_rules> Lambda_Aurigae: the problem is it's only 1.1v i believe
[21:08:38] <[w_w]> yes. its 1.1 and gain is not negative.
[21:09:12] <Lambda_Aurigae> hmmm...so, yeah, a voltage divider resistor pair would be needed.
[21:09:45] <tpw_rules> i know the 85 has an internal temperature sensor
[21:10:04] <tpw_rules> glue a resistor that's between vcc and gnd and see how hot it gets? :D
[21:10:14] <tpw_rules> more voltage will dissipate more power through it
[21:10:24] <Lambda_Aurigae> which is just a thermistor tied to one pin of the ADC switch internally.
[21:10:49] <tpw_rules> anyway to answer your question, using zero external components except maybe a wire, i don't think it's possible
[21:47:00] <apo_> I hate building toolchains.
[22:30:26] <apo_> I hate building toolchains!
[22:33:44] <Xark> "What could possibly go wrong?" :)
[23:47:57] <phryk> can avr do structs?
[23:49:22] <learath> eh?
[23:49:55] <phryk> my question might be retarded, I know next to nothing of low(er) level programming.
[23:50:19] <phryk> i just want to know if i can use structs in my c code for an avr microcontroller.
[23:50:27] <learath> Ask your compiler.
[23:50:37] <learath> If the answer isn't "yes" shoot your compiler and try again.
[23:50:41] <Xark> phryk: Yes. You can use C++ templates even. :)
[23:50:52] <phryk> thanks :P
[23:50:55] <Xark> (Yeah, assuming not a brain-dead compiler). :)
[23:51:07] <Xark> avr-gcc is fine with structs.
[23:54:33] <learath> The flip side to this is, depending on the microcontroller, structs may not make much sense for say, a 2048 byte memory pool
[23:55:39] <Xark> learath: I find them quite handy (and they also can map to flash for read-only things).
[23:55:55] <learath> Now that's fancy
[23:56:02] <learath> (mapping to flash)
[23:56:58] <Xark> If the struct is <= 64 bytes, then AVR even has a nice "free offset" addressing mode.
[23:57:11] <learath> free offset?
[23:57:22] <Xark> learath: Built into the instruction
[23:57:28] <learath> <- been working with the VMWare API all week, 2048 bytes is enough to... log in? maybe?
[23:57:54] <Xark> LDD r0,Z+16 e.g.
[23:58:05] <Xark> (where Z points to base of struct)
[23:58:13] <learath> That's pretty cool
[23:58:48] <Xark> learath: Heh, probably not enough for that even. :)
[23:59:20] <learath> (the api is *awesome*, but yeah, not "lightweight" or "mediumweight" or "fat as fuck", tbh, I'm not sure what to call it)
[23:59:47] <Xark> Par for "modern systems", sadly.