#avr | Logs for 2015-12-30

Back
[00:48:42] <dgriffi> does anyone here understand libusb?
[01:49:25] <Yoduza> you want use it as dll ?
[02:21:06] <dgriffi> I was confused over an apparent lack of means of finding out why trying to open a device fails
[03:01:34] <Jartza> morning
[03:08:09] <Xark> Jartza: Challenge accepted...but I am not sure I can stay awake that long. :)
[04:01:39] <Jartza> Xark: :)
[04:02:12] <Jartza> I'm happy with the VGA now
[04:02:23] <Jartza> been running the ansi tester for few days
[04:02:30] <Jartza> not a single missed hsync or vsync :)
[04:03:09] <xrlk> vga is what i use for debugging right
[04:03:48] <Jartza> seems the code is pretty stable
[04:04:35] <Xark> Jartza: Excellent.
[04:07:16] <Jartza> even the horizontal full screen scroll doesn't lose characters from uart anymore
[04:07:18] <Jartza> which is nice
[04:07:30] <Jartza> https://www.youtube.com/watch?v=3PoTthPlUBg
[04:19:16] <Jartza> previously the horizontal scroll occasionally "failed", or actually it just occasionally took 3-4 cycles too long and the vsync was delayed, which on some monitors caused it to lose sync momentarily
[04:19:43] <Jartza> so I had to split each row scrolling to 4 phases where I scroll 8 characters during single hsync blanking
[04:19:50] <Jartza> but even then I had the same prob
[04:20:24] <Jartza> when the screen buffer scrolling was in certain position and I had to compensate for the buffer overflow
[04:20:41] <Jartza> I shaved those cycles then by storing the scroll buffer address temporarily to SPH and SPL :)
[04:20:52] <Jartza> so I don't have to recalculate it every time
[04:21:25] <Jartza> and I'm not using stack anyway, so those two io-registers were perfect for me
[05:40:51] <MikaelW> Hi! I have a problem with a bootloader I have created myself. The problem is when I have erased the first page things stop to work. As far as I know I have placed all code running in the boolaoder section and interrupts and timers are stopped. How can I proceed to debug this problem?
[10:36:38] <majkrzak> Hi, I've got wierd problem on my atmega 328p. When I'm launhcing timer0 in CTC mode, led on PB5 reduces its power (somehow PWM?)
[11:33:11] <Jartza> sounds plausible
[11:33:31] <Jartza> check the datasheet and see what's on PB5
[11:34:47] <majkrzak> nothing connected with timmer: SCK, PCINT5
[11:37:48] <Jartza> weird
[11:39:19] <majkrzak> If timer is started in normal mode, led is off.
[11:39:31] <majkrzak> I hope my assembler works well
[11:39:43] <majkrzak> gavrasm gerd's AVR assembler Version 3.4 (C)2014 by DG4FAC
[11:42:24] <Jartza> why wouldn't it
[11:43:24] <Jartza> haven't used that myself, but should work
[11:43:29] <Jartza> I use avra myself
[11:44:28] <Jartza> last time I looked the gavrasm was only available to linux & win
[11:44:34] <Jartza> I use OSX
[11:46:39] <Jartza> though hmm... freepascal is available for osx too
[11:47:23] <majkrzak> something seems to be wrong :) when setting TCCR0B to 0 led fails :)
[11:47:37] <majkrzak> it shall be 0 by default
[11:47:38] <Jartza> hmmh
[11:48:46] <majkrzak> adress may be wrong
[11:48:55] <Jartza> maybe
[11:50:22] <majkrzak> in data sheet register adresses have specyfic notation xxx (xxx).
[11:51:39] <majkrzak> PORTB: 0x05 (0x25) and TCCR0B: 0x25 (0x45)
[11:53:44] <Jartza> well yeah, registers are from 0x00 to 0x1F
[11:54:39] <majkrzak> When using the I/O specific commands IN and OUT, the I/O addresses 0x00 - 0x3F must be used. When addressing I/O Registers as data space using LD and ST instructions, 0x20 must be added to these addresses. The ATmega48A/PA/88A/PA/168A/PA/328/P is a complex microcontroller with more peripheral units than can be supported within the 64 location reserved in Opcode for the IN and OUT instructions. For the Extended I/O space from 0x60 -
[11:54:41] <majkrzak> 0xFF in SRAM, only the ST/STS/STD and LD/LDS/LDD instructions can be used.
[11:55:05] <Jartza> io registers are from 0x20 - 0x5F and extended IO-registers are 0x60 -> 0xFF
[11:55:59] <majkrzak> i was using TCCR0B with STS command, and it seems that my asembler dont want to add 0x20 to it
[11:56:06] <Jartza> ouch
[11:56:12] <Jartza> that sounds bad if it doesn't do it automatically
[11:56:17] <majkrzak> yep
[11:56:35] <majkrzak> going to change it then :)
[11:58:36] <majkrzak> what is your version of avra?
[11:59:49] <Jartza> $ avra -v
[11:59:49] <Jartza> AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010)
[11:59:50] <Jartza> Copyright (C) 1998-2010. Check out README file for more info
[12:02:52] <majkrzak> ok git it
[12:05:07] <majkrzak> same efect on avra
[12:06:04] <Jartza> pastie.org the source?
[12:06:08] <Jartza> or part of it at least
[12:07:22] <majkrzak> sts TCCR0B, r16 :)
[12:07:33] <Jartza> hmm
[12:07:37] <majkrzak> i have to replace it with out
[12:07:42] <majkrzak> and it will work fine
[12:08:05] <Jartza> well, using out is better when it's not extended io
[12:08:11] <majkrzak> i know
[12:08:51] <majkrzak> but it would be better when using sts didnt make so huge probem :)
[12:08:53] <Jartza> I haven't actually tried st/ld:ing non-extended io, might be the asm doesn't actually add that 0x20 to addresses
[12:09:54] <majkrzak> at leest waring :)
[12:12:59] <Jartza> gcc also optimizes the addressing to in/out wherever possible
[12:13:26] <majkrzak> ye i know, but it is easy to mitype it :)
[12:14:46] <Jartza> sure. in and out are just faster too :)
[12:14:57] <Jartza> ahh well, not really
[12:15:09] <majkrzak> 1 clock :)
[12:15:18] <Jartza> yeah, remembered wrong the st
[12:15:34] <Jartza> it's only 2 clocks when incrementing/decrementing
[12:17:29] <studdentt> does a EEPROM memory cell is empty at first ?
[12:17:51] <Jartza> $ ./gavrasm
[12:17:51] <Jartza> +------------------------------------------------------------+
[12:17:53] <Jartza> | gavrasm gerd's AVR assembler Version 3.5 (C)2015 by DG4FAC |
[12:17:54] <Jartza> hmm
[12:17:58] <Jartza> seems it compiled on osx too
[12:18:15] <Jartza> studdentt: what does that question mean?
[12:18:30] <Jartza> EEPROM is 0xFF when "empty"
[12:18:32] <Jartza> so all bits are 1
[12:18:41] <Jartza> and when written to, bits are zeroed
[12:18:41] <studdentt> Jartza: what is the initial value of a byte
[12:18:44] <studdentt> yes
[12:18:45] <Jartza> 0xFF
[12:20:06] <Jartza> gavrasm seems to be newer than avra, not sure if it's better though
[12:20:10] <Jartza> but I need to test it out
[12:20:45] <majkrzak> with gavr you dont need to include defs, but if you didnt do it it will fail :)
[12:23:28] <majkrzak> oh you may use .DEVICE Atmega328P
[12:24:46] <Jartza> yes
[12:32:14] <Jartza> d'oh
[12:32:20] <Jartza> seems gavrasm has some limitations
[12:32:28] <Jartza> like, you can only increase .org
[12:32:34] <Jartza> and not define it freely
[12:33:11] <majkrzak> you cant made .dseg .cseg .desg to
[12:33:22] <Jartza> [vga.asm,140] 046: Origin adress (0) points backwards in code segment!
[12:33:37] <Jartza> :(
[12:33:43] <Jartza> works with avra (and atmel studio assembler)
[12:34:52] <majkrzak> is there a trick to load .dseg label into X?
[12:35:40] <Jartza> trick?
[12:35:48] <Jartza> in avra I use something like:
[12:35:51] <Jartza> .desg
[12:35:58] <Jartza> .org 0xBEEF
[12:36:08] <Jartza> stuff:
[12:36:15] <Jartza> .byte 128
[12:36:18] <Jartza> for example
[12:36:20] <Jartza> and then
[12:36:42] <Jartza> ldi XL, low(stuff)
[12:36:47] <Jartza> ldi XH, high(stuff)
[12:36:58] <Jartza> which loads the address of "stuff" label to X
[12:37:03] <majkrzak> di XH, (ret&0xFF00 >> 8)
[12:37:04] <Jartza> if that's what you mean
[12:37:14] <majkrzak> high is the trick :)
[12:37:28] <Jartza> ahh
[12:37:28] <Jartza> :)
[12:40:50] <Jartza> hmmh
[12:41:01] <Jartza> there's no way to define constants from command-line in gavrasm?
[12:41:17] <Jartza> then that's no-go :(
[12:43:06] <majkrzak> I will swich to avra soon
[12:43:07] <majkrzak> :)
[12:44:37] <Jartza> I think I'll stay with avra :)
[12:45:04] <Jartza> even though it haven't been updated in 5+ years, it's just working
[12:45:15] <Jartza> and it's pretty much compatible with atmel studio
[15:52:43] <Jartza> https://www.youtube.com/watch?v=936m7FMS__c
[15:52:50] <Jartza> now I'm quite pleased with the horizontal scroll :)
[16:39:34] <inkjetunito> Jartza: can you do a vertical star wars?
[16:41:54] <Jartza> heh
[16:41:55] <Jartza> dunno
[16:41:56] <Jartza> https://www.youtube.com/watch?v=quK-EqpaSlw
[16:41:58] <Jartza> I can do this
[16:42:37] <studdentt> one of you made the peter fleury i2c library to work with a ds1307 ?
[16:43:07] <studdentt> i made it works with a 24LC256 but breaks with the RTC
[16:49:51] <Jartza> https://www.youtube.com/watch?v=YL0RwEtTN70
[16:53:28] <inkjetunito> i want cool 16x2 lc-displays, too :(
[17:04:27] <Jartza> oh
[17:05:50] <Jartza> 16x2 are fun :)
[17:06:22] <Jartza> https://www.youtube.com/watch?v=Zm0mlU8fmQY
[17:06:32] <Jartza> that's very nice display
[17:07:26] <inkjetunito> oh, indeed. are you manipulating the character set or are the pixels individually controllable?
[17:07:43] <Jartza> character set
[17:07:55] <Jartza> all of those 8 custom characters that can be displayed at once
[17:08:21] <Jartza> that's my electronic namebadge
[17:08:45] <Jartza> texts can be updated via audio - from phone, tablet, laptop, pc... whatever that plays mp3 and has headphone port :)
[17:08:51] <Jartza> http://tagsu.io/
[17:23:39] <learath> https://pbs.twimg.com/media/CXef-yGWQAA5uKd.png:large I wonder how true this chart is.
[17:23:45] <learath> shit. wrong channel, I apologize.
[17:24:04] <Lambda_Aurigae> USA isn't on there!
[17:24:18] <Lambda_Aurigae> we are the least trustworthy, least compassionate, and most arrogant!
[17:24:23] <Lambda_Aurigae> we should be on there!
[17:24:38] <Lambda_Aurigae> even if we aren't part of the EU.
[17:24:46] <Lambda_Aurigae> we are arrogant enough to be on the list dangit!
[17:24:53] <Jartza> heh
[17:25:00] <Jartza> Lambda_Aurigae: did you see the latest vid?
[17:25:03] <Jartza> or, vids
[17:25:13] <Lambda_Aurigae> just the tagsu vid you posted a while ago.
[17:25:33] <Jartza> https://www.youtube.com/watch?v=936m7FMS__c
[17:25:39] <Jartza> https://www.youtube.com/watch?v=YL0RwEtTN70
[17:25:40] <Jartza> :)
[17:25:54] <Jartza> used SPL and SPH as extra variables, now the scroll is quite nice
[17:25:55] <Krampus> Jartza: That 16x2 one is rad!
[17:26:12] <Jartza> Krampus: some people think so, yes :D
[17:26:18] <Krampus> Jartza: is that one yours?
[17:26:19] <Jartza> been selling >300 of those
[17:26:23] <Jartza> Tagsus, I mean
[17:26:32] <Jartza> yeah, I made it
[17:26:33] <Lambda_Aurigae> the graphic one is impressive.
[17:27:01] <Krampus> Jartza: Nice! Are you reprogramming the custom characters on the fly for the animations?
[17:27:07] <Jartza> yeah
[17:28:12] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxMGZRWHZXSUxqbmM/view
[17:28:21] <Jartza> a bit old video showing the effects tagsu has
[17:28:42] <Jartza> that's still with the old display, the new display is nicer
[17:28:52] <Krampus> Jartza: Arggggh, and now I want to go stare at the datasheet for the ones I have can let me do similar trickery instead of raking leaves. :P
[17:29:25] <Lambda_Aurigae> Krampus, most 44780 based LCD controllers can do that.
[17:29:38] <Jartza> the new display has less of that "shadowing"
[17:29:44] <Jartza> and much better contrast
[17:29:50] <Lambda_Aurigae> I have 20x4 displays that can do the same effects even.
[17:30:01] <Lambda_Aurigae> along with the programmable characters.
[17:30:14] <Krampus> Lambda_Aurigae: that's the one i was thinking of. :)
[17:30:39] <Lambda_Aurigae> I got 10 or so of them somewhere about 15 years ago.
[17:30:42] <Krampus> Manic Miner!
[17:30:46] <Jartza> :)
[17:30:56] <Krampus> Archon!!
[17:31:09] <Lambda_Aurigae> I've got to get my dev system setup again so I can play.
[17:31:33] <Jartza> Lambda_Aurigae: this VGA is getting to be pretty nice now. can't figure out much more to do :)
[17:31:33] <Lambda_Aurigae> I really really want to make an 800x600 vga mono display with this pic32 chip.
[17:31:52] <Lambda_Aurigae> hehe.
[17:32:00] <Jartza> but do you want to know what is the saddest part?
[17:32:04] <Krampus> Jartza: The old games reference makes me think you might dig my plans for a garage computer. I'm going to use a Commodore 64 running Contiki to control AVRs running home automation / sensors things.
[17:32:11] <Jartza> I think generating vga from this chip isn't that fancy
[17:32:36] <Lambda_Aurigae> run a c-64 emulator on an avr.
[17:32:42] <Lambda_Aurigae> or
[17:32:47] <Lambda_Aurigae> just run contiki straight on an avr.
[17:32:50] <Jartza> the fancy part in this is showing 512 characters on screen with 512 bytes of memory, sampling uart without hw-uart and parsing ansi-escapes and other escape-codes simultaneously while generating vga :)
[17:33:09] <Krampus> VGA was surprisingly easy to generate.
[17:33:11] <Lambda_Aurigae> Jartza, agreed...you have pushed that chip to the limits in my opinion.
[17:33:27] <Krampus> Lambda_Aurigae: All the AVRs are running it, but they have a 6502 port.
[17:33:31] <Lambda_Aurigae> vga is easy to generate...getting it stable and usable is another step.
[17:33:45] <Lambda_Aurigae> getting it nice and nifty and usable is a big step.
[17:33:45] <Jartza> and the split-screen is nice feature too
[17:34:23] <Lambda_Aurigae> Jartza, yeah...could do bargraphs on the top and text on the bottom for a measuring thingie
[17:34:31] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxbXlTZUN5QUgzYzQ/view
[17:34:42] <Jartza> or text-adventure with pics ;)
[17:34:45] <Krampus> Lambda_Aurigae: It's actually going to be C64 <-[TBD]-> ARM single-board -> HDMI. So, the commodore will provide the interface but there will be a modern computer hiding to do modern things like google music or pulling up the video feeds and overlaying them.
[17:35:05] <Lambda_Aurigae> waste of a good C64.
[17:35:12] <Lambda_Aurigae> but, to each their own.
[17:35:23] <Lambda_Aurigae> I use mine for playing games still.
[17:35:29] <Lambda_Aurigae> connected to the projector.
[17:35:47] <Lambda_Aurigae> currently set to a 12 foot diagonal projection area on my living room wall.
[17:36:12] <Krampus> Lambda_Aurigae: Why a waste? It's sitting in the cupboard gathering dust. This way, it's visible and I might be motivated to get a C64 Reloaded board for it.
[17:36:39] <Lambda_Aurigae> and my pc runs some software to emulate a floppy drive on the c64 or c128 or vic-20.
[17:36:42] <Krampus> Lambda_Aurigae: Oh, there will totally be a cartridge slot and floppy disk drive. It'll just by default fire up the automation interface.
[17:37:14] <Lambda_Aurigae> thinking I'm gonna sell all my spare c64 units though.
[17:37:17] <Lambda_Aurigae> will keep one.
[17:37:22] <Lambda_Aurigae> and one vic-20 and one c-128
[17:38:12] <Jartza> I only have one c64 but it has broken sid :(
[17:38:18] <Krampus> That's what I did. I had a C64 in the original box with most everything it came with, several disk drives and odd peripherals, a couple amigas, a c64s and 128, and a couple others.
[17:39:25] <Jartza> https://github.com/Jartza/octapentaveega
[17:39:28] <Krampus> Consolidated it down to the best looking kit, put the rest up for sale and the kid that was interested didn't have anywhere close to what I was asking for any of it. Ended up giving the lot to him because it was clearly a good home.
[17:39:33] <Jartza> added links to videos and pics there
[17:39:46] <Lambda_Aurigae> Jartza, kewl.
[17:39:57] <Lambda_Aurigae> Krampus, I'll ebay it...might ebay the lot in one sale.
[17:40:56] <Lambda_Aurigae> might get 300 or 400 dollars for the lot from the looks of it.
[17:41:43] <Lambda_Aurigae> might get rid of all the c-64 and c-128 stuff and just keep the vic-20
[17:43:21] <Krampus> Jartza: you're insane! :) Alright, tagging your github repo to check out after I finish chores.
[17:43:35] <Jartza> I agree
[17:43:49] <Jartza> only insane would try to create _usable_ VGA out from attiny85 :D
[17:45:03] <Krampus> Jartza: I did something similar with an FPGA for a class project. Didn't have any trouble with the timings, but I foolishly didn't consider quite how many bits are in an image of any appreciable size. :)
[17:46:41] <Lambda_Aurigae> Krampus, I'm looking at 800x600 monochrome on a pic32 with 64K of sram and that's sucking 60K of it.
[17:47:09] <Krampus> It was an SSTV codec. Didn't have enough ram to handle more than a 32x32 or 64x64 monochrome (I forget which).
[17:48:41] <Krampus> Lambda_Aurigae: extend Jartza's technique with an array of pic32's feeding tiny85's to make a graphics card that fell out of the crappier timeline!
[17:48:44] <Jartza> I have 512 bytes of ram
[17:49:20] <Lambda_Aurigae> I could do 400*300 resolution on an 800x600 output with 4 bit color with the same memory.
[17:49:23] <Krampus> Jartza: how many bytes are used for the display?
[17:49:29] <Lambda_Aurigae> Krampus, don't need the tiny85 chips though.
[17:49:37] <Jartza> I use all of it for screen buffer (32*16 characters = 512)
[17:49:58] <Jartza> and you get b/w with single tiny
[17:50:41] <Krampus> Jartza: what does the display program use for variable storage?
[17:50:51] <Jartza> processor registers
[17:50:51] <genner> Hai
[17:51:02] <Lambda_Aurigae> not sure I could drive it out fast enough though....if this chip had an SQI interface I could.
[17:51:17] <Lambda_Aurigae> hello genner
[17:51:21] <genner> :-)
[17:52:20] <Krampus> Jartza: nice.
[17:54:49] <Jartza> everything is basically handled during horizontal blanking because I have no buffer for uart
[17:55:11] <genner> Im trying to use the ADC3 channel (Free Running Mode) on ATtiny13 but I got a lot of trouble :/ I read the ADC Chapter in the Datasheet but there is still a Problem. Can someone maybe help me? :)
[17:56:04] <Jartza> what's the problem?
[17:56:29] <genner> I dont know. There is no way to debug it. But here is the code: http://pastebin.com/XLK7HvdC
[17:56:40] <genner> For some reason the ISR didnt start
[17:57:21] <genner> (after ADIE, ADIF ... ADEN and the "start conversion).
[17:57:45] <Jartza> well, how do you know, if there is no way to debug it? :)
[17:58:06] <Jartza> I mean, how and why you know it doesn't work
[17:58:17] <genner> hm, i have a 5k potentiometer on the PB3 and a LED on an other Pin.
[17:58:35] <genner> *10k
[17:59:31] <Jartza> well, that's already a way to debug, isn't it? ;)
[17:59:50] <Jartza> input and output
[18:00:08] <genner> very antique.
[18:00:26] <genner> but i dont have the hardware to implement UART.
[18:00:59] <Jartza> nothing wrong with pot and led
[18:01:25] <Jartza> first of all
[18:01:28] <Jartza> you don't enable interruptes
[18:01:42] <Jartza> you need to call sei(); after setting the conversion
[18:01:52] <genner> Pretty sure. The LED is actually on. I "Control" her over PWM: OCR0B = 255 - ADC_value;
[18:02:14] <genner> Jartza, the sei(); in in the main a line after "setup()"
[18:02:47] <Jartza> oh, you didn't paste the whole code :)
[18:03:01] <genner> i wont spam you :)
[18:03:23] <Jartza> well, pastie.org can eat a lot of code :)
[18:04:32] <genner> http://pastebin.com/yk9qUbzM :-)
[18:09:51] <Jartza> fetching datasheet
[18:10:41] <genner> http://www.atmel.com/images/doc2535.pdf :-)
[18:11:18] <genner> At Chapter 14
[18:16:06] <Jartza> oh
[18:16:35] <Jartza> checked the disassembly
[18:16:41] <Jartza> your main runs to the end
[18:16:48] <Jartza> which then jumps into _exit
[18:16:56] <Jartza> and _exit contains one asm instruction, cli :)
[18:17:09] <Jartza> how about adding while(1); to the end of main?
[18:17:10] <Jartza> try it
[18:17:21] <genner> wait. I have to use a while(1); even when i use ISRs?
[18:17:34] <genner> and how do u get the disassamblys?
[18:17:49] <Lambda_Aurigae> the chip has to have something to do between interrupts.
[18:17:51] <Jartza> yes, because otherwise your main() will exit, and the exit-code generated by gcc contains "cli" which disables interrupts
[18:18:03] <Lambda_Aurigae> if you don't do a while(1); then it just keeps going till it hits the end of the memory and basically resets.
[18:18:10] <Jartza> 000000f2 <_exit>: f2: f8 94 cli
[18:18:10] <Jartza> 000000f4 <__stop_program>: f4: ff cf rjmp .-2 ; 0xf4 <__stop_program>
[18:18:20] <Jartza> that's what your code does after exiting from main
[18:18:30] <Jartza> the "__stop_program" actually is just busy-loop
[18:18:33] <Jartza> but the _exit is bad
[18:18:55] <Jartza> because of cli
[18:19:07] <genner> hmm okay. I change it but there is still the same problem.
[18:19:44] <genner> btw. is it allowed to connect the PB3 pin without an resistor to GND and VCC?
[18:20:00] <Lambda_Aurigae> yes
[18:20:32] <Lambda_Aurigae> best to connect it to one with a 10K ohm resistor then use a button to connect to the other.
[18:20:39] <Lambda_Aurigae> that way it never floats.
[18:21:10] <genner> hmm, i have the "sides" of the potentiometer on Vcc and GND.
[18:21:42] <Lambda_Aurigae> ok.
[18:21:49] <Lambda_Aurigae> what is the value of the pot?
[18:21:55] <genner> 10 kOhm
[18:22:21] <Lambda_Aurigae> ok
[18:26:13] <Jartza> I don't quite get what you're trying to achieve with your calculations of the ADC, though :)
[18:27:24] <Jartza> also in pwm_write() you use int as argument
[18:27:30] <Lambda_Aurigae> and setting interrupts before setting up the ADC?
[18:27:31] <Jartza> for 8-bit register
[18:27:39] <Lambda_Aurigae> I would do the setup first then turn interrupts on.
[18:27:42] <Jartza> me too
[18:27:56] <Jartza> and for just simple test, I would only use the high 8 bits of the adc
[18:28:35] <Jartza> setting the ADLAR = 1 in ADMUX
[18:28:46] <Jartza> and only reading ADCH
[18:28:52] <genner> hm okay
[18:30:09] <Jartza> http://pastebin.com/KH6NCLRZ
[18:30:10] <Jartza> like this
[18:30:17] <Jartza> just for testing
[18:33:44] <genner> Yea. The changes work :)
[18:33:54] <genner> yippie. Thank you very much.
[18:33:58] <Jartza> :)
[18:34:16] <Lambda_Aurigae> break your problem down to smaller chunks.
[18:34:19] <Jartza> also just to be sure, I would also set the ADC pin as input and disable the digital io (DIDR)
[18:34:47] <Jartza> yeah, and check what the ADLAR does
[18:35:22] <Jartza> it was actually nice to know that you can just read "ADC" in attiny too and gcc makes code to read ADCH and ADCL in correct order :)
[18:35:32] <Jartza> I didn't know that, I've always read them separately manually
[18:36:01] <genner> OCR0B is 8 bit right?
[18:36:26] <Jartza> all attiny IO-registers are
[18:36:29] <Jartza> even ADC ;)
[18:36:39] <Jartza> it's just ADCH and ADCL (high and low byte)
[18:37:16] <Jartza> so yeah, instead of void pwm_write(int value) you'd be better off with "void pwm_write(uint8_t value)"
[18:37:44] <Jartza> just remember to #include <stdint.h>
[18:37:53] <genner> yea. But there is a strange behavior.
[18:38:49] <genner> With OCR0B = 255 - value; i want the LED to burn full when the potentiometer is on the one end and led = off when the Poti is on the other end.
[18:39:57] <Jartza> so what is the strange behavior
[18:40:04] <genner> But actually the LED goes up and down in between. 0 Ohm - L -> H -> L -> H -> L -> H - 10 kOhm
[18:40:19] <genner> instead of 0 Ohm - L -> H - 10 kOhm
[18:41:19] <genner> hard to explain.
[18:41:48] <genner> The LED is Off at ~6k Ohm and On at ~7 kOhm
[18:43:50] <genner> same with 1k Ohm Resistor. ill look tomorrow.
[18:43:58] <genner> Thank you for your help :)
[18:45:19] <Jartza> hmm
[18:45:20] <Jartza> http://pastebin.com/PuBJBH57
[18:45:27] <Jartza> try this, even simpler version?
[18:50:25] <tchebb> pavuc
[18:50:27] <genner> hmm why not :)
[18:50:35] <tchebb> whoops, disregard
[18:55:24] <Jartza> genner: http://pastebin.com/G9RyhUsG
[18:55:28] <Jartza> check lines 46-47
[18:56:33] <genner> Oh, i didnt know the DIDR0. I have to google it.
[18:57:41] <Jartza> it disables the digital input on that pin
[18:57:50] <Jartza> if you're using it for analog, it saves power
[18:59:25] <genner> alright :)
[19:02:27] <genner> hmm 1:37 am. Ill go sleep now.
[19:02:38] <genner> Thanks again for your help :) Good night.
[19:03:27] <Jartza> heh, 2:38am here :)
[19:03:35] <Jartza> but yea, night!
[19:41:58] <Jartza> lollers :D
[19:42:00] <Jartza> https://www.youtube.com/watch?v=V6x8JxnTN6Y
[19:44:46] <Lambda_Aurigae> where's mario?
[19:48:11] <Jartza> I don't know
[19:48:17] <Jartza> he's lost I guess :D
[19:49:01] <Lambda_Aurigae> is that all sent over the uart?
[19:50:03] <Lambda_Aurigae> too bad you can't put that onchip.
[19:51:04] <Jartza> yes, all sent over uart
[19:51:27] <Jartza> well, I could've made all kind of sprites'n'stuff in the flash, but...
[19:51:32] <Jartza> that's not what this is really meant for
[19:51:37] <Jartza> I was just fooling around with this
[19:51:47] <Lambda_Aurigae> use another AVR to play game controller.
[19:52:35] <Jartza> this might not be very good for games, though
[19:52:42] <Lambda_Aurigae> hehe.
[19:52:43] <Jartza> quite crappy graphics, actually :D
[19:52:59] <Lambda_Aurigae> make a pong game!
[19:53:00] <Jartza> I'm still thinking that the "graphics primitive"-font might be more useful
[19:53:16] <Jartza> dunno
[19:53:22] <Jartza> or maybe I'll just leave this for now
[19:53:35] <Jartza> it's most useful in text-mode anyway
[19:53:47] <Lambda_Aurigae> yupyup.
[20:00:12] <Jartza> I actually ordered one 7" VGA monitor
[20:00:18] <Jartza> going to use this by myself :)
[20:00:54] <Lambda_Aurigae> I have a stack of monochrome displays with resistive touchscreens on them.
[20:01:01] <Lambda_Aurigae> but I don't have a pinout for them.
[20:01:07] <Lambda_Aurigae> they are sharp LCD displays.
[20:01:11] <Jartza> cool
[20:01:15] <Lambda_Aurigae> made for sharp copiers.
[20:01:25] <Lambda_Aurigae> I think they are LVDS driven but not sure.
[20:02:13] <Jartza> ohh. lvds from attiny85? :D
[20:02:59] <Lambda_Aurigae> sure!
[20:03:07] <Lambda_Aurigae> if I could find a pinout it would be bestest.
[20:04:06] <Jartza> I was actually thinking something different
[20:04:27] <Jartza> I would love to have 80x25 characters
[20:04:33] <Jartza> don't care that much about graphics
[20:04:52] <Lambda_Aurigae> you need 2K sram.
[20:04:56] <Jartza> yes
[20:05:03] <Jartza> not on attiny, no :)
[20:05:52] <Lambda_Aurigae> you should try for some pic32 samples.
[20:06:32] <Lambda_Aurigae> I started coding tonight for 800x600 on my pic32 chips.
[20:06:42] <Lambda_Aurigae> and hoping to have USB comms.
[20:07:00] <Jartza> or maybe atmega328p :P
[20:07:17] <Lambda_Aurigae> that works too for your text only version.
[20:09:48] <Jartza> or even ATMEGA1284
[20:10:06] <Jartza> that's available as dip :)
[20:10:12] <Lambda_Aurigae> atmega1284p rocks...16K sram in dip.
[20:11:08] <Jartza> lemme check the specs
[20:11:34] <Lambda_Aurigae> 20MHz, 128K flash, 16K sram, 40pin dip available
[20:11:42] <Lambda_Aurigae> spi, twi, usart
[20:11:56] <Lambda_Aurigae> full ADC
[20:12:02] <Lambda_Aurigae> touch sensor capable.
[20:12:11] <Jartza> hmm
[20:12:19] <Lambda_Aurigae> I've run them at 32MHz without any problems other than ADC crapping out.
[20:13:04] <Jartza> many full ports?
[20:13:14] <Jartza> "full ports", I mean, port with 8 gpio :)
[20:13:48] <Lambda_Aurigae> 4 of them
[20:13:54] <Lambda_Aurigae> 32 i/o pins.
[20:13:55] <Jartza> cool
[20:14:08] <Jartza> because I was thinking about something different
[20:14:16] <Lambda_Aurigae> pin change interrupts on all pins.
[20:14:22] <Jartza> I would need at least 480 horizontal pixels
[20:14:25] <Lambda_Aurigae> 2 regular interrupt pins.
[20:14:28] <Jartza> for 6x?? font
[20:15:13] <Lambda_Aurigae> monochrome, 19K of sram.
[20:15:19] <Lambda_Aurigae> 320x480
[20:16:44] <Jartza> 480x200 would need 12kB, as graphics
[20:17:03] <Jartza> just driving those 480 pixels out would be a challenge
[20:17:19] <studdentt> someone did tests with ds1307? theres a huge error over 2 minutes on my uC
[20:17:54] <Lambda_Aurigae> studdentt, I'm sure someone has, yes.
[20:18:30] <Lambda_Aurigae> Jartza, oh..you said horizontal...duh.
[20:18:37] <studdentt> Lambda_Aurigae: he will answer then..
[20:22:25] <Lambda_Aurigae> Jartza, you thinking of doing 80x25 text only?
[20:22:29] <Jartza> yes
[20:22:32] <Jartza> maybe
[20:23:58] <Jartza> oh
[20:24:02] <Jartza> atmega32u4 would do too
[20:24:14] <Lambda_Aurigae> with lots of ram you could do nifty scrolling effects and multiple frame buffers.
[20:24:33] <Jartza> but why it's more expensive than atxmega32u4?
[20:24:39] <Jartza> sorry, atxmega32a4u
[20:24:40] <Lambda_Aurigae> hehe.
[20:24:46] <Lambda_Aurigae> yeah, it's an expensive chip.
[20:24:51] <Lambda_Aurigae> must be the extensive sram.
[20:25:08] <Jartza> atmega32u4 has 2.5kB
[20:25:15] <Jartza> atxmega32a4u has 4kB
[20:25:51] <Jartza> xmega also has 2spi + 5usart (usable as spi), 2 i2c, aes/des, 4 channel dma-engine, fullspeed usb....
[20:25:52] <Lambda_Aurigae> neither of which are available in dip.
[20:26:27] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxdmJXV1NkaXU4RlE/view?usp=sharing
[20:26:28] <Jartza> :P
[20:26:46] <Jartza> though I only seem to have 20Mhz crystals, I still tried one
[20:26:51] <Lambda_Aurigae> pic32mx270f256b has 64k sram, uart, dma, i2c, fullspeed usb, dip package.
[20:27:02] <studdentt> hmmm
[20:27:08] <Lambda_Aurigae> 8mhz crystal will run it up to 50MHz internal with pll.
[20:27:12] <Jartza> that crystal is only connected to pins on that breakout, so it's not _must_ to use that, I can use 32MHz oscillator
[20:27:15] <studdentt> how much does it cost the PIC ?
[20:27:57] <Lambda_Aurigae> $4.32
[20:28:00] <Lambda_Aurigae> from digikey.
[20:29:55] <studdentt> cheap
[20:30:09] <Lambda_Aurigae> yup.
[20:30:16] <Lambda_Aurigae> for a 32bit 50MHz processor, yeah.
[20:31:48] <studdentt> and you save space on the rs-232 conversion by doing it in the uC!
[20:31:48] <Jartza> yeah. I think that xmega is about the same price
[20:32:42] <Jartza> anyhow, I already have those xmegas :)
[20:32:47] <Lambda_Aurigae> kewl.
[20:33:15] <Jartza> and my idea was to make it a bit differently
[20:33:30] <Jartza> instead of trying to draw each pixel myself, just use some 74hc -logic
[20:33:40] <Jartza> 3 * 74hc165
[20:33:42] <Jartza> :P
[20:34:22] <Lambda_Aurigae> if you are going to go that route, how about a high speed serial sram?
[20:34:48] <Jartza> that was another option
[20:35:03] <Lambda_Aurigae> specially the ones with sqi capability.
[20:36:10] <Jartza> though 74hc165 chips cost about nothing
[20:36:32] <Jartza> something like ten bucks per hundred or so :)
[20:37:53] <Lambda_Aurigae> 23a1024 in dip is $2.05 each
[20:38:02] <Lambda_Aurigae> yeah.
[20:38:05] <Lambda_Aurigae> real cheap.
[20:41:12] <Jartza> oh
[20:41:32] <Jartza> cool
[20:41:50] <Jartza> I haven't figured out what this sqi is
[20:41:53] <Jartza> I need to check it out
[20:41:58] <Lambda_Aurigae> it's like spi
[20:42:04] <Lambda_Aurigae> only 4 i/o pins at a time.
[20:42:08] <Lambda_Aurigae> 4 data pins.
[20:42:13] <Jartza> oh
[20:42:15] <Lambda_Aurigae> otherwise, it's just like spi.
[20:42:21] <Jartza> neato
[20:42:33] <Lambda_Aurigae> so you can clock out 4 bits at a time at 20MHz on that chip.
[20:42:49] <Lambda_Aurigae> actually faster, but it's rated at 20MHz.
[20:43:14] <Lambda_Aurigae> http://dangerousprototypes.com/docs/Logic_Pirate#Schematic
[20:43:16] <Jartza> does 20MHz mean 10Mbit * 4 output?
[20:43:21] <Jartza> or 20Mbit * 4 output?
[20:43:22] <Lambda_Aurigae> that uses those.
[20:43:28] <Lambda_Aurigae> 20Mb/s * 4 bits
[20:43:44] <Lambda_Aurigae> so, 10Mb/s overall
[20:43:51] <Lambda_Aurigae> err.
[20:43:56] <Lambda_Aurigae> duh!
[20:44:05] <Lambda_Aurigae> 80Mb/s
[20:44:12] <Jartza> mmkay
[20:44:22] <Jartza> so, just attiny85 and one of those
[20:44:23] <Jartza> :D
[20:44:31] <Lambda_Aurigae> the chip can run spi, sdi, or sqi...
[20:44:36] <Lambda_Aurigae> 1, 2, or 4 bits at a time.
[20:44:52] <Lambda_Aurigae> yeah...your attiny85 could do full color with one external chip.
[20:45:26] <Jartza> whoa :)
[20:45:55] <Lambda_Aurigae> 1Mbit chip.
[20:46:18] <Lambda_Aurigae> 16 color even!
[20:46:34] <Jartza> 23LC512 seems to be 1.63€
[20:51:08] <Lambda_Aurigae> yup.
[20:51:19] <Lambda_Aurigae> they go down to 256 and 64 kbits too.
[20:53:31] <Jartza> maybe I need to order few of those just to play out with the
[20:53:34] <Jartza> them
[20:54:09] <Jartza> there seems to be breadboard-friendly dip-versions too
[20:54:15] <Lambda_Aurigae> yup.
[20:54:18] <Lambda_Aurigae> have a pile of them.
[20:55:12] <Lambda_Aurigae> microchip does sample them too.
[20:55:42] <Jartza> hmm
[20:56:26] <Jartza> just thinking about, if data is fed into that chip correctly, then all I need to do is issue a read command for quad output and I could get R+G+B + additional brightness? :)
[20:56:38] <Lambda_Aurigae> yup.
[20:56:40] <Lambda_Aurigae> RGBI
[20:56:49] <Lambda_Aurigae> 16 color
[20:56:50] <Jartza> just wire them directly to RGB
[20:56:55] <Lambda_Aurigae> yup.
[20:57:08] <Lambda_Aurigae> maybe through a buffer to flip on and off.
[20:57:16] <Jartza> well, that I needs to be wired differently but anyhow
[20:57:17] <Lambda_Aurigae> two buffers...one for write in, one for readout.
[20:57:39] <Lambda_Aurigae> but it can be done without the buffers.
[20:58:07] <Lambda_Aurigae> could use i/o 0 for writing data to the chip.
[20:58:13] <Jartza> and I can get 20MHz clock out from attiny easily, although I can't send data (or read to attiny) with that speed
[20:58:13] <Lambda_Aurigae> and 1,2,3 for reading out.
[20:58:24] <Lambda_Aurigae> no buffer needed.
[20:58:27] <Jartza> yea
[20:58:32] <Jartza> that's another option I thought
[20:58:36] <Lambda_Aurigae> write during the vertical blanking time.
[20:58:43] <Jartza> so 1,2,3 not connected to attiny at all
[20:58:47] <Lambda_Aurigae> correct.
[20:59:05] <Jartza> only 0 when writing/reading, with slower speed (maybe yeah, during vblank)
[20:59:06] <Lambda_Aurigae> as the attiny can only talk spi anyhow.
[20:59:17] <Jartza> and not even spi :)
[20:59:19] <Jartza> again, USI
[20:59:25] <Lambda_Aurigae> spi with USI
[20:59:37] <Jartza> yes. max send speed CLK/2 and max receive speed CLK/4
[20:59:50] <Jartza> but I think it's ok
[21:00:30] <Lambda_Aurigae> now...consider this.
[21:00:35] <Lambda_Aurigae> use 2 serial sram chips.
[21:00:45] <Lambda_Aurigae> write image to one while the other is being used to display.
[21:00:55] <Jartza> :)
[21:01:01] <Lambda_Aurigae> then switch over and write same image to second.
[21:01:06] <Lambda_Aurigae> pseudo-double buffering
[21:01:10] <Jartza> indeed
[21:01:12] <Jartza> just flip cs
[21:01:22] <Lambda_Aurigae> so you get smooth frames.
[21:04:19] <Jartza> yea
[21:04:23] <Jartza> need to order few of those
[21:04:31] <Jartza> just to test it out, if not for vga but something else
[21:04:31] <Lambda_Aurigae> fun little toys.
[21:04:46] <Jartza> 1-bit audio :)
[21:04:54] <Lambda_Aurigae> did you look at that logic pirate schematic?
[21:05:03] <Jartza> not yet
[21:05:21] <Lambda_Aurigae> they use 2 of those chips to do logic data capture 8bits at a time.
[21:05:31] <Lambda_Aurigae> and they overclock the things.
[21:05:53] <Jartza> looking at it now
[21:05:57] <Jartza> ah.. just 2 chips and buffer
[21:06:30] <Jartza> oh, no buffer, latch
[21:06:30] <Lambda_Aurigae> the predecessor was the logic shrimp
[21:06:50] <Lambda_Aurigae> it used 8 chips...before they were SQI capable
[21:07:09] <Lambda_Aurigae> and it was capable of doing logic output as well.
[21:07:27] <Jartza> cool
[21:07:50] <Lambda_Aurigae> not sure if the logic pirate does though.
[21:08:18] <Lambda_Aurigae> ok...heading for beddyby.
[21:08:41] <Jartza> I should have done that like 4 hours ago
[21:08:50] <Jartza> so yea. night!
[21:18:24] <Casper> hmmm I need to do some xor to test something under linux...
[21:18:39] <Casper> what is a good tool to do it easilly on like 16 values at once?
[21:28:31] <Jartza> python
[21:29:54] <Jartza> [x ^ 42 for x in [10, 20, 30, 40, 50, 60]]
[21:30:08] <Jartza> that would xor numbers 10, 20, 30... with value 42
[21:30:36] <Jartza> >>> [x ^ 42 for x in [10, 20, 30, 40, 50, 60]]
[21:30:36] <Jartza> [32, 62, 52, 2, 24, 22]