#avr | Logs for 2015-08-01

Back
[00:39:29] <hackvana> Mr_Sheesh: You're flapping dude.
[09:57:59] <tpw_rules> what's the max amount of ram you can get in a non xmega chip?
[10:09:35] <serivich> depends really, I'm sure
[10:09:41] <serivich> you gotta read the datasheet tpw_rules
[10:09:58] <tpw_rules> yeah but then i have to get the datasheet of all the chips that aren't xmegas
[10:10:03] <tpw_rules> i was wondering if somebody just knew offhand
[10:10:32] <serivich> true. It would be nice if datasheet were eletronically formatted to be parsable
[10:11:19] <tpw_rules> like i don't even know the different serieses
[10:12:16] <tpw_rules> i was hoping for 4 or 8K sram
[10:17:39] <tpw_rules> i'm thinking about a jpeg decoder for avr just for fun but 2k just isn't enough memory
[10:17:52] <tpw_rules> too much data needs to be calculated from the file and reused
[11:05:22] <Jartza> simulavr timers get different result than avr studio simulator timers
[11:05:26] <Jartza> which one to trust? :)
[11:05:51] <Jartza> my timer (ctc) has top value of 158
[11:06:04] <Chillum> try a non-simulated timer?
[11:06:14] <Jartza> using atmel studio simulator, at certain point of code the timer has value between 0..3
[11:06:30] <Jartza> in simulavr it seems to be 157..1
[11:07:01] <Jartza> Chillum: very hard to debug this in actual chip (attiny85)
[11:07:12] <Chillum> fair enough
[11:07:41] <Chillum> odd that you would get different results, you would think that emulating an atmega85 should be trivial
[11:07:53] <Chillum> and that both sims would match
[11:08:07] <Jartza> I thought so
[11:08:16] <Jartza> maybe I just need to continue with atmel studio
[11:08:23] <Jartza> but I hate windows and I hate visual studio :)
[11:08:29] <Chillum> those things are hard to debug, particularly if you don't have extra pins
[11:08:42] <Jartza> indeed
[11:09:48] <Chillum> you can try trusting one and seeing if it behaves as expected, then if not try the other. If one is consistent with the chips real behaviour then trust that one
[11:10:23] <Chillum> setup a condition where it will clearly fail or succeed based on the expected outcome of the simulation
[11:10:50] <Chillum> unless both sims are wrong
[11:12:53] <Jartza> well, the expected outcome is very hard to determine
[11:14:09] <Jartza> as I'm trying to achieve situation where I would get always the value 0-3 in the timer at that point of code
[11:14:26] <Jartza> because I use that for ijmp :)
[11:14:40] <Jartza> and as I have no way of debugging the code in chip, I need to figure something out
[11:19:09] <Jartza> except well... I might have
[11:19:58] <Jartza> just ijmp:ing to different rjmp-commands, "right values" continue running the software, wrong values rjmp to themselves
[11:20:04] <Jartza> then I could see if the program continues or not
[12:19:39] <Chillum> Jartza: when I need a number from 0..x I generally just use a normal counter and then use modulus to get the number: value = timer % 3
[12:19:51] <Chillum> though I may be misunderstanding what you are trying to accomplish
[12:52:36] <Jartza> Chillum: clock-accurate timings without jitter
[12:52:56] <Jartza> and no, timer ISR isn't clock-accurate
[12:53:07] <Chillum> ah
[13:03:32] <Jartza> got it working though, but it seems neither of the simulators were perfect
[13:03:47] <Jartza> the reality was in between those two simulators :D
[13:50:41] <Lambda_Aurigae> tpw_rules, 16K on the atmega1284p
[13:52:03] <Lambda_Aurigae> tpw_rules, you can look at the atmel parametric parameters table and sort by ram.
[13:52:48] <Lambda_Aurigae> http://www.atmel.com/v2PFResults.aspx#%28actives:!%288238,8394,8362,8282,8431,8300,8358,8392,8378,8445,8236,8449,8474,8248,8264,8447,8256,8254,8286,8462,8429,8458,8466,8400,8302,8278%29,data:%28area:%27%27,category:%2734864[33180[33085]]%27,pm:!%28%28i:8238,v:!%284,14%29%29,%28i:8394,v:!%284,15%29%29,%28i:8362,v:!%282,12%29%29,%28i:8282,v:!%285%29%29,%28i:8431,v:!%285,22%29%29,%28i:8300,v:!%284,8%29%29,%28i:8358,v:!%2812,53%29%29,%28i:8392,v:!%280,1
[13:52:48] <Lambda_Aurigae> %29%29,%28i:8378,v:!n%29,%28i:8445,v:!%285,6,9%29%29,%28i:8236,v:!%287,12%29%29,%28i:8449,v:!%281,6%29%29,%28i:8474,v:!%280%29%29,%28i:8248,v:!%280,1%29%29,%28i:8264,v:!%281,4%29%29,%28i:8447,v:!%280,1%29%29,%28i:8256,v:!%281%29%29,%28i:8254,v:!%287,13%29%29,%28i:8286,v:!%280,1%29%29,%28i:8462,v:!%280,4%29%29,%28i:8429,v:!%281,5%29%29,%28i:8458,v:!%280,2%29%29,%28i:8466,v:!%281,2,4%29%29,%28i:8400,v:!%282,12%29%29,%28i:8302,v:!%280%29%29,%28i:8278,v
[13:52:49] <Lambda_Aurigae> :!%280,1%29%29%29,view:table%29,sc:1%29
[13:52:55] <Lambda_Aurigae> not that it pastes for squat..hehe.
[13:53:26] <Lambda_Aurigae> http://www.atmel.com/products/microcontrollers/avr/megaAVR.aspx?tab=parameters
[13:54:03] <Lambda_Aurigae> atmega1284(deprecated I think) and atmega1284p have 16K..that's max.
[13:54:10] <Lambda_Aurigae> 1280 and 1281 have 4k
[13:54:10] <Jartza> seems simavr doesn't support the timers I use on attiny85 :o
[13:54:30] <Jartza> might be there's just no such thing as good opensource simulator for avr :(
[13:54:32] <Jartza> TIMER: avr_timer_reconfigure-1 unsupported timer mode wgm=0 (0)
[13:54:38] <Lambda_Aurigae> Jartza, yup.
[13:57:11] <Jartza> and the simulavr version that compiles to mac doesn't have support for attiny85
[13:57:22] <Jartza> the git version doesn't compile and I didn't have time to check
[13:57:41] <Jartza> luckily the simulavr works in linux
[13:57:47] <Lambda_Aurigae> I haven't used a simulator for,,,,8 years.
[13:58:37] <Jartza> this is first time I need one
[13:58:47] <Jartza> I want a view to registers and timers and... :)
[14:20:47] <tpw_rules> Lambda_Aurigae: aren't those the 64 pin ones tho?
[14:54:48] <Jartza> hmmh. seems the simulavr timers are actually way off
[15:36:44] <Jartza> btw.
[15:36:49] <Jartza> is anyone here using avra?
[15:36:56] <Thrashbarg> yes
[15:37:49] <Jartza> is it worth using?
[15:38:08] <Jartza> I find using avr-gcc for pure-assembler writing a bit... nasty
[15:38:37] <Thrashbarg> it's a work alike of the Atmel assembler so it's a little more friendly for assembler only jobs
[15:38:46] <Thrashbarg> I used it for my video generator thing
[15:39:57] <Jartza> yeah, also compatibility with atmel assembler was a point
[15:42:46] <Jartza> well. this is also video generator thing :D
[15:45:04] <Thrashbarg> hehe cool
[15:45:51] <Jartza> Thrashbarg: https://drive.google.com/file/d/0B2dTzW9TMeBxWW5Fa3c5cjJZbTQ/view?usp=sharing
[15:45:55] <Jartza> that's attiny85 :)
[15:46:08] <Thrashbarg> awesome
[15:46:13] <Thrashbarg> bit banged?
[15:46:27] <Jartza> well, I misuse USI to draw pixels
[15:46:36] <Thrashbarg> ok
[15:47:03] <Jartza> what is still missing is the RX uart to update the screen
[15:47:12] <Thrashbarg> ah yea
[15:47:18] <Jartza> working on that
[15:47:36] <Jartza> and the attiny is not even overclocked
[15:47:48] <Thrashbarg> nice what speed?
[15:47:51] <Jartza> 20Mhz
[15:48:01] <Thrashbarg> ok
[15:48:29] <Thrashbarg> my ATMega is running at 27MHz to generate an 80x24 text display through composite video
[15:48:39] <Jartza> yeah
[15:48:45] <Jartza> in composite there's more time :)
[15:48:50] <Thrashbarg> yea
[15:49:00] <Jartza> but I have a lot of old vga monitors, so I wanted vga
[15:49:03] <Thrashbarg> 27MHz so I can choose between NTSC and PAL
[15:49:04] <Thrashbarg> ok
[15:50:34] <Jartza> there's no memory to make 80x24 in attiny :D
[15:50:41] <Thrashbarg> yup
[15:50:58] <Jartza> but I think 32x12 could be usable for... something
[15:51:03] <Thrashbarg> hmm
[15:51:16] <Jartza> anyway. the point of making the whole thing was a hack value
[15:51:27] <Thrashbarg> yeah
[15:52:09] <Jartza> and then even hackier one, using three attinys :)
[15:52:26] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxZ3BlZTg3OWw3dVE/view?usp=sharing
[15:52:28] <Jartza> makes this :D
[15:53:00] <Xark> The AVR "Apple II clone" on HaD used 16u2 for 32x16 VGA (and used no RAM for anything but framebuffer, just registers and GPIO0-2 regs). :)
[15:53:27] <Jartza> yea, but it's 16u2 :)
[15:53:32] <Jartza> different beast
[15:54:36] <Xark> Same 512 bytes RAM as Tiny (and I think using USI for output).
[15:55:42] <Xark> The video was a bit rough -> http://dpeckett.com/turning-the-arduino-uno-into-an-apple
[15:56:01] <FL4SHK> oh gosh wow
[15:56:11] <FL4SHK> I'm surprised that's fast enough
[15:56:59] <FL4SHK> ...I'm also surprised it has enough RAM
[15:57:27] <FL4SHK> I don't know how much an Apple II had though
[15:57:57] <Xark> FL4SHK: The Apple is on the main 328P, the video is done by Uno 16u2 (serial chip).
[15:58:16] <FL4SHK> cool
[15:58:38] <Xark> Not enough RAM for a "real Apple" but it can usefully run Integer BASIC ROM. :)
[15:59:08] <Jartza> ahh
[15:59:14] <Jartza> less pixels :)
[16:00:23] <Jartza> I draw 192 horizontal pixels
[16:02:08] <Jartza> but that's nice too
[16:02:45] <Jartza> Xark: my ultimate goal is to make a "computer" out of only attiny85 chips :)
[16:02:58] <Xark> I see. :)
[16:03:24] <Jartza> attiny85 peripherals like handling keyboard & joysticks, audio chip and vga :)
[16:03:32] <Thrashbarg> sounds fun
[16:03:33] <Jartza> and then "main" processor being attiny85 too
[16:03:48] <Jartza> completely and utterly pointless and useless project. which is why it's so much fun.
[16:04:12] <Jartza> might be that 3 attinys is enough, I guess one can handle audio and input easily
[16:04:32] <Thrashbarg> I was fiddling around with a parallel optimised language based on data dependency, so the main program can access a pool of processors and split itself up to cover as much as possible...
[16:04:58] <Thrashbarg> thought it'd be fun to have a board loaded with ATTiny's to see what it'd do
[16:07:20] <Jartza> Thrashbarg: is avra so compatible, I can just drop attiny85 include file from avr studio to it?
[16:07:30] <Thrashbarg> yes
[16:07:46] <Jartza> cool
[16:07:53] <Jartza> because the mac version seems to not have it
[16:08:04] <Thrashbarg> yea, they're copyrighted by Atmel
[16:08:19] <Jartza> even though it says attiny85 is supported device
[16:08:29] <Thrashbarg> it is, just the include files aren't there
[16:08:42] <Jartza> yea. no prob if they work as-is
[16:09:42] <Thrashbarg> I think there's *one* assembler directive that doesn't work which pops up in the include files from time to time, but you can just comment it out
[16:10:09] <Jartza> strangely there is tn45def.inc
[16:11:03] <Jartza> I mean, included with avra
[16:11:10] <Jartza> and it seems to be from atmel
[16:11:40] <Thrashbarg> hmm ok
[16:12:19] <Thrashbarg> anyway I just copy the needed .inc files to my working directory, problem fixed
[16:12:42] <Jartza> yea
[16:12:51] <Jartza> seems to work ok, at least for attiny85
[16:12:52] <Jartza> cool
[16:23:09] <Lambda_Aurigae> tpw_rules, atmega1284p comes in 40pin dip
[16:28:28] <tpw_rules> Lambda_Aurigae: ecch. nothing in a 328p form factor tho?
[16:29:18] <tpw_rules> that's sad
[16:29:25] <tpw_rules> i wanted a compact jpeg demo
[16:29:37] <tpw_rules> it may yet be possible, but not for arbitrary files...
[16:31:32] * tpw_rules opens kickstarter
[16:32:54] <Lambda_Aurigae> tpw_rules, there is the pic32mx270f256n
[16:33:41] <Lambda_Aurigae> 256k flash, 64k ram, 28pin dip, 32bit processor, 50mhz/83dmips
[16:33:42] <Jartza> oh
[16:33:49] <Jartza> avra works nicely
[16:33:56] <tpw_rules> yeah but it's all of those things
[16:33:58] <Jartza> why did I even try with avr-gcc?
[16:33:58] <tpw_rules> all i need is more ram
[16:34:04] <tpw_rules> i like avr-gcc
[16:34:14] <Lambda_Aurigae> Jartza, yup...that's what I used starting with avr.
[16:34:15] <Jartza> for assembler, I don't
[16:34:30] <tpw_rules> i started with avra and switched
[16:34:31] <Lambda_Aurigae> tpw_rules, yeah, but it's a nice chip anyhow...mips core, not pic core.
[16:34:52] <tpw_rules> well the point was a neat little demo on a limited chip. 32 bit kind of isn't :P
[16:35:20] <Lambda_Aurigae> kind of.
[16:35:50] <tpw_rules> my alternate plan is to use some of the screen memory. it would work, just a little ugly. but i think the ili9314 supports partial blank
[16:36:20] <Lambda_Aurigae> dunno what the project is, but could you use external serial ram?
[16:36:48] <tpw_rules> i want to make a jpeg decoding demo with the seeeeeeed tft+touch+sd shield
[16:37:08] <tpw_rules> but jpeg takes up a lot of memory to decode if you don't want to regenerate all of the datastructures for each block
[16:38:39] <tpw_rules> putting them in rom seems like cheating because then it could only display a single image rather than a (relatively) arbitrary one from the sd card
[16:38:58] <Lambda_Aurigae> process it into an external sram?
[16:39:10] <Lambda_Aurigae> 1Mbit serial sram...spi interface.
[16:39:21] <tpw_rules> well that would be the screen's memory
[16:41:23] <tpw_rules> oh well. i have some ideas
[16:41:29] <tpw_rules> i'll show it to yall if i get it working
[16:42:35] <tpw_rules> i understand the algo and have a c decoder for a regular pc. just gotta squash it
[18:36:17] <mike_papa> Hello. I'll paste my question from #arduino, as it seems everybody is sleaping there, and it's about AtMega2560 anyway.
[18:36:26] <mike_papa> I have a problem with timers. I'm trying to use timer 5 on Adduino Mega 2560, and whatever I do it seems to be 8 bit, not 16 bit (TCNT5H stays 0). Here is code (as simple as it gets): http://hastebin.com/esohokuhin.coffee
[19:02:46] <Casper> mike_papa: really, check the datasheet for the mega2560 and see what it say about that timer
[19:05:50] <mike_papa> Casper: It says it's 16-bit timer/counter. What do you mean?
[19:06:40] <mike_papa> Casper: I'm trying to use it as 16 bit, but it behaves like 8 bit. Higher byte never changes. Overflows after 0x00FF.
[19:10:00] <Casper> are you using the arduino junk library stuff?
[19:12:16] <Lambda_Aurigae> looks like he is.
[19:13:10] <Casper> yeah it look like it
[19:13:14] <Casper> and is probably his issue
[19:13:38] <Lambda_Aurigae> mike_papa, try it with a regular C application rather than the arduino stuff.
[19:13:58] <mike_papa> Casper: just for serial. But... I just tried without it. And selecting prescalers /256 and /1024 makes timer freeze (same as no clock source).
[19:14:22] <Lambda_Aurigae> mike_papa, you have the arduino stuff loaded in there..it could be interfering.
[19:14:35] <Casper> mike_papa: don't use arduino junk library, code in real C. Save your sanity, the arduino stuff is buggy, encourage bad coding practice and make things impossible to debug
[19:14:57] <Casper> people here will not help you with it, too much trouble
[19:15:22] <Lambda_Aurigae> we see an #include<avr/io.h> and a main() and we are good.
[19:15:42] <Lambda_Aurigae> we see no main() and we assume ardweeny and turn off our brains.
[19:16:13] <mike_papa> Ok. I thought I was just missing something obvious. I'll try with pure C tomorrow.
[19:16:38] <Lambda_Aurigae> once the ardweeny stuff is out of the way then we can dig into it and see.
[20:18:10] <Mr_Sheesh> long time no comment from Tom_itx :P
[20:21:12] <Lambda_Aurigae> yeah.
[20:21:16] <Lambda_Aurigae> he isn't usually so quiet
[20:21:24] <Lambda_Aurigae> maybe he got arrested for making bombs or something.
[20:21:34] <Lambda_Aurigae> oh, wait, no, that's me.
[20:22:20] <Mr_Sheesh> Did you at least make GOOD bombs? :p
[20:33:46] <Lambda_Aurigae> well, I never killed anybody with them...that I know of.
[20:33:58] <Lambda_Aurigae> but blew up a lot of stuff.
[22:15:45] <Casper> Lambda_Aurigae: for sure, you didn't made those bomb that was used tonight!
[22:16:11] <Casper> the bomb that throw another bomb in the air, that throw other bombs, that throw yet more bombs...
[22:16:15] <Casper> aka fireworks