#avr | Logs for 2015-08-12

Back
[01:30:14] <Haohmaru> an xmega timer of type 0 can be split into two 8bit timers of type 2, okay.. thing is.. in avr/io.h i got TCC0 (timer of type 0 of port C) but i don't seem to have TCC2.. i also got TCD0, but no TCD2..
[01:30:16] <Haohmaru> halp
[01:33:19] <Haohmaru> ehm.. in io.h there are structures for TC0_t and TC1_t.. but no actual structure for type 2
[01:33:39] <Haohmaru> that's in avrgcc
[04:49:26] <Haohmaru> what's a good thing to do with unused pins on an xmega?
[04:49:47] <Haohmaru> set them as output?
[04:55:09] <Mr_Sheesh> or pull down or up with a 10k or so resistor is another option
[04:58:11] <Haohmaru> btw.. i'm not concerned about power consumation
[04:58:17] <Haohmaru> want to be on the safe side
[04:59:36] <Haohmaru> "Wired-OR" with internal pull-down resistor enabled?
[04:59:54] <Haohmaru> ..and direction set as output?
[05:03:25] <Mr_Sheesh> If you set as output don't worry about pulldown, don't think it's activated in output mode, and isn't needed
[05:04:48] <Mr_Sheesh> so long as they aren't in input with nothing to pull them high or low, that can be bad on some cmos parts, not sure on avrs atm but check it :)
[05:05:19] <Mr_Sheesh> 2:40am and brain is not at 100%, prolly should sleep
[05:13:05] <Haohmaru> so the pull resistor is not needed if it's set to output
[05:13:40] <Haohmaru> what about the digital input buffer thing? i read somewhere that it should be disabled
[08:57:07] <vsync_> yo, software nerds
[08:57:37] <vsync_> is there any motherfucking possibility of formatting an sd card for exfat TFAT outside win ce?
[09:43:24] <Lambda_Aurigae> vsync_, there appears to be an exfat filesystem set for linux. I'm guessing you could format with that.
[09:44:23] <Lambda_Aurigae> http://unix.stackexchange.com/questions/61209/create-and-format-exfat-partition-from-linux
[09:45:20] <Lambda_Aurigae> not sure what more is needed for tfat but there looks to be some stuff about it on google.
[10:11:01] <vsync_> the whole idea is that it has to be tfat
[10:11:12] <vsync_> it's no problem formatting an exfat...
[10:11:32] <vsync_> but i need to add the tfat to it
[10:11:45] <vsync_> and... tfat seems to be win ce restricted... read: ce
[10:12:05] <vsync_> and at no point did i mention linux.
[10:14:08] <vsync_> and "looks to be some info about it on google" = i just hit it on google and checked, works.
[10:14:39] <vsync_> i.e. at least 100 pages
[11:33:40] <anasver> Hi there, currently I'm trying to run an ATmega88 with a 2.4576MHz Crystal at 3.3V so far I've tried various fuse settings (flashed at 5V). If I try to talk to the chip via ISP at 3.3V avrdude will throw errors stating that the device signature was not as expected. What am I doing wrong? According to the datasheet the chip should be fine with this speed and voltage combination.
[15:57:57] <snax> I like the containers that are in Qt!! Has anyone compiled Qt libraries for AVR?
[16:01:18] <ali1234> i doubt it
[16:01:28] <ali1234> unless you're talking about a different Qt
[16:01:38] <snax> Nokia's Qt lol
[16:01:46] <ali1234> yeah that's what i thought
[16:02:17] <snax> what about STL. Has anyone here successfully linked some cut down version of STL ?
[16:02:30] <ali1234> that's a lot less unreasonable... i was just googling that actually
[16:02:42] <ali1234> http://andybrown.me.uk/wk/2011/01/15/the-standard-template-library-stl-for-avr-with-c-streams/
[16:03:11] <snax> Yeah I couldn't get that to work.
[16:03:43] <ali1234> i don't know of anything beyond what google is telling me
[16:31:20] <Jartza> yay
[16:31:23] <Jartza> vga scrolls nicely
[16:31:29] <Jartza> https://www.dropbox.com/s/yibugjuszpo64vg/1439413348.mp4?dl=0
[16:44:40] <fobboyandy> hey guys i
[16:45:19] <Jartza> hi
[16:46:03] <fobboyandy> i m wondering how to make a usb device using avr microcontroller
[16:47:22] <fobboyandy> i already looked at many websites and many of them show how to make HID device but they provide all the firmware needed to make the device work. i actually wanna know how to write these firmware instead of using other ppls
[16:48:49] <RikusW> Use LUFA for a start
[16:49:03] <RikusW> getting usb fw to work can be _hard_
[16:49:27] <RikusW> fobboyandy: how much do you know about usb enumeration for example ?
[16:49:37] <ali1234> well, getting USB to work can be easy too
[16:49:55] <ali1234> if you only use vendor requests it's very easy
[16:49:55] <RikusW> ali1234: if using a framework yes
[16:50:08] <ali1234> yeah, LUFA is a must assuming your chip has USB
[16:50:33] <RikusW> from scratch it is excruciating, especially if you've never used usb
[16:50:40] <ali1234> indeed
[16:50:49] <fobboyandy> i actually wanna more about writing something like LUFA instead of using other ppls work
[16:51:08] <ali1234> this is required reading: http://www.beyondlogic.org/usbnutshell/usb1.shtml
[16:51:20] <fobboyandy> like how did the creator Dean Camera write it
[16:51:43] <RikusW> fobboyandy: do you have any experience with usb ?
[16:51:54] <fobboyandy> RikusW: i don't know that much about usb still
[16:51:58] <RikusW> plugging stuff in doesn't count ;)
[16:52:16] <RikusW> in that case use LUFA or some framework...
[16:52:24] <ali1234> i made a template for LUFA so I don't have to write all that boilerplate over and over: https://github.com/ali1234/lufa-template
[16:52:46] <ali1234> and here's a project based on it: https://github.com/ali1234/avr-433
[16:52:58] <fobboyandy> before lufa existed how did ppl make usb devices?
[16:53:11] <ali1234> "with great difficulty"
[16:53:29] <RikusW> fobboyandy: if you get even one part of the code wrong the device will not even show up on the PC, or it might simply not work
[16:53:45] <RikusW> and HID needs even more descriptors, and getting those right is tricky
[16:54:10] <ali1234> indeed, if you are trying to implement that stuff from scratch using Linux is practically a requirement otherwise you just won't get any useful debugging messages
[16:54:14] <RikusW> fobboyandy: Atmel does provide some working code
[16:54:27] <fobboyandy> so lets say i wanted to work for a company that makes usb devices wat would they use to make those usb devices?
[16:54:48] <fobboyandy> would they also use open source framework or would they have their own?
[16:55:14] <RikusW> Atmel does provide some microcontrollers with builtin hardware for usb, you still need to do the software stack...
[16:55:27] <RikusW> eg ATmega32u2 or 32u4
[16:55:41] <ali1234> fobboyandy: read "USB in a nutshell" above, it answers all these questions
[16:56:51] <fobboyandy> kk lemme find out more about how usb actually works first
[16:57:06] <RikusW> fobboyandy: what do you intend to do with a custom usb device ?
[16:57:07] <fobboyandy> thanks a lot rikus and alil
[16:57:17] <fobboyandy> umm
[16:57:19] <Jordan_U> fobboyandy: They would use and existing framework. Creating a USB stack from scratch is a *HUGE* task. It would likely take multiple programmers already familiar with writing firmware months to do so, and even then there would still likely be bugs to work out with certain computers having different quirks.
[16:57:30] <fobboyandy> prank my roommates to begin
[16:57:31] <RikusW> _huge_ indeed
[16:57:55] <fobboyandy> i wanted to make a small usb device plug it into the back of their computer and make their mouses and keyboards move
[16:57:57] <ali1234> you don't need to write a full stack to make simple USB devices
[16:58:15] <ali1234> USB micros have most of it in hardware
[16:58:55] <RikusW> fobboyandy: use an AVR supported by LUFA, I'm sure it can do mouse and keyboard stuff
[16:58:56] <Jordan_U> fobboyandy: So you can either spend a few years writing code from scratch for this prank, or you can use an existing framework :)
[16:59:00] <ali1234> you do need to at least understand the full stack though
[16:59:10] <ali1234> LUFA has a mouse and keyboard example
[16:59:49] <fobboyandy> what about VUSB?
[16:59:57] <ali1234> VUSB bitbangs the USB protocol
[16:59:59] <RikusW> also, reading the official usb docs is like learning another language....
[17:00:03] <ali1234> that *is* a full stack
[17:00:19] <ali1234> RikusW: yep that's why i always recommend USB ina nutshell, it's great
[17:00:47] <ali1234> fobboyandy: you should only use VUSB if your chip does not have hardware USB, or you are doing something very weird
[17:00:58] <fobboyandy> so this guy Dean camera who wrote LUFA, how did he learn how to do it? how do u even begin writing something so complicated?
[17:01:04] <RikusW> I've converted the Atmel CDC code to AVR asm, so now I kindof understand the official CDC docs...
[17:01:42] <ali1234> fobboyandy: he read the docs i guess
[17:01:50] <RikusW> fobboyandy: you need a lot of time and motivation
[17:02:12] <RikusW> I guess he got some good books on the subject too
[17:02:18] <ali1234> USB isn't actually as complicated as it looks as a beginner
[17:02:38] <RikusW> the official docs are for reference only, not for learning usb.
[17:02:42] <ali1234> right
[17:03:29] <RikusW> I've found libusb was easier to use than the linux serial port interface (less buggyness)
[17:03:40] <ali1234> heh, yeah i can understand that
[17:03:55] <RikusW> termios sucks bigtime
[17:03:58] <ali1234> serial is less forgiving ... wrong baud? wrong handshake? USB has none of that
[17:04:15] <ali1234> well it does but the developer never sees it
[17:04:17] <RikusW> read timeouts... drove me nuts
[17:04:21] <fobboyandy> i guess i m just really impressed by people who can create something from scratch and wanted to know how they do it
[17:04:49] <ali1234> fobboyandy: there is no substitute for hard work
[17:04:51] <fobboyandy> everytime i wanna make something i always end up using other ppls code but i really have no idea how it works and its kinda frustrating
[17:05:11] <ali1234> nothing wrong with using other's code (assuming it is appropriately licensed)
[17:05:26] <RikusW> fobboyandy: start with something much simpler than usb if you want to do it from scratch
[17:07:26] <ali1234> linux actually has a loopback simulation layer for USB
[17:07:33] <ali1234> you can write USB device emulators in userspace
[17:07:39] <ali1234> it's pretty cool
[17:07:51] <ali1234> sadly it's not included in the ubuntu kernel
[17:07:51] <RikusW> lib name ?
[17:07:52] <fobboyandy> i dont even know what that is
[17:08:14] <fobboyandy> lol i guess ur both right. i gotta start simpler
[17:08:16] <ali1234> RikusW: it's not a lib, it's entirely in kernel
[17:08:17] <RikusW> sounds useful indeed
[17:08:27] <RikusW> ah
[17:08:30] <ali1234> you use gadgetfs for userspace drivers
[17:08:54] <Jordan_U> fobboyandy: SPI is a pretty simple protocol that you can bit bang at yourself for a start.
[17:08:54] <fobboyandy> how did u guys learn so much about these things? what kind of classes did u guys take?
[17:08:57] <ali1234> and there's a special virtual HCD ... which i forgot the name of
[17:08:59] <RikusW> it will certainly simplify things
[17:09:22] <Lambda_Aurigae> fobboyandy, first, we learned the difference between "you" and "u"
[17:09:29] <Lambda_Aurigae> then we read, lots.
[17:09:39] <fobboyandy> lol
[17:09:45] <RikusW> fobboyandy: I read a lot of atmel avr appnotes and datasheets
[17:10:18] <Lambda_Aurigae> unless you are typing on a cellphone 10 digit keypad, using "u" for "you" is just plain tacky and shows serious laziness.
[17:10:30] <RikusW> and before that I already had experience in programming and electronics
[17:10:36] <ali1234> ah dummy_hcd
[17:10:58] <fobboyandy> excuse my lack of formality sorry
[17:11:06] <ali1234> ah someone made a library out of it: https://github.com/ueno/libusb-gadget
[17:11:15] <RikusW> thanks :)
[17:11:38] <ali1234> won't work on ubuntu though... i opened a bug
[17:11:39] <Lambda_Aurigae> In order to learn, one must read. Read datasheets. Read appnotes. Read source code.
[17:11:56] <RikusW> ironically in Afrikaans "u" is actually the more formal form of "you" ;)
[17:12:45] <ali1234> TIL :)
[17:14:11] <ali1234> hmm... it would be super cool to have an avr emulator with gadgetfs support
[17:14:14] <fobboyandy> so let's say this mouse that i'm currently using, some HP mouse
[17:14:20] <ali1234> and it's totally possible
[17:14:56] <fobboyandy> what kind of usb firmware do they use? do they have their own? or do they also use other people's?
[17:15:08] <ali1234> it probably doesn't have any firmware
[17:15:14] <Lambda_Aurigae> probably a usb-hid chip.
[17:15:26] <Lambda_Aurigae> custom chip made for the manufacturer just for that device.
[17:16:24] <fobboyandy> so for microcontrollers they were made to be programmable and THAT's why somebody had to write a library for it to have usb functions?
[17:16:45] <Lambda_Aurigae> yes.
[17:16:57] <fobboyandy> things are starting to make sense
[17:17:08] <Lambda_Aurigae> and, depending on your microcontroller and the hardware on it, you have different usb software.
[17:17:29] <Lambda_Aurigae> most things you would want to do full speed usb with you will need a chip with hardware usb.
[17:17:53] <Lambda_Aurigae> it is possible to bitbang low speed, 1.5Mb/s, USB on an avr running from 12 to 20 MHz with the vusb software.
[17:19:30] <fobboyandy> it's starting to seem like microcontrollers are more for prototyping. if i wanted to mass produce something, it would make more sense to create a chip non programmable and only designed for one function
[17:19:49] <Lambda_Aurigae> all depends.
[17:20:03] <Lambda_Aurigae> I have seen pic, 8052, and avr in various tv remotes.
[17:20:11] <RikusW> making chips is EXPENSIVE
[17:20:23] <Lambda_Aurigae> heck, I've seen 8052 chips in modern copiers within the last 2 years even.
[17:21:07] <RikusW> fobboyandy: the advantage of microcontrollers are that it can be updated to add features or fix bugs
[17:21:39] <ali1234> well another advantage is that making lots of one microcontroller is cheaper than making a custom chip for every device
[17:21:42] <RikusW> if its flash based anyways
[17:23:00] <fobboyandy> i see. this cleared up a lot of questions
[17:24:13] <Lambda_Aurigae> between microcontrollers and FPGAs, you can make a lot of things from a few different parts.
[17:24:22] <Lambda_Aurigae> copiers use FPGAs extensively.
[17:25:58] <fobboyandy> so which is better to use for avr? lufa or vusb? or are they actually different things?
[17:26:27] <ali1234> the simple answer is LUFA is better but it doesn't work on all AVRs
[17:26:32] <Jartza> Lambda_Aurigae: https://www.dropbox.com/s/xbmdlhl93dakqhe/1439414207.mp4?dl=0
[17:26:50] <Lambda_Aurigae> Jartza, saw that..awesome.
[17:27:07] <Jartza> only tiny bits missing from ansisupport ;)
[17:27:14] <Lambda_Aurigae> sweet.
[17:27:19] <Jartza> and then syncing three attinys
[17:27:59] <Jartza> Lambda_Aurigae: https://www.dropbox.com/s/iltp02fh8jeazk4/Screenshot%202015-08-09%2002.56.28.png?dl=0
[17:28:03] <Jartza> planning to support those colors :)
[17:28:12] <Lambda_Aurigae> 3 chip color mode?
[17:28:15] <Jartza> and yea. ansi escapes (or subset)
[17:28:21] <ali1234> i cheated: https://www.youtube.com/watch?v=tUxsKP2ircE
[17:28:23] <Jartza> yeah, 1 chip b/w mode, 3 chips color mode
[17:29:02] <ali1234> (nearly all european TVs have a character generator built in)
[17:29:23] <Jartza> Lambda_Aurigae: a bit limited charset, but I think it's quite adequate
[17:29:24] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxbjVVdjVSSnZzRlk/view?usp=sharing
[17:29:35] <Lambda_Aurigae> Jartza, well more than adequate.
[17:29:39] <Jartza> basically you can use ascii codes 32-159
[17:29:40] <Lambda_Aurigae> you have done an awesome job.
[17:29:54] <Jartza> some umlauts and line drawing characters and stuff
[17:30:14] <Jartza> and the rest of the font is the reverse, which I need to support the background color :)
[17:30:15] <Lambda_Aurigae> there's enough there to do a scrolling game.
[17:30:41] <Jartza> and the uart seems very stable with 9600bps
[17:31:07] <Jartza> even though I need to interleave it with hsync
[17:31:33] <Jartza> which is 31.45kHz and not really divisible with 9600. but luckily bresenham gave us his algorithm :)
[17:31:58] <Jartza> it's not included in this, but I used it to precalculate the correct sampling sequence :)
[17:36:14] <Jartza> and the progress can be followed here: https://github.com/Jartza/attiny85-vga/blob/asmbranch/vga.asm
[17:36:18] <Jartza> :)
[17:36:45] <Jartza> not that much optimized code as such
[17:37:22] <Jartza> and currently there's no ansi-support yet, just preparation for it
[17:37:35] <Jartza> esc clears the screen and scrolling is supported
[17:37:38] <Lambda_Aurigae> just the scrolling is awesome.
[17:37:39] <Jartza> but already quite usable
[17:38:10] <Jartza> the screen clearing is too :D
[17:38:29] <Lambda_Aurigae> just fill with 32 32 32 32 32
[17:38:34] <Jartza> I set "screen clearing state" and instead of drawing pixels I clear the buffer in chunks of 64 bytes to keep in sync
[17:39:11] <Jartza> at the same time sampling uart and stuff
[17:39:36] <Jartza> as I don't have any RAM left for uart buffer, I need to handle everything in horizontal porches
[17:40:05] <Jartza> also the scrolling, it's done in 2 parts. I clear 16 bytes first and then 16 bytes in the next hsync
[17:40:44] <Jartza> would've been much easier if I stayed in the original 32x12 characters, would've had more RAM for uart buffers etc
[17:40:49] <Jartza> and I could've used the vertical blanking
[17:40:57] <Jartza> but it's not as much fun!
[17:41:20] <Jartza> Assembly complete with no errors.
[17:41:20] <Jartza> Segment usage: Code : 1517 words (3034 bytes) Data : 512 bytes
[17:41:39] <ali1234> i assume you already moved all static data to progmem?
[17:41:39] <Jartza> that 3034 bytes include font, which is 2048 bytes
[17:42:05] <Jartza> ali1234: yes
[17:42:15] <Jartza> there's 448 bytes for screen buffer (32x14 characters)
[17:42:29] <Jartza> 32 bytes is the pixel buffer for horizontal line currently being drawn
[17:42:45] <Jartza> and 32 bytes for the next horizontal line being precalculated
[17:43:06] <Jartza> precalculated, meaning, getting font data from flash etc
[17:43:27] <Jartza> 8 bytes a time, as each horizontal line is drawn 4 times (one "pixel" is 4 pixels high)
[17:44:05] <Jartza> but as my font is 6x8 pixels, that still makes 192 x 112 pixels drawn
[17:44:31] <Jartza> which in my opinion is pretty good :)
[17:45:56] <Jartza> the font is quite readable and there's no extra space between characters (except the intentional spacing between letters)
[17:46:21] <Jartza> line-drawing characters are side-by-side
[17:52:34] <Jartza> I thought to make a pcb for this too
[17:52:48] <Jartza> and started to think that I'll do it in a form of arduino shield
[17:53:06] <Jartza> but also include pin headers for vcc/gnd/uart
[17:53:18] <Jartza> then it could either be used as a shield with arduino/nucleo or standalone
[17:53:32] <Jartza> and the same pcb populated either with single attiny, or three :)
[17:53:32] <Lambda_Aurigae> NOOOO!
[17:53:35] <Lambda_Aurigae> not ardweeny!
[17:55:17] <RikusW> heh
[17:56:48] <Jartza> Lambda_Aurigae: well, I guess it still wouldn't hurt to have those headers there
[17:56:58] <Jartza> not that I would need more than 3 pins :)
[17:57:13] <Jartza> it would allow me to use this with nucleo, I have many nucleo boards
[17:57:26] <Jartza> they have arduino-headers too
[18:00:03] <Jartza> Lambda_Aurigae: nobody forces to use that board with arduino ;)
[18:00:13] <Jartza> nor even populate those headers
[18:00:21] <Lambda_Aurigae> hehe.
[18:00:26] <Jartza> just a thought. someone might still find it useful. dunno.
[18:00:32] <Lambda_Aurigae> probably.
[18:00:45] <Lambda_Aurigae> I'm just allergic to arduino.
[18:00:55] <Jartza> and there's a ready footprint to eagle for arduino shield
[18:01:02] <Jartza> so it's not a big task to add it
[18:01:11] <Jartza> yeah. I'm allergic to arduino too
[18:01:21] <Jartza> but nucleo (stm32 cortex m) is nice :)
[18:01:50] <Jartza> although I'm allergic to mbed too. luckily nobody forces to use it
[18:03:16] <Lambda_Aurigae> I want to take your system and expand it to a possibly full graphic mode.
[18:03:29] <Lambda_Aurigae> using an external spi sram.
[18:09:28] <Lambda_Aurigae> Jartza, where is the video of displaying text with your thingie?
[18:17:35] <Lambda_Aurigae> http://hackaday.com/2015/08/11/vulcan-74-a-masterpiece-of-retro-engineering/
[18:17:39] <Lambda_Aurigae> Jartza, check that out.
[18:17:45] <Lambda_Aurigae> a GPU built from 74xx chips.
[18:20:08] <aandrew> Jartza: holy crap
[18:28:45] <RikusW> zlog
[18:34:19] <Jartza> Lambda_Aurigae: :)
[18:34:28] <Jartza> oh, what video?
[18:34:48] <Lambda_Aurigae> look at that link.
[18:34:50] <Lambda_Aurigae> http://hackaday.com/2015/08/11/vulcan-74-a-masterpiece-of-retro-engineering/
[18:35:29] <Jartza> yeah, looked :)
[18:35:32] <Jartza> very crazy, too
[18:35:43] <Jartza> I'd say my approach is from the other end :D
[18:35:48] <Jartza> use as little hardware as possible
[18:36:38] <Jartza> but what video? that scrolling text?
[18:36:48] <Jartza> https://www.dropbox.com/s/xbmdlhl93dakqhe/1439414207.mp4?dl=0
[18:36:51] <Jartza> this one? :)
[18:37:55] <Lambda_Aurigae> not scrolling text...just displaying text.
[18:40:25] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxZ1cweG1JNjF5MVk/view?usp=sharing
[18:40:29] <Jartza> there's one pic
[18:40:38] <Lambda_Aurigae> yeah..got the pic.
[18:40:51] <Lambda_Aurigae> I thought there was a video of it adding text to the screen.
[18:40:57] <Jartza> oh
[18:45:06] <Jartza> isn't that adding text to screen? :)
[18:45:17] <Jartza> that text comes from uart
[18:45:37] <Lambda_Aurigae> it's not real clear though..the scrolling one.
[18:45:39] <Jartza> https://www.dropbox.com/s/yibugjuszpo64vg/1439413348.mp4?dl=0
[18:45:54] <Jartza> there's alice in wonderland :D
[18:45:55] <Lambda_Aurigae> i thought you had one from before the uart...or right as you first got the uart running.
[18:46:04] <Jartza> hmm
[18:46:05] <Jartza> just a sec
[18:46:45] <Jartza> I have one which shows the screen clearing and uart
[18:46:46] <Jartza> hmm
[18:46:46] <Jartza> https://www.dropbox.com/s/wqrcpv6bl2d3ta3/1439055484.mp4?dl=0
[18:47:29] <Jartza> one more sec
[18:47:48] <Jartza> I don't quite know what kind of video you want :)
[18:47:53] <Jartza> https://www.dropbox.com/s/cm2rtqvirgpddks/1439421778.mp4?dl=0
[18:47:56] <Jartza> made this for you then
[18:48:08] <Lambda_Aurigae> showing your stuff off.
[18:49:36] <Lambda_Aurigae> that's a good one.
[18:50:46] <Jartza> I'm running a bit out of space on both dropbox and google drive, so I deleted some old "crappy" stuff :
[18:50:49] <Jartza> :)
[18:51:23] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxZ3BlZTg3OWw3dVE/view?usp=sharing
[18:51:27] <Lambda_Aurigae> that's why I host my own web server.
[18:51:29] <Jartza> still have the teaser-image for colors
[18:51:52] <Jartza> although still 32x12 and 5x8 pixel font
[18:52:16] <Jartza> but gives some idea how the colors look like
[18:52:31] <Lambda_Aurigae> yup.
[18:53:42] <Jartza> anyway, fairly happy now that the hardest things work
[18:53:44] <Lambda_Aurigae> so, using your system to pulse the clock pin on an spi sram, one should be able to clock out graphic data.
[18:54:01] <Jartza> the clear and scroll
[18:54:12] <Lambda_Aurigae> a 1Mbit spi sram that can clock at 20MHz should tie into that nicely.
[18:54:27] <Jartza> sure, external sram could be very useful
[18:54:37] <Lambda_Aurigae> it's an 8pin dip too.
[18:54:48] <Lambda_Aurigae> and can do sqi output..
[18:55:09] <Jartza> I'm just stubborn and want to make this without external chips :)
[18:55:15] <Jartza> for the hack value
[18:55:27] <Lambda_Aurigae> oh, of course.
[18:55:32] <Jartza> there are plenty of better vga solutions out there for embedded, I'm sure
[18:55:32] <Lambda_Aurigae> and it's awesome.
[18:55:38] <Lambda_Aurigae> I'm just looking to go to the next level.
[18:55:44] <Jartza> :)
[18:55:47] <Lambda_Aurigae> a 2 chip graphic mode.
[18:55:57] <Jartza> yea
[18:56:07] <Lambda_Aurigae> and with sqi mode, you get 4 bits out at a time.
[18:56:11] <Lambda_Aurigae> so you can do RGBi
[18:56:18] <Jartza> true
[18:56:24] <Lambda_Aurigae> 16 colors!
[18:56:32] <Jartza> that'd be awesome too
[18:56:42] <Jartza> like would be 80x25 (at least) :)
[18:57:04] <Lambda_Aurigae> hopefully I will have electronics play time this weekend to duplicate your hardware and then start working on it.
[18:57:38] <Lambda_Aurigae> best part about them is I can get them as free samples.
[18:57:58] <Lambda_Aurigae> from microchip.
[18:58:59] <Jartza> on top of hack value, I hope someone learns something from my blog-post-to-come
[18:59:11] <Lambda_Aurigae> I'm learning from your code already.
[18:59:37] <Jartza> I'm trying to document it even better
[18:59:50] <Jartza> once the features are in
[19:00:03] <Lambda_Aurigae> sweet.
[19:00:31] <Lambda_Aurigae> and the video output seems rather stable...moreso than the one I was futzing with.
[19:00:54] <Jartza> oh yeah, it is
[19:01:08] <Jartza> the jitterfix works amazingly well :)
[19:01:16] <Lambda_Aurigae> am hoping to port it to a larger chip too.
[19:01:34] <Lambda_Aurigae> see if I can make the spi hardware do what the usi is doing.
[19:01:54] <Jartza> would be easier with 16bit counters, now I had to use two counters
[19:02:16] <Lambda_Aurigae> yup.
[19:02:27] <Jartza> the other with clk/4 prescaler and one unscaled
[19:03:09] <Jartza> and hsync pulse is generated with pwm so I don't have to worry about it jittering
[19:04:52] <Jartza> also saves few clock cycles and makes life easier
[19:05:20] <Lambda_Aurigae> how fast are your pixel pulses?
[19:06:42] <Lambda_Aurigae> just wondering if we can get a full 320x200 out of it.
[19:07:14] <Jartza> hmmh. haven't actually measured but I'm just guessing 2 clock cycles
[19:08:28] <Lambda_Aurigae> so you are going 192x112 actual pixels.
[19:08:47] <Lambda_Aurigae> expanding that to 200 vertical shouldn't be too difficult.
[19:09:15] <Lambda_Aurigae> specially if I'm not having to actually draw the characters.
[19:09:29] <Lambda_Aurigae> free up a lot of time.
[19:09:56] <Lambda_Aurigae> would have to just switch around to writing data to the sram during the blanking periods.
[19:10:28] <Lambda_Aurigae> scrolling could be done by just shifting the "view window" in the ram.
[19:11:26] <Jartza> yeah
[19:11:33] <Jartza> that's how I also do it
[19:11:50] <Jartza> just shifting the mem buffer offset
[19:11:57] <Lambda_Aurigae> kewl.
[19:12:14] <Lambda_Aurigae> one could actually scroll 4 ways with 1Mbit of data to play with.
[19:12:17] <Jartza> of course I need to clear one row
[19:12:24] <Lambda_Aurigae> or a big up/down scroll.
[19:12:28] <Jartza> sure
[19:12:58] <Jartza> I might support down scrolling in future too, we'll see
[19:13:04] <Jartza> :)
[19:13:10] <Jartza> first the ansi
[19:13:35] <Jartza> already have preliminary working version
[19:13:57] <Jartza> some fighting with clock cycles again
[19:14:28] <Lambda_Aurigae> hehe.
[19:14:30] <Lambda_Aurigae> always.
[19:14:52] <Jartza> yep, like that scroll
[19:15:02] <Jartza> the scroll itself was easy
[19:15:23] <Jartza> but the sync was lost while clearing one row from screenbuffer
[19:16:06] <Jartza> took too long to clear :)
[19:17:06] <Jartza> so I had to make another "state", which told that we're clearing that one row and moving the viewport
[19:17:30] <Lambda_Aurigae> yanno, I wish atmel would put an xmega in a dip package...that would make for a fun chip to play with like this.
[19:17:36] <Jartza> then on the next 2 hsyncs I'll clear 16 bytes on each
[19:17:47] <Jartza> yeah :)
[19:18:07] <Lambda_Aurigae> think I'm gonna port your idea to the pic32 too.
[19:18:10] <Jartza> I might try with unrolled loop
[19:18:12] <Lambda_Aurigae> can do a lot with that.
[19:18:17] <Jartza> sure can
[19:18:20] <Jartza> much more
[19:18:25] <Lambda_Aurigae> 50mhz, 83dmips.
[19:18:30] <Jartza> yep
[19:18:39] <Lambda_Aurigae> 256K flash, 64K sram.
[19:19:36] <Lambda_Aurigae> hmmm...320x200x4bit here I come!
[19:19:39] <Jartza> yea, could easily do colors and 80x25 (I think)
[19:19:40] <Lambda_Aurigae> maybe.
[19:19:55] <Lambda_Aurigae> I want graphic dangit!
[19:20:07] <Jartza> hehe yea
[19:20:24] <Lambda_Aurigae> nice thing about the pic32 is, it's not a pic processor..
[19:20:30] <Jartza> I have plans for "font graphic" mode
[19:20:33] <Lambda_Aurigae> it's a mips processor with pic peripherals.
[19:20:40] <Lambda_Aurigae> font graphic?
[19:20:50] <Jartza> just make anothee font with 256 different patterns
[19:20:50] <Lambda_Aurigae> replace the characters with graphic primitives?
[19:20:54] <Jartza> yes
[19:21:38] <Jartza> ansi escape has even command for font selection
[19:21:39] <Lambda_Aurigae> how much space do you have left?
[19:22:00] <Jartza> well the code itself still takes less than 1kB
[19:22:12] <Lambda_Aurigae> so, plenty of space for multiple fonts?
[19:22:16] <Jartza> 256 char font takes 2kB
[19:22:28] <Jartza> so I could fit 3 fontsets
[19:23:02] <ali1234> it should be possible to generate block glyphs in real time
[19:23:13] <Lambda_Aurigae> and switch between them on the fly...either frame or line at a time?
[19:23:29] <Jartza> not really
[19:23:46] <Jartza> no ram to store attrobutes :)
[19:23:57] <Lambda_Aurigae> hmm..true.
[19:24:04] <Jartza> it would change the font for whole screen
[19:24:13] <Jartza> but one font could be as it's now
[19:24:24] <Jartza> other could just be graphics primitives
[19:24:29] <Lambda_Aurigae> but, yeah...have a command that just switches font on the fly....whole screen changes.
[19:25:05] <Jartza> and one hybrid with basic letters a-z and numbers and rest of the chars some graphics/drawing ones
[19:25:38] <Jartza> many games in 80s used that kind of approach
[19:25:42] <Lambda_Aurigae> here's an idea.
[19:25:46] <Lambda_Aurigae> split font mode.
[19:25:59] <Lambda_Aurigae> where it draws the upper half in one font and the lower in another.
[19:26:04] <Jartza> hmm
[19:26:11] <Lambda_Aurigae> apple did something similar with their graphic/text mode.
[19:26:12] <Jartza> that could be done
[19:26:20] <ali1234> you should study the mullard chip
[19:26:24] <Lambda_Aurigae> upper 3/4 of the screen was graphics and the lower 1/4 was text only.
[19:26:30] <ali1234> https://en.wikipedia.org/wiki/Mullard_SAA5050
[19:26:51] <Jartza> I could maybe even select the row number where to switch
[19:26:57] <Lambda_Aurigae> true too.
[19:27:35] <Lambda_Aurigae> ali1234, interesting.
[19:27:40] <ali1234> just have inline escape codes
[19:27:51] <Lambda_Aurigae> ali1234, not enough memory.
[19:27:59] <ali1234> why not?
[19:28:07] <Lambda_Aurigae> very tight on ram in this thing he is doing.
[19:28:08] <ali1234> it only needs 1 bit
[19:28:29] <Jartza> I don't have that
[19:28:32] <ali1234> abuse some peripheral register you're not using :)
[19:28:42] <Lambda_Aurigae> he is doing that already!
[19:28:43] <Lambda_Aurigae> hehe
[19:28:49] <ali1234> doh
[19:29:05] <Lambda_Aurigae> he is very much abusing the poor attiny85
[19:29:08] <Jartza> I'm using 512 bytes of 512 bytes :)
[19:29:12] <Lambda_Aurigae> other than not overclocking it.
[19:29:12] <ali1234> omg
[19:29:19] <Jartza> and the mcu registers
[19:29:26] <ali1234> just get an atmega?
[19:29:31] <Lambda_Aurigae> naaa.
[19:29:33] <Jartza> naah
[19:29:36] <Lambda_Aurigae> the idea is to make a tiny do it.
[19:29:40] <Jartza> yep
[19:29:41] <Lambda_Aurigae> I like to go bigger.
[19:29:44] <Lambda_Aurigae> he likes to go smaller.
[19:30:01] <Jartza> this is just to see how far tiny85 can fly
[19:30:14] <Lambda_Aurigae> you should see his modem-on-a-chip
[19:30:25] <Jartza> not to make the best vga controller out of mcu
[19:30:46] <Lambda_Aurigae> Jartza, so far, it's the best tiny one!
[19:31:00] <Jartza> ali1234: http://labs.rakettitiede.com/?p=87
[19:32:10] <Lambda_Aurigae> Jartza, is that receive only or did you make an avr transmitter too?
[19:32:17] <Jartza> I did
[19:32:31] <Jartza> tagsus can talk to each other :)
[19:32:36] <Lambda_Aurigae> sweet.
[19:32:49] <Jartza> you can copy data from one tagsu to other
[19:33:31] <Jartza> and nowadays, also update firmware by playing audio
[19:33:48] <Jartza> http://www.verkkokauppa.com/fi/product/61543/gcdns/Tagsu-elektroninen-nimilappu
[19:33:51] <Jartza> :)
[19:34:50] <Lambda_Aurigae> vgataggy!
[19:34:58] <Lambda_Aurigae> tie the two projects together.
[19:35:02] <Lambda_Aurigae> two chips needed.
[19:35:22] <Jartza> sorry, in finnish. but that store is the biggest and most visited online retail store in finland
[19:35:29] <Jartza> hehe
[19:35:45] <Jartza> 19" lcd-blingie on your neck?
[19:36:03] <Lambda_Aurigae> 7 inch 5V powered actually, I was thinking.
[19:36:40] <Lambda_Aurigae> http://goodwell-tech.manufacturer.globalsources.com/si/6008842012596/pdtl/Stand-alone-monitor/1063105407/7-inch-5V-DC-USB-Touchscreen-Stand-alone-Monitor.htm
[19:36:43] <Lambda_Aurigae> touchscreen even!
[19:37:01] <ali1234> so what encoding does that use n the final version?
[19:38:08] <Jartza> it's all explained there
[19:39:03] <Jartza> btw. that encoding also works over fm radio
[19:39:14] <Jartza> multicast ;)
[19:39:47] <ali1234> the signal changes if it's zero, stays the same if it's one?
[19:40:13] <Jartza> no
[19:40:17] <Jartza> it always changes
[19:40:26] <Jartza> that's also clock
[19:40:38] <Jartza> pulse length tells 0/1
[19:40:44] <ali1234> mark/space?
[19:41:05] <Jartza> and sync pulse tells what the pulse length should be
[19:41:27] <Jartza> so it also auto-adapts to different speeds
[19:42:35] <ali1234> this encoding is widely used on garage door openers and cheap remote control plugs
[19:44:07] <Jartza> it is?
[19:44:14] <ali1234> yes
[19:44:23] <Jartza> with autospeed and sync pulse?
[19:44:37] <ali1234> sync pulse is kind of uneccessary
[19:44:48] <Jartza> no it's not
[19:45:11] <ali1234> you just measure the time between the high low interrupts
[19:45:21] <ali1234> if x > y it's a 1 other wise it's a zero
[19:46:01] <Jartza> to me that sounds different
[19:46:15] <Jartza> I measure time between zero crossings
[19:46:26] <ali1234> right
[19:46:42] <ali1234> it's either rising or falling
[19:47:06] <Jartza> and sync pulse lenght sync the receiver counter
[19:47:15] <ali1234> so one crossing = 1 bit?
[19:47:21] <Jartza> yes
[19:47:27] <ali1234> i see... that's different then
[19:47:31] <ali1234> i don't know what that's called
[19:47:48] <Jartza> but the internal clock of attiny85 is 8MHz +-10%
[19:48:02] <Jartza> that's what the sync pulse is for
[19:48:29] <Jartza> we only know that pulse longer than certain constant is sync pulse.
[19:48:44] <Jartza> divide the sync pulse length by 4
[19:49:15] <Jartza> then you have synced your data clock to reveiving chip clock
[19:49:36] <Jartza> it pulse is shorter than that, it's zero, longer than that, one
[19:51:24] <ali1234> so frequency shift keying... but with only half a cycle per bit
[19:51:35] <Jartza> sorta yes
[19:51:51] <Jartza> and autotiming
[19:52:06] <Jartza> and clock for each bit
[19:52:19] <Jartza> but much more simple than manchester
[19:53:28] <Jartza> we trust that the receiver clock is relatively stable, but it doesn't matter if the variation is between 7.2 and 8.8 MHz
[19:54:39] <Jartza> it has proven to be very reliable
[19:54:42] <ali1234> there's a lot of line encodings out there but i can't find one like yours :)
[19:54:56] <Jartza> me neither
[19:55:05] <Jartza> and I did search, for long
[19:55:20] <Jartza> but this was just as simple as it gets :)
[19:55:35] <Jartza> if you look at the code :)
[19:57:48] <Jartza> dropping the speed to avg 8kbit/s it seems to work over regular fm radio too
[19:58:15] <Jartza> one day I'm gonna try it with C-cassette :D
[19:59:14] <ali1234> ah... apparently C64 used a similar scheme to this
[19:59:37] <Jartza> there are similarities with that, yes
[19:59:40] <Jartza> also apple ii
[20:00:03] <ali1234> but that only triggers on one edge
[20:00:13] <Jartza> yes
[20:00:40] <Jartza> and they trust the listener has certain clock speed
[20:01:35] <Jartza> it's sort of old cassette storage but with a twist
[20:05:28] <Jartza> works very well with tagsu
[20:08:50] <Jartza> for tagsu I added crc and some block index coding, but the main encoding is the same
[20:09:13] <Jartza> æ
[20:29:43] <aandrew> the cheap wireless weather stations use something similar
[20:30:08] <aandrew> again no sync pulse there, they just measure bit times in the preamble, which I suppose you could call a different kind of sync pulse
[20:37:18] <Jartza> mmkay
[20:37:35] <Jartza> of course there are plenty of closely similar
[20:37:50] <Jartza> still neat, I think :)
[20:38:05] <aandrew> it is. no intention of knocking your work at all
[20:39:53] <Jartza> didn't take it as such
[20:40:11] <Jartza> I'd be very interested if someone founds something very closely similar :)
[20:40:22] <Jartza> then I could call it with a name, at least
[20:40:34] <Lambda_Aurigae> Jartza encoding scheme.
[20:40:58] <aandrew> right now it's Jartzeese
[20:42:54] <Jartza> heh. I call it "tagsu encoding" :P
[20:43:04] <Jartza> it's the only place I know it's used in
[20:45:04] <essobi> Opinions on the lowest cost AVR w/USB support for HID keyboard emulation that I can sell? V-USB is off the table with licensing costs... And "sell" is a pretty loose term. I want to use it for a conference badge. Thinking the atmega32u2 probably...
[20:46:02] <Lambda_Aurigae> essobi, even with hardware usb you still need a licensed pid/vid.
[20:46:18] <Lambda_Aurigae> atmega16u2 would likely work too.
[20:46:21] <essobi> Lambda_Aurigae: For a keyboard?
[20:46:38] <essobi> I thought keyboards was the only one that was shared...
[20:46:40] <Lambda_Aurigae> for anything usb, you have to use pid/vid
[20:47:00] <aandrew> essobi: you have by far one of the best irc nicks I've ever run across, and I've been on IRC since the mid-90s
[20:47:34] <essobi> aandrew: :D Me too...
[20:47:50] <Lambda_Aurigae> I don't think you can sell anything usb without having a legal pid/vid set...never heard of anybody making one available to everybody to use for anything including keyboard....but it could be.
[20:49:34] <essobi> well.. Effectively what I'm going to make is a "USB Rubber Duckie" http://hakshop.myshopify.com/products/usb-rubber-ducky-deluxe?variant=353378649 on a conference badge... But much lower end..
[20:50:19] <essobi> One of the "features" of said device is a VID/PID swapping for cloaking.. I was under the impession that the keyboards also didn't particularly matter...
[20:50:58] <Lambda_Aurigae> I'm not finding that anywhere.
[20:51:29] <Lambda_Aurigae> everything I'm seeing is that anything that adheres to the rules has to have a unique pair for every unique device.
[20:51:57] <Lambda_Aurigae> you can use the same pair for 5000000 keyboards but they have to be all the same model basically.
[20:52:11] <essobi> Hmm... Interesting..
[20:52:35] <Lambda_Aurigae> and it's like $5000 dollars for a VID as I recall.
[20:52:43] <essobi> Yea.. It's a fuckton...
[20:53:08] <essobi> And I know for a fact all these conference badges with USB on them didn't pay for that VID...
[20:53:44] <essobi> That'd drive the cost on them up substantially..
[20:53:45] <Lambda_Aurigae> there are some companies that will sublet theirs for small run devices.
[20:54:06] <essobi> Yea, I saw V-USB does that too..
[20:54:16] <Lambda_Aurigae> and, I don't know if it's a legal thing or what....if you say it has usb then you have to pay the licensing.
[20:54:39] <Lambda_Aurigae> v-usb does it and so does microchip.
[20:54:46] <Lambda_Aurigae> not sure about atmel.
[20:55:02] <Lambda_Aurigae> if it's for your own internal use, go for it, have fun, play with whatever.
[20:55:35] <Lambda_Aurigae> get it in the wild and if the usb-if guys find it they will send you nasty letters via their lawyers.
[21:20:42] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxSE5vckNET3kyVk0/view
[21:20:45] <Jartza> now, good night all!