#avr | Logs for 2015-12-19

Back
[08:47:40] <nikomo> washed the keycaps on my keyboard, drying up now
[08:48:07] <nikomo> feels funny to type on bare switches
[09:03:47] <nikomo> y
[09:03:59] <nikomo> turms out my mouse vlr
[09:04:15] <nikomo> changed ,e to this channel
[09:19:48] <Jartza> https://youtu.be/7jxDp4N522w
[09:19:50] <Jartza> oops
[09:19:52] <Jartza> https://www.youtube.com/watch?v=3bHLrKSi5gQ
[09:19:53] <Jartza> this
[09:20:51] <Thrashbarg> nice what speed is that running at?
[09:21:04] <Jartza> 20Mhz
[09:21:12] <Thrashbarg> impressive
[09:21:15] <Jartza> and full RAM used for screen buffer
[09:21:18] <Thrashbarg> yeah
[09:21:20] <Jartza> 32x16 characters = 512 Bytes :)
[09:21:26] <Thrashbarg> yeah haha
[09:21:57] <Jartza> the first video of course is the 3 chip version :)
[09:22:08] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxRXVzSUNCT1h2NHM/view
[09:22:09] <Jartza> this one
[09:22:28] <Jartza> the second one is single color
[09:22:38] <Thrashbarg> I did 80x24 on composite with an ATMega324, 2kB framebuffer for text. Though the clock ran at 27MHz. Pretty sure I can make it 13.5MHz if I tried :P
[09:22:59] <Thrashbarg> awesome
[09:23:15] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxaFFxam1uVW05NlE/view
[09:23:21] <Jartza> that's the B/W board :)
[09:23:31] <Thrashbarg> yea hehe
[09:23:44] <Jartza> I draw 6x10 pixel font
[09:23:57] <Jartza> vertically I could draw much more if I just had some RAM :P
[09:24:01] <Thrashbarg> yup
[09:24:20] <Thrashbarg> SPI as the video out?
[09:24:44] <Jartza> attiny85 doesn't have SPI
[09:24:48] <Jartza> but I'm using USI
[09:24:49] <Thrashbarg> ah haha
[09:24:51] <Thrashbarg> ok
[09:24:55] <Jartza> nor does it have UART either
[09:25:00] <Thrashbarg> right
[09:25:14] <Jartza> but I'm sampling uart @9600bps
[09:25:20] <Jartza> can't use ISR either
[09:25:22] <Thrashbarg> I thought all ATmegas had SPI for programming?
[09:25:28] <Jartza> (no RAM for stack & return address)
[09:25:40] <Jartza> well, ISP. it's almost SPI, yes :)
[09:25:47] <Thrashbarg> ok
[09:26:10] <Jartza> some tinys have TPI programming though
[09:26:18] <Jartza> and xmegas have jtag/pdi
[09:26:22] <Thrashbarg> yea
[09:30:49] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxWV93R0Qwc2xfTkE/view
[12:57:20] <t4nk526> hi
[12:57:41] <t4nk526> anybody has experience programming avr's on linux
[12:58:11] <Tom_itx> not hard
[12:59:43] <t4nk526> probably not, unless gcc generates same code for different timer configurations
[13:00:43] <t4nk526> http://pastebin.com/wBXpKNb7
[13:01:26] <Lambda_Aurigae> haven't had any problem on linux yet.
[13:01:35] <t4nk526> i put different values in TCCR2B, but gcc gives me the same *.o file over and over
[13:02:17] <tpw_rules> you're using the wrong |
[13:02:40] <tpw_rules> || is logical, so if either side is not 0, it evaluates to not 0
[13:02:50] <tpw_rules> you want just | to OR together bitwise
[13:03:59] <t4nk526> you rigth, that fixed the problem
[13:04:05] <Lambda_Aurigae> and that TCCR2A line isn't going to turn any bits off...even if you change the || to |
[13:05:07] <Lambda_Aurigae> you have to AND the binary inverse.
[13:06:31] <Lambda_Aurigae> or, something like that.
[13:06:39] <Lambda_Aurigae> I posted something in the last 48 hours that does it.
[13:07:07] <Lambda_Aurigae> number &= ~(1 << x);
[13:08:03] <t4nk526> that TCCR2A line shouldn't do anything, as those bits are 0 to begin with.
[13:08:04] <Lambda_Aurigae> that clears bit x
[13:08:15] <Lambda_Aurigae> yeah...
[13:08:37] <Lambda_Aurigae> it's kind of a do-nothing-anyway line...but if the bits are set to 1, that line wouldn't clear them.
[13:08:43] <t4nk526> but i will remember number &= ~(1 << x); for future use :)
[13:08:58] <Lambda_Aurigae> number ^= 1 << x;
[13:09:01] <Lambda_Aurigae> toggles the bit.
[13:09:12] <Lambda_Aurigae> number ^= (-x ^ number) & (1 << n);
[13:09:14] <tpw_rules> also _BV(x) is the same as 1 << x
[13:09:27] <Lambda_Aurigae> Bit n will be set if x is 1, and cleared if x is 0.
[13:09:50] <t4nk526> this one then, TCCR2A &= ~((0 << WGM21) | (0 << WGM20))
[13:09:56] <t4nk526> will it do the thing
[13:10:01] <Lambda_Aurigae> nope.
[13:10:07] <Lambda_Aurigae> change the zeroes to ones
[13:10:11] <t4nk526> or should i have ~ before every shift
[13:10:30] <t4nk526> i mean TCCR2A &= ~((1 << WGM21) | (1 << WGM20));
[13:10:32] <Lambda_Aurigae> build your bit pattern, invert it, then AND it..
[13:10:39] <Lambda_Aurigae> Ithink that should work.
[13:11:23] <Lambda_Aurigae> y = (number >> x) & 1;
[13:11:35] <Lambda_Aurigae> will put a 1 or 0 in y depending on the value of bit x
[13:11:45] <Lambda_Aurigae> to read a bit.
[13:11:50] <Lambda_Aurigae> just to toss that in.
[13:12:25] <t4nk526> yeah, i have to read more about bit operations in C
[13:12:53] <t4nk526> btw, is there any avr simulators for linux (except using wine)
[13:12:55] <Lambda_Aurigae> it's just simple binary math.
[13:13:01] <Lambda_Aurigae> simulavr
[13:13:03] <Lambda_Aurigae> simavr
[13:13:09] <Lambda_Aurigae> never used either one myself.
[13:13:15] <Lambda_Aurigae> I just run my code on the chip.
[13:13:38] <Lambda_Aurigae> neither of those is a GUI app though.
[13:13:47] <Lambda_Aurigae> they are meant to be used with avr-gdb as I recall.
[13:13:50] <tpw_rules> yeah
[13:14:01] <tpw_rules> they're not all that friendly; i did some stuff with them
[13:14:12] <Lambda_Aurigae> if you need the GUI like you with with avr studio or atmel studio then you will need to actually run windows rather than wine.
[13:14:13] <t4nk526> its ok, better then nothing
[13:14:15] <t4nk526> i guess
[13:14:21] <tpw_rules> you're supposed to write your own test bench with the peripherals you need and then it calls your code to get i/o values etc
[13:14:22] <tpw_rules> iir
[13:14:22] <tpw_rules>
[13:14:23] <tpw_rules> c
[13:14:25] <tpw_rules> :|
[13:15:09] <t4nk526> you mean in simavr
[13:15:30] <tpw_rules> simavr is kind of a library
[13:16:05] <t4nk526> simulavr then?
[13:16:11] <Lambda_Aurigae> well, both simulavr and simavr are simulators.
[13:16:12] <tpw_rules> i mean what do you want to simulate
[13:16:58] <t4nk526> not acctual circuit, just see whats happening inside the chip
[13:17:06] <t4nk526> like using hardware jtag
[13:17:24] <Lambda_Aurigae> http://reprap.org/wiki/SimulAVR
[13:18:13] <tpw_rules> that looks friendlier
[13:18:23] <Lambda_Aurigae> http://www.nongnu.org/simulavr/intro.html#simple-example
[13:18:33] <tpw_rules> but it'll spit out a waveform file and you can attach avrgdb to it
[13:18:55] <Lambda_Aurigae> that second one does just that.
[13:19:04] <tpw_rules> Lambda_Aurigae: have you used simavr?
[13:19:11] <Lambda_Aurigae> played with it once.
[13:19:41] <Lambda_Aurigae> http://www.instructables.com/id/Debugging-AVR-code-in-Linux-with-simavr/?ALLSTEPS
[13:20:20] <tpw_rules> oh okay, didn't realize it could do that. i thought you had to write a testbench
[13:20:30] <Lambda_Aurigae> don't have to, but you can.
[13:20:54] <Lambda_Aurigae> I think simulavr is more powerful overall.
[13:21:02] <Lambda_Aurigae> simavr is more hackable into your own projects.
[13:21:19] <tpw_rules> yeah i needed to for what i was doing anyway. i kinda made my own hardware jtag by running code on the real chip, capturing i/o with a logic analyzer, and shoving it into simavr
[13:21:26] <tpw_rules> blasted external peripherals
[13:21:53] <Lambda_Aurigae> so far I've never come up with a need for either, or jtag debugging for that matter.
[13:22:12] <Lambda_Aurigae> but, I'm kind of one of those savant guys who, when I write code, I understand what it's doing.
[13:22:41] <Lambda_Aurigae> and when it doesn't do what it's supposed to do, I hack it down to small parts and work out each part then put them together a little at a time.
[13:22:41] <tpw_rules> i think i blocked out the details, but it was a pretty tricky bug. also that doesn't work when external peripherals just kinda ignore their documentation :P
[13:22:57] <Lambda_Aurigae> and use lots of blinky lights for debug signals.
[13:23:51] <t4nk526> do { special_output_port = in_char; } while((in_char = special_input_port) != '\n');
[13:23:55] <Lambda_Aurigae> hell, I even once used a 555 timer and linear slide pot to make a slow and adjustable clock source to step through code on an avr slowly.
[13:24:02] <tpw_rules> haha
[13:24:06] <t4nk526> this one was odd, even thought he described it
[13:24:20] <Lambda_Aurigae> the dang chip will run at 1Hz...
[13:24:32] <tpw_rules> tell that to the ps/2 keyboard and other SPI master hooked up :p
[13:25:08] <Lambda_Aurigae> that was back in the atmega32 days when I was getting started in AVR,,,,in,,,2001 or 2002 ish.
[13:25:30] <Lambda_Aurigae> maybe 2005ish...
[13:25:33] <Lambda_Aurigae> don't remember exactly.
[13:25:45] <Lambda_Aurigae> wuvs my 555 timers!
[13:27:24] <tpw_rules> do like that guy who replaced the die of a 7 segment demuxer and stuff an attiny in one
[13:28:27] <Lambda_Aurigae> for certain things, I would consider the real 555 timer to be more reliable than a microcontroller in the same circuit.
[13:28:42] <tpw_rules> probably. but then you can't prank someone
[13:29:05] <tpw_rules> redefine Q=CV, but only somtimes
[13:29:29] <Lambda_Aurigae> too bad a tiny doesn't have similar pinout though.
[13:29:41] <tpw_rules> they don't? :(
[13:29:42] <Lambda_Aurigae> it would be fun to make a 555 emulator on a tiny that you could drop in place.
[13:29:49] <Lambda_Aurigae> GND is in the wrong place.
[13:30:13] <tpw_rules> rely on ESD diodes?
[13:30:18] <Lambda_Aurigae> on the attiny85, VCC is pin 8 and GND is pin 4
[13:30:32] <Lambda_Aurigae> on the 555, VCC is pin 8 and GND is pin 1
[13:31:19] <Lambda_Aurigae> reset is in the wrong place too.
[13:31:42] <Lambda_Aurigae> yeah..would have to do some major rewire to drop an attiny85 in place of a 555.
[13:31:53] <tpw_rules> pitch it to them
[13:31:56] <tpw_rules> attiny8555
[13:32:09] <Lambda_Aurigae> I suppose with the right gear you could cut the die out and replace it inside the carrier.
[13:33:24] <Lambda_Aurigae> I once made logic gates from a pile of attiny25 chips.
[13:34:10] <tpw_rules> picoFPGA
[13:34:12] <Lambda_Aurigae> varied from 1 to 4 inputs with 1 output for nand, nor, and, or, xor, and not gates
[13:34:38] <Lambda_Aurigae> put little logic gate symbols on the top of the chips and used them for teaching digital logic.
[13:35:00] <Lambda_Aurigae> even had a couple of S/R flipflops and J/K flipflops.
[13:35:30] <tpw_rules> why those over actual logic gates?
[13:35:39] <Lambda_Aurigae> for the fun of it.
[13:35:45] <Lambda_Aurigae> did build them with the logic gates too.
[13:35:48] <Lambda_Aurigae> worked rather well.
[13:36:15] <Lambda_Aurigae> I had gotten a box of 200 attiny25 chips for like $30.00 USD.
[13:36:23] <tpw_rules> how did you program them all?
[13:36:30] <LeoNerd> Eh.. tiny25s are next-to-useless though
[13:36:40] <LeoNerd> 2Ki of flash, 5 GPIOs,...
[13:36:49] <Lambda_Aurigae> programmed them the same way I do most AVRs..
[13:36:55] <tpw_rules> shoulda also networked them. they aren't gonna notice a 1us glitch in the output are tehy?
[13:36:57] <Lambda_Aurigae> with an stk200 parallel port connected programmer.
[13:37:25] <Lambda_Aurigae> I have a little 8pin ZIF socket that I used to make life easier.
[13:38:05] <Lambda_Aurigae> for the NOT gates I put 2 in a single package but everything else was one per chip.
[13:38:46] <Lambda_Aurigae> LeoNerd, I bet Jartza could get one to do 16x8 text on a vga display!
[13:40:18] <Lambda_Aurigae> I also turned a couple of them into clock generators with analog input to use a 150K ohm variable resistor to control the clock speed.
[13:41:25] <Lambda_Aurigae> the whole set I ended up donating to a high school teacher who taught science, electronics, and computers.
[13:41:49] <Lambda_Aurigae> was a fun project.
[13:45:04] <Jartza> Lambda_Aurigae: yeah, I think very easily :)
[13:46:58] <Jartza> Lambda_Aurigae: hacked a bit and scrolling basically works, but has glitches
[13:47:03] <Jartza> because I do uglies :)
[13:49:15] <Lambda_Aurigae> hehe.
[13:49:27] <Lambda_Aurigae> I picked 16x8 because that would fill the sram on a tiny25.
[13:50:02] <cehteh> real men use tiny 12 .. who needs ram at all
[13:50:13] <cehteh> or was it the tiny11?
[13:50:15] <Lambda_Aurigae> gotta have some kind of frame buffer.
[13:51:26] <Jartza> Lambda_Aurigae: https://www.youtube.com/watch?v=7jxDp4N522w
[13:51:34] <Jartza> https://www.youtube.com/watch?v=3bHLrKSi5gQ
[13:51:49] <Jartza> horizontal scroll has quite a lot of glitches, but well, it still works
[13:51:54] <Lambda_Aurigae> nice crisp font though.
[13:52:05] <Jartza> but now everything works again, so I can start fixing the glitches and optimizing more
[13:52:58] <Jartza> yea
[13:52:58] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxWV93R0Qwc2xfTkE/view
[13:53:03] <Jartza> font is now quite OK imo
[13:53:32] <cehteh> better than last night :D
[13:53:36] <Jartza> yea :D
[13:54:02] <Lambda_Aurigae> that's usable for a commodore pet type replacement display.
[13:54:11] <cehteh> the small p lacks underlength or?
[13:54:59] <cehteh> dunno if the 's' would look better with longer lines
[13:55:19] <Jartza> not sure yeah, I fix that when everything else works :)
[13:55:54] <cehteh> yeah sorry, i think font looks is the only thing i could help with :D ..
[13:56:09] <Jartza> hehe
[13:56:21] <Jartza> luckily the font is very easy to create
[13:56:24] <Lambda_Aurigae> hmm...commodore pet did 40x25 characterdisplay.
[13:56:30] <cehteh> well .. i offered you my fontcompiler in preprocessor :)
[13:57:25] <Jartza> well, I already have font processor
[13:57:42] <Jartza> https://github.com/Jartza/octapentaveega/blob/no_predraw/vgafont.dat
[13:57:43] <cehteh> yeh but python is cheating
[13:57:48] <Jartza> it processes this file to font
[13:57:52] <Jartza> no it's not cheating :)
[13:57:58] <Jartza> it's a tool
[13:58:00] <Jartza> and it works
[13:58:14] <cehteh> j/k
[14:02:48] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxRzJOQVZMNFE0STg/view
[14:02:51] <Jartza> well, modded a bit
[14:03:01] <Jartza> small p is better now, don't know about s
[14:04:02] <Lambda_Aurigae> fixed the p but the q is still short tailed.
[14:04:08] <Lambda_Aurigae> :}
[14:04:24] <Jartza> darn
[14:04:51] <Lambda_Aurigae> with the longer tail, the p, q, and g will touch some characters leaving no gap.
[14:05:13] <Jartza> yes
[14:05:24] <Jartza> the y and g does that anyway
[14:05:33] <Lambda_Aurigae> yeah..forgot the y
[14:06:16] <Lambda_Aurigae> I would personally shorten everything by one pixel and move the base of all the characters up that one pixel so you get the gap...except for the graphic characters that are supposed to touch.
[14:06:22] <Lambda_Aurigae> but,,,what do I know?
[14:08:07] <Lambda_Aurigae> still looks good overall...
[14:35:47] <LeoNerd> Bah.. no RikusW when I need him
[14:35:58] * LeoNerd has been staring at HVSP .. possibly too much... <.<
[15:15:42] <nikomo> Jartza: gonna make myself a little board to fit the attiny85 onto, with a programming header, that I can stick on the breadboard
[15:15:52] <nikomo> see how that goes
[15:19:26] <Jartza> nikomo: cool
[15:39:34] <Jartza> hmmh
[15:39:39] <Jartza> maybe there's actually an easy fix
[15:39:42] <Jartza> need to try it out
[16:08:40] <Jartza> Yea. Vertical scroll fixed.
[16:10:35] <Jartza> next I need to fix the horizontal scroll
[16:32:38] <cehteh> and then: Diagonal scroll
[16:33:08] <nikomo> then, depth-scroll
[16:33:16] <nikomo> ATTiny85 Rift
[16:33:41] <nikomo> Jartza: get on it, I want a working proto by Monday
[16:33:54] <Jartza> heh
[16:33:55] <cehteh> haha 3D display in color with only 6 tinys
[16:34:28] <nikomo> the Rift takes in HDMI right? idk how hard that is, to drive
[17:41:46] <Jartza> haah
[17:41:53] <Jartza> got the horizontal scroll fixed
[17:56:38] <Jartza> https://www.youtube.com/watch?v=lcVfgj2P_7A
[18:32:22] <Jartza> https://www.youtube.com/watch?v=f5xURYvWXyU
[19:36:52] <Jartza> https://github.com/Jartza/octapentaveega
[19:36:57] <Jartza> updated 32x16 there :)