#avr | Logs for 2013-10-09

Back
[00:11:01] <Casper> N1njaneer: he pigned out
[00:23:06] <N1njaneer> Oh yeah, now I see that. Oh well :(
[05:41:42] <Roklobsta> http://www.kickstarter.com/projects/2084212109/gameduino-2-this-time-its-personal looks damned nice. amazed what an AVR can drive
[08:07:11] <Amadiro> Roklobsta, well, technically you can connect an arduino to a PC and drive a nvidia titan graphics card... :P
[08:09:02] <Fornaxian> heck, years back people were driving ISA VGA cards with pic and avr and 8051 chips...
[08:09:51] <twnqx> so there'd be a market for a VGA shield? :P
[08:10:00] <Fornaxian> if it were cheap, yeah
[08:10:14] <twnqx> ISA shield
[08:10:16] <Fornaxian> and did decent resolution and color space.
[08:10:20] <twnqx> time to scavenge ebay!
[08:10:26] <Fornaxian> good luck finding isa video cards these days.
[08:10:33] <Amadiro> I don't think you can really get ISA cards anymore, except from scrapyards...
[08:11:20] <Fornaxian> http://www.ebay.com/itm/TRIDENT-9016X2-4-LT2-W-ISA-VGA-CARD-/200899877589?pt=LH_DefaultDomain_0&hash=item2ec690dad5
[08:11:30] <twnqx> there quite some
[08:11:31] <Fornaxian> good god...that's more than that card cost new in the 90s!
[08:11:42] <Amadiro> woah
[08:11:47] <Amadiro> maybe I should put my old ISA cards on ebay
[08:11:58] <Amadiro> I think I have mostly token ring network cards...
[08:12:11] <Fornaxian> yeah.
[08:12:16] <Fornaxian> I have lots of old isa stuff.
[08:12:19] <Fornaxian> time to EBAY!
[08:12:31] <Fornaxian> 79 dollars for an 8bit isa vga card!
[08:12:33] <Fornaxian> sheesh.
[08:12:39] <Fornaxian> think I paid 25 new for it.
[08:13:02] <Amadiro> maybe they are catering to people who run really old production systems that require that exact card
[08:13:05] <Amadiro> and need replacements
[08:13:09] <Fornaxian> yup.
[08:13:11] <Amadiro> or something like that
[08:13:14] <twnqx> right
[08:13:22] <twnqx> 10$ fpga + external dac should do
[08:13:25] <Fornaxian> wonder what my old pc-xt will bring.
[08:13:48] <twnqx> good i have my oooold vga programming books still around
[08:13:55] <Fornaxian> hehe
[08:14:12] <twnqx> must have bought them 20 years ago
[08:14:14] <Fornaxian> if you could do 800x600 256 colors I bet you could sell it.
[08:14:29] * twnqx calculates
[08:14:34] <twnqx> 0.5MB
[08:14:36] <twnqx> hm
[08:14:40] <twnqx> sounds reasonable
[08:14:51] <Amadiro> If you want to target the arduino crowd, the gameduino is probably the right approach
[08:14:52] <twnqx> sadly beyond fpga internal sram
[08:15:00] <Amadiro> you want to provide a complete, easy-to-use interface
[08:15:10] <Fornaxian> http://www.mcustore.com/microvga-display-adapter.html
[08:15:16] <Fornaxian> https://solarbotics.com/product/52143/
[08:15:27] <Fornaxian> commercial products with crap resolution.
[08:15:43] <Fornaxian> 640x480 256 colors would be good too.
[08:16:08] <twnqx> and an lvds interface next to vga
[08:16:17] <twnqx> so you can directly drive small tfts
[08:16:53] <Fornaxian> how bout for driving old laptop displays?
[08:17:26] <twnqx> no idea what they use
[08:17:32] <twnqx> but probably not lvds?
[08:17:36] <Fornaxian> think they are an lvds.
[08:17:45] <Amadiro> lvds has been around for a while, has it not
[08:17:55] <Fornaxian> yes, for a long time.
[08:18:35] <Fornaxian> standard was published in 2001
[08:25:53] <Fornaxian> http://www.vintage-computer.com/vcforum/showwiki.php?title=Hardware:8bit+Friendly+ISA+VGA+cards
[08:27:47] <Fornaxian> http://tinyvga.com/avr-isa-vga
[09:29:00] <Fornaxian> http://hackaday.com/2013/10/09/a-motherboard-for-a-wifi-enabled-sd-card/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+hackaday%2FLgoM+%28Hack+a+Day%29
[09:29:16] <Fornaxian> wifi for avr cards in an sd package...along with some flash storage..
[09:32:35] <Amadiro> Fornaxian, I pondered bying one a while ago, but I don't really have any application for it personally that can't be satisfied by an rpi
[09:32:40] <Amadiro> Fornaxian, the CPU in the card is an ARM, btw
[09:32:49] <Fornaxian> yeah.
[09:32:51] <Fornaxian> and runs linux.
[09:33:03] <Amadiro> yeah
[09:33:27] <Amadiro> possibly interesting if you need to smuggle some sort of wifi enabled computer into someones top security level house :P
[09:33:37] <Fornaxian> was just thinking of using the base chip for a wifi uplink from an avr device though.
[09:33:56] <Fornaxian> like a remote datalogger.
[09:34:13] <Fornaxian> bit on the pricy side at 45 dollars though.
[09:34:29] <Amadiro> Fornaxian, you could maybe use something like an aria instead
[09:34:45] <Amadiro> costs 25€ or so, AFAIR, and comes with 256MiB/512MiB RAM
[09:34:52] <Amadiro> they are only slightly larger than an SD card
[09:35:09] <Fornaxian> got a link?
[09:35:16] <Amadiro> one sec
[09:35:22] <Amadiro> http://www.acmesystems.it/aria
[09:35:34] <Amadiro> they come with SPI, USB and ethernet peripherals
[09:35:44] <Amadiro> and I2C, GPIO and ADCs
[09:36:04] <Amadiro> So you get potentially all the stuff you need for the datalogger (except wifi) in one package
[09:36:25] <Fornaxian> no wifi.
[09:36:38] <Amadiro> yeah, but usb wifi cards are basically free.
[09:36:42] <Fornaxian> the wifi is what interests me on that.
[09:37:09] <Fornaxian> need to see how hard it would be to interface to a wifi usb card from an 8bit uC
[09:37:55] <Fornaxian> maybe hack around the usb interface even.
[09:38:00] <Amadiro> Fornaxian, looks like they sell wifi companion cards for 7€: http://www.acmesystems.it/catalog_wireless
[09:40:54] <megal0maniac_afk> Quick question, why does this line fail to compile?
[09:40:57] <megal0maniac_afk> void convertPol2Rect(double mag, double angle, int &real, int &imag)
[09:41:29] <bss36504> pretty sure those & should be *
[09:41:46] <Amadiro> megal0maniac_afk, are you compiling this with a C or a C++ compiler?
[09:42:10] <megal0maniac_afk> C
[09:42:24] <Amadiro> & in function arguments is not something that exists in C
[09:42:28] <Amadiro> it's a c++ only thing
[09:42:34] <megal0maniac_afk> Aw :(
[09:42:52] <Amadiro> It means the function expects a int reference
[09:43:14] <bss36504> but if you're trying to modify "real" thats passed into and modfied within your function, just use *. Then you pass a pointer in, and modify what it points at.
[09:43:30] <megal0maniac_afk> But in C++ that would work, right?
[09:43:39] <megal0maniac_afk> Just want to make sure I'm not completely on the wrong track
[09:43:45] <Amadiro> Yes, it looks like valid c++ to me. (not that I'm a C++ expert)
[09:44:04] <bss36504> I'm not comfortable enough with C++ to know for sure, but I believe so.
[09:44:44] <megal0maniac_afk> That's good enough for me. It'll never be C++, just wanted to make sure that I'm not being a total fool :)
[09:45:01] <bss36504> nope, seems legit :)
[09:45:11] <Amadiro> Well, if you are trying to compile C++ code with a C compiler, you are a total fool ;)
[09:45:28] <bss36504> Hey-O!
[09:46:15] <Amadiro> but seriously: decide on which language to use, and then use the appropriate compiler for it
[09:46:24] <Amadiro> in C++, using references is appropriate, in C, you'd use pointers
[09:47:49] <megal0maniac> I know :) I'm using C, specifically, and programming in C
[09:48:27] <megal0maniac> I just get confused with some of the reference material. Even though the internet is pure truth and nobody is ever wrong on the internet etc, it can get confusing
[09:48:49] <megal0maniac> Due to things like C++ being referred to as C
[09:48:50] <megal0maniac> And that kind of thing
[09:49:10] <Amadiro> it's best to read a book or the spec
[09:49:42] <bss36504> http://i0.kym-cdn.com/photos/images/newsfeed/000/428/075/30a.jpeg
[09:49:45] <megal0maniac> It was a page on pointers that got me
[09:50:15] <megal0maniac> bss36504: Haha!
[09:50:21] <megal0maniac> Cool, well it compiles now
[09:50:36] <bss36504> The greatest C book I've ever read is "Programming In C" by Stephen Kochan
[09:51:20] <bss36504> For a textbook, it's super easy to read
[09:52:28] <Fornaxian> I like the K&R C book myself.
[09:53:48] <Fornaxian> http://net.pku.edu.cn/~course/cs101/2008/resource/The_C_Programming_Language.pdf written by the guy who wrote C in the first place.
[09:54:19] <bss36504> I noticed that
[09:55:29] <megal0maniac> Cool. Now to carry on. Thanks all!
[09:56:02] <Fornaxian> I got my first copy of that book in 1988 from a guy working at sandia national labs who was heading up the project we were working on in the military.
[09:56:16] <Fornaxian> that got me started in C on unix.
[10:08:41] <ColdKeyboard> Does every flash memmory IC has it's memmory organized by pages? I'm looking for one that I will be able to do something like, 1st byte = write command, 2nd, 3rd etc. byte = starting address, Xth to Ntxh byte = data
[10:09:25] <bss36504> you can usually program bytewise, but erases have to be on a per page or per block basis.
[10:09:35] <bss36504> It has to do with the architecture of the array.
[10:09:44] <bss36504> Otherwise it would technically be an EEPROM.
[10:10:26] <ColdKeyboard> Ok, so I'm limited to the page size.
[10:11:41] <bss36504> It depends on the chip. I'm familiar with some macronix chips that have 256 byte pages, and a burst write can write that whole page, automatically incrementing the address. You can also start a write in the middle of the page. It's important to note though, that the smallest erase you can do on this chip is a 4K block.
[10:11:48] <Casper> ColdKeyboard: afaik, all flash work in block
[10:13:31] <ColdKeyboard> bss36504: I have found some Atmel flashes, they have page size of 256 bytes and I can write whole page continualy but after I fill the page, I have to stop writing and initiate another write sequence with new page address.
[10:14:05] <ColdKeyboard> Erasing data from the chip is not the issue since I will be erasing whole chip every time
[10:14:13] <bss36504> exactly. It most likely just wraps the new data back to the beginning of the page, or it doesn't write the data at all
[10:14:36] <Casper> ColdKeyboard: just make a library that take care of that, shouln't be too much of an issue. Else consider using eeprom
[10:15:00] <bss36504> in that case, flash will probably work well for you. Thats one of the limitations: if you wanted to change a single byte, you have to first cache all of the data in the smallest erase block, then erase, then re-write with the changes.
[10:15:47] <bss36504> Unless you make your flash like Atmel Dataflash, which I believe does allow single byte modifications, making it act like an EEPROM
[10:16:21] <ColdKeyboard> I will be using it for some kind of LogicAnalyzer, so I just need memory tu dump sampled data to id and later be able to read it and send over to PC for analyzing
[10:16:53] <bss36504> oh yes, this project. As long as you can write fast enough, you should be fine
[10:18:12] <ColdKeyboard> That's why I'm looking for bigger page size or a way to continue to write to another page without issuing another write+address sequence :)
[10:19:45] <bss36504> I woudnt worry. the time it takes to write an address is so small compared to the time it takes for the chip to finish writing a page. You wont find a chip that does that because the interface has a buffer that would allow you to enter bytes into the chip faster than they can be written. Thus the cap at 256 (or however many) bytes that way you check the write-in-progress flag before writing more data.
[10:20:32] <bss36504> (Serial) Flash isn't fast enough to burst write that much data. Use a DRAM or an SRAM or something if you need THAT much speed.
[10:22:22] <ColdKeyboard> Do you have any chips that you would recommend for this use?
[10:23:02] <bss36504> How much space do you need, and do you still think serial flash will work? Perhaps a better question is, how many bytes do you need to write and how fast?
[10:25:50] <bss36504> For example, a Macronix MX25L3235D (3.3V 32Mbit SPI Flash) has a maximum page program time of 5ms. That means you can dump 256 bytes into it as fast as you want, but you may have to wait up to 5ms for it to all be written.
[10:27:11] * twnqx pokes abcminiuser
[10:27:15] <ColdKeyboard> I'm not sure, I guess 1-2Mb or so should be more than enough. I haven't work with serial flash so I don't know how fast are they but if they can write whole page in few ms that should be enough since I can buffer data on the MCU...
[10:28:03] <Fornaxian> ColdKeyboard, use nvsram chips...or even sram chips.
[10:28:20] <Fornaxian> microchip has some nice serial sram chips that can run 1, 2, or 4 bits at a time in and out.
[10:28:35] <Fornaxian> and battery backed up version that can do 1 or 2 bits at a time.
[10:29:16] <Fornaxian> and they come in sizes up to 1Mbit
[10:29:42] <Fornaxian> at 20MHz speeds.
[10:29:49] <ColdKeyboard> Ok, I'll look for them on their page. SRAM you said, they are all also organized in pages/blocks?
[10:30:07] <abcminiuser> Mmm>
[10:30:09] <abcminiuser> ?
[10:30:12] <twnqx> -> pm
[10:31:00] <Fornaxian> no...byte addressable....
[10:31:25] <Fornaxian> http://www.microchip.com/pagehandler/en-us/products/memory/serialSRAM/home.html
[10:32:04] <Fornaxian> http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en559066
[10:32:10] <Fornaxian> awesome little chips.
[10:32:45] <Fornaxian> write one bit at a time and send a stream of bits....just give it a start address and tell it you are sending a constant data stream....then the same for reading bits back out.
[10:33:03] <ColdKeyboard> Fornaxian: I just found this in datasheet -> Sequential Operation - ... Sequential operation allows the entire array to be written to and read from ...
[10:33:06] <abcminiuser> HOT DIGGITY
[10:33:09] <abcminiuser> New GNU Make
[10:33:21] <ColdKeyboard> I guess that's the stuff :D
[10:33:23] <Fornaxian> there is a logic analyzer from dangerous prototypes that uses similar chips for a 20MHz data capture.
[10:33:40] <ColdKeyboard> Nice :)
[10:33:49] <ColdKeyboard> I also like the "no write time"
[10:34:07] <Fornaxian> clock data in at up to 20MHz...
[10:34:23] <Fornaxian> and if you need to save it for any length of time you can go with the battery backed up version.
[10:34:40] <Fornaxian> http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en559069
[10:34:51] <Fornaxian> and, they are available in both smt and through hole packages.
[10:35:34] <ColdKeyboard> Fornaxian: Nice. Well in this case it's logic analyzer so when it goes off I want data to be wiped. But it's good to know that there is another option :)
[10:36:21] <Fornaxian> I've used the first one in pairs to give me 8bits of parallel data.
[10:36:41] <Fornaxian> for an (eeeww) 8051 project...
[10:37:05] <Fornaxian> used an avr to make a memory mapped i/o interface...it was a major hack.
[10:39:49] <ColdKeyboard> I guess this should work, and maybe if this isn't enough I can use 2 or 3 of them to get more Mb :)
[10:40:05] <bss36504> Note Mb versus MB
[10:41:16] <ColdKeyboard> more mega bits
[10:41:17] <ColdKeyboard> :)
[10:43:20] <ColdKeyboard> Fornaxian: you were mentioning this logic analyzer from dangerous prototypes -> http://dangerousprototypes.com/2011/04/06/new-prototype-logic-shrimp-logic-analyzer/
[10:43:59] <Fornaxian> yup.
[10:44:27] <Fornaxian> they used the 256Kbit version of that chip.
[10:44:35] <Fornaxian> that was built before the 1Mbit version came out.
[10:44:50] <Fornaxian> I think someone rebuilt it with a single 1Mbit rather than 4 256Kbit chips.
[10:45:05] <blathijs> ColdKeyboard: I have its little brother, the bus pirate (which can also do 5-channel logic analyzer at up to 1Mhz with the same OLS software)
[10:45:37] <Fornaxian> have a bus pirate here too.
[10:46:05] <Fornaxian> and built a similar but different logic analyzer using 8 1Mbit chips and a usb avr..
[10:49:12] <ColdKeyboard> So bus pirate is better than shrimp :)
[10:52:43] <ColdKeyboard> Fornaxian: What software are you using for your different logic analyzer? Did you implement SUMPS or?
[11:57:16] <ColdKeyboard> Can someone point me to the detailed SUMPS protocol documentation?
[12:18:41] <abcminiuser> Okies, need another brave soul for AS6 extension beta testing
[12:19:14] <bss36504> what now, jeez. <<Kidding, what's up?
[12:19:53] <abcminiuser> Update to my kajigger from yesterday
[12:19:57] <abcminiuser> Lemme upload it...
[12:20:08] <bss36504> kajiggler? I guess I missed the memo
[12:20:18] <bss36504> kajigger*
[12:21:47] <abcminiuser> http://fourwalledcubicle.com/files/temp/MarginOfError.vsix
[12:21:57] <abcminiuser> Kajigger is a technical term for a thingamy
[12:22:05] <abcminiuser> Install that into AS6, then compile crappy code
[12:22:32] <bss36504> what does this one do?
[12:23:04] <abcminiuser> Shows little error/warning icons next to lines that generated errors/warnings in the editor
[12:23:17] <bss36504> oooh neat. I like the name coice
[12:23:19] <abcminiuser> Which track the lines as you fix stuff, so you don't lose them
[12:23:27] <abcminiuser> Heh
[12:23:31] <abcminiuser> I like silly names
[12:23:44] <abcminiuser> So install it, then compile something with errors and/or warnings
[12:24:11] <bss36504> Well so far your stack usage tracer is working swimmingly
[12:24:40] <abcminiuser> Latest version with the async reads and improved detection?
[12:25:11] <bss36504> Actually i dont know. I have the one you tweeted about a while back
[12:25:58] <abcminiuser> Latest extension versions (may need to uninstall the ones you already have, only bump the version number when I release on the Atmel Gallery):
[12:26:00] <abcminiuser> http://fourwalledcubicle.com/files/temp/DataSizeViewer.vsix
[12:26:06] <abcminiuser> http://fourwalledcubicle.com/files/temp/BuildTaskbarOverlay.vsix
[12:26:11] <abcminiuser> http://fourwalledcubicle.com/files/temp/StackChecker.vsix
[12:26:16] <abcminiuser> http://fourwalledcubicle.com/files/temp/MarginOfError.vsix
[12:26:39] <bss36504> are you this bored that you write these extensions as well as your other stuff?
[12:26:44] <abcminiuser> Jupp :P
[12:26:56] <abcminiuser> Also it makes writing my other stuff easier
[12:27:06] <bss36504> That is true
[12:27:24] <bss36504> What is the Build Taskbar Overlay and the Data Size Viewer?
[12:28:31] <abcminiuser> Build Taskbar Overlay: Shows a overlay icon on the Windows7 taskbar when projects are building, built OK, built with warnings or built with errors
[12:28:46] <abcminiuser> So you can keep an eye on long builds without having to keep watching the build output
[12:28:56] <bss36504> Ah, well my VM is xp so I probably wont test that one.
[12:29:15] <abcminiuser> Data Size Viewer: Shows a list of text (flash) and data (ram) symbols from your project with their associated sizes
[12:29:25] <abcminiuser> So you can see how large your variables and functions are in the final binary
[12:29:31] <abcminiuser> And quickly jump to them
[12:29:37] <bss36504> Now that sounds handy
[12:29:53] <abcminiuser> Indeed, I wrote that first since I REALLY wanted it and got sick of asking
[12:30:35] <abcminiuser> It can color the two types of symbols, sort, gray-out imported symbols from libraries (like libc functions) and double-click to jump to them
[12:34:44] <bss36504> Well that's pretty nifty
[12:35:03] <bss36504> hey, semi related question, how much ram does LUFA use?
[12:35:16] <abcminiuser> Depends on the device
[12:35:24] <abcminiuser> For MEGAs, barely anything
[12:35:42] <abcminiuser> For XMEGAs, quite a bit depending on your settings (Endpoint banks are located in RAM)
[12:35:49] <bss36504> oh ok. I'd like to put FreeRTOS with LUFA on an Atmega32U2
[12:35:56] <bss36504> and run maybe 2 other tasks
[12:36:13] <abcminiuser> Well no need to worry about RAM from LUFA
[12:36:25] <abcminiuser> Just remember to save and restore the selected endpoint when you context switch
[12:37:02] <bss36504> I know the task overhead is 76Bytes plus whatever the task takes, but I wasnt sure about LUFA. I'll remember that. I'm still a ways off from that point, but I like to accumulate knowledge
[13:09:32] <ColdKeyboard> Can someone recommend windows software based serial port sniffer/
[13:09:32] <ColdKeyboard> ?
[13:09:47] <ColdKeyboard> I need to see what comannds is application sending to serial device, if possible
[13:10:16] <ColdKeyboard> SerialMon is not working for somereason... maybe because of win7 x64
[13:12:35] <Amadiro> ColdKeyboard, maybe wireshark can do it? It can sniff usb and ethernet
[13:12:51] <Amadiro> google also brings up portmon and "Eltima Serial Port Monitor"
[13:13:32] <Amadiro> http://ask.wireshark.org/questions/23243/how-do-you-capture-serial-com-communications I guess wireshark can't do it
[13:14:51] <ColdKeyboard> I have Eltima but it connects to the serial port instead of software sniffing so the other appliation reports port being in use...
[13:15:34] <Amadiro> ColdKeyboard, maybe it provides a new passthrough-port, and you have to configure the application to use that?
[13:19:43] <bss36504> ColdKeyboard: Maybe this? http://www.eterlogic.com/Downloads.html
[13:21:15] * megal0maniac_afk hugs his Saleae for the 3rd time this week
[13:21:28] <megal0maniac_afk> Tom_itx: ^ amiright??
[13:21:43] <megal0maniac> DX order arrived. Deeply disappointed.
[13:26:09] <megal0maniac> Haha! "Thanks to Microsoft Corporation policy, we need to pay $499 every year for the digital signature to make VSPE work on this platform."
[14:01:10] <megal0maniac> int pntMag = &mag;
[14:01:28] <megal0maniac> Returns a warning: assignment makes integer from pointer without a cast
[14:01:36] <megal0maniac> Can I ignore this?
[14:01:52] <N1njaway> What are you trying to do?
[14:02:15] <megal0maniac> Create a pointer to pass to other functions from main for data manipulation
[14:02:24] <N1njaway> int *pntMag = &mag;
[14:03:06] <megal0maniac> Okay, but what's the difference?
[14:03:13] <N1njaway> That makes a pointer of type 'int' that will be set to the address of 'mag', assuming 'mag' is also of integer type.
[14:03:22] <megal0maniac> No
[14:03:27] <megal0maniac> Mag is a double
[14:03:45] <megal0maniac> So my pointer should be a double then?
[14:03:45] <N1njaway> then "double *pntMag = &mag;"
[14:03:57] <N1njaway> Easiest way to think about pointers --
[14:04:11] <megal0maniac> (It doesn't follow logically to me, because *pntMag doesn't hold a "double" value, just an address)
[14:04:33] <N1njaway> A pointer is a pointer is a pointer. It is simply a memory address. A "void *" pointer is literally just the memory address without any type.
[14:05:05] <N1njaway> A generic pointer can point to ANYTHING, since it is just a memory address at the end of the day. A void pointer is a typeless pointer - i.e. memory address
[14:05:50] <megal0maniac> So then why give it a type at all?
[14:05:56] <N1njaway> A 'type' of pointer is ONLY relevant to the compiler, and assists with a few things, one of which is throwing warnings if you try to assign a pointer of a particular type to an object that is not of that type.
[14:06:06] <N1njaway> This helps to catch a lot of potential errors.
[14:06:29] <N1njaway> The second thing where 'type' is important is so the compiler knows how large the object that you are pointing at is in memory.
[14:07:03] <bss36504> I think that is probably the main point there (no pun intended). Without a type, how can you allocate the right amount of space?
[14:07:18] <megal0maniac> Yeah, that is a valid point
[14:07:24] <N1njaway> If you have an array of chars (1 byte) and you point to them, when you increment the pointer or do math with it, it can increment/decrement the pointer by the size of the object - in this case one byte.
[14:07:54] <N1njaway> If you have shorts, ints, etc then when the pointer is incremented to the next member, it can be increased/decreasted by the "sizeof(that type)"
[14:08:21] <megal0maniac> Making the pointers doubles gives "incompatible type", but pointers as ints work, even though the variables they're pointing to are doubles :?
[14:08:22] <N1njaway> bss: The size of a pointer of any type is always the same size.
[14:08:46] <N1njaway> mega: Yes, because the pointer is a pointer. You can override this functionality by typecasting.
[14:08:49] <N1njaway> For instance:
[14:08:57] <N1njaway> void *ptr; // a totally generic pointer
[14:08:59] <N1njaway> int x;
[14:09:06] <N1njaway> ptr = (void *)x;
[14:09:16] <Fornaxian> hmm...got some nifty samples from maxim today.
[14:09:24] <N1njaway> x = (int)*ptr;
[14:09:34] <Fornaxian> DMM chips.
[14:09:51] <bss36504> N1njaway: yes, but the thing it points at is not the same size. I was saying that if you didnt inform the compiler that you want an int (say, 32 bits) versus a char (8 bits) it wouldnt necessarily be able to get the whole number correctly.
[14:09:52] <N1njaway> The void pointer has no flavor/type to it, so you have to do typecasts on the conversions.
[14:09:58] <Fornaxian> just needs a microcontroller and display along with a handfull of caps and resistors and away I go.
[14:10:14] <bss36504> Fornaxian: neat-o
[14:10:36] <N1njaway> bss: Yes, the POINTERS are all the same size, but what they point TO are variable. That size information is necessary in order to certain things.
[14:10:38] <Fornaxian> 40pin dip package too.
[14:10:53] <Fornaxian> gonna make a usb interfaced dmm with one or more of them.
[14:11:06] <bss36504> N1njaway: Yeah, we're on the same page here, I think I just didnt phrase it right the first time
[14:11:18] <Fornaxian> primarily, I want to use it as an interface for an android device.
[14:11:20] <bss36504> Fornaxian: What chip?
[14:11:22] <N1njaway> GENERALLY the compiler is smart enough to infer the typecast you are trying to do so it knows how many bytes of memory, etc, that it needs to copy to registers, but it will warn you about this, because it can't always be 100% correct
[14:11:23] <megal0maniac> N1njaway: So then what is the correct way of doing this, then?
[14:11:34] <megal0maniac> I'm doing this in plain C
[14:11:41] <N1njaway> double x;
[14:11:43] <bss36504> megal0maniac: Be explicit, not lazy
[14:11:44] <Fornaxian> max133cpl+ and max134cpl+
[14:11:50] <N1njaway> double *ptrToX = &x;
[14:12:02] <megal0maniac> bss36504: I'm not lazy, just don't know what I'm doing ;)
[14:12:08] <N1njaway> function(double *doublePtr);
[14:12:22] <N1njaway> function(ptrToX); // calling it
[14:12:38] <bss36504> No no, i didnt mean it to be mean, but since you CAN be explicit, you should.
[14:12:51] <Fornaxian> http://net.pku.edu.cn/~course/cs101/2008/resource/The_C_Programming_Language.pdf megal0maniac,,,read that cover to cover..
[14:13:19] <N1njaway> And then when you are inside of function(), you use "*doublePtr" to refer to the double VALUE that doublePtr is pointing at.
[14:13:23] <megal0maniac> N1njaway: See, that doesn't work
[14:13:42] <Fornaxian> specifically, chapter 5, starting on page 100
[14:14:05] <N1njaway> mega:Which part isn't clear?
[14:14:32] <megal0maniac> It's totally clear, but it won't compile. "incompatible types when assigning to type 'double' from type 'double*'
[14:15:05] <megal0maniac> Fornaxian: I'm getting there, but I need to finish this wretched thing tonight. I've got everything down, except passing the parameters
[14:15:08] <N1njaway> If you want an excellent C/C++ hardcopy reference, I recommend finding a slightly older copy of Deitel & Deitel. Universities go through editions so fast with minimal changes that you can find the older copies for pennies on the dollar :)
[14:15:23] <megal0maniac> I actually have the Deitel book
[14:15:23] <N1njaway> mega: Post your code
[14:15:35] <N1njaway> Excellent :)
[14:16:08] <megal0maniac> http://pastebin.com/34wsKf1w
[14:16:52] * megal0maniac opens the book again
[14:16:55] <N1njaway> Thats odd
[14:17:04] <N1njaway> Oh, drop the leading *
[14:17:22] <N1njaway> http://pastebin.com/t38YWzTi
[14:17:25] <megal0maniac> Ooh! Not even a warning
[14:17:38] <N1njaway> If you have it on the seperate lines like tht for the assignments, you have to drop *
[14:17:54] <megal0maniac> Okay, so it isn't part of the variable name
[14:18:15] <N1njaway> In the case of "double *ptr = &value;" the *ptr in the beginning is specifying the type
[14:18:43] <megal0maniac> Gotcha
[14:20:35] <N1njaway> Cool :)
[14:21:43] <N1njaway> Happy to help!
[14:21:50] <N1njaway> Gotta jet out for a bit
[14:21:56] <megal0maniac> You're a wizard. Thanks!
[14:32:31] <megal0maniac> Whoo! All working. Now to check the conversion functions...
[14:35:51] <jadew> ColdKeyboard, if you're going to buy an analyzer, don't get anything with a buffer that samples at less than 24Mhz
[14:36:37] <jadew> you can get one that samples at 24Mhz and sends the data to the PC in real time, so theoretically infinite buffer
[14:37:18] * megal0maniac hugs his Saleae again
[14:37:48] <megal0maniac> I just wish it displayed captured data in realtime. But you can do that with Sigrok I guess
[14:38:00] <jadew> so... 20Msps and xMb buffer is not worth it
[14:38:12] <jadew> however, if you need higher sampling speed, then you'll probably need a buffer
[14:58:12] <jadew> megal0maniac, did you get the original or the clone?
[15:05:58] <megal0maniac> Original. It was a christmas present, and $50 less for students
[15:06:30] <megal0maniac> I don't regret it, although I'm starting to get annoyed at the stalled development
[15:06:47] <megal0maniac> The software is what really makes it good, and that hasn't been updated in quite some time
[15:12:59] <megal0maniac> Don't get me wrong, it's still great, but the software is what warrants them charging what they do for it. So I'd expect to see development a little more active, for what is essentially paid software. They provide device and analyzer SDKs, but I don't want to reinvent the wheel
[15:14:05] <jadew> I checked their software when I was in the market for a LA, wasn't that impressed, not for that price anyway
[15:14:30] <jadew> truth to be told, I wasn't impressed with anything out there, my guess is that only the bad ass ones have good software
[15:14:42] <jadew> by "bad ass" I mean Agilent and the like
[15:15:43] <megal0maniac> It reminds me a little of OSX, in that it's shiny and "just works". But not super duper feature rich.
[15:17:33] <jadew> yeah, I expect a lot more from a LA
[15:18:22] <jadew> never had the chance to try the agilent ones, but from the pictures they look really good
[15:18:30] <jadew> but the price is prohibitive
[15:20:01] <megal0maniac> Saleae caters for a pretty wide audience, though, you must admit. It has enough versatility and features to be pretty useful, even for more advanced folk, but it isn't mind-bogglingly over-complicated, like only top-end LAs can be
[15:20:26] <megal0maniac> I.e. you can do a lot with it, but it only takes 5mins to learn the software
[15:20:55] <megal0maniac> Which, for people (students) like me, is perfect
[15:21:00] <jadew> I suppose that's true
[15:21:36] <megal0maniac> If I had an Agilent, I'd spend more time showing off what it can do than actually using any of the features in practise :)
[15:21:44] <megal0maniac> Going running!
[15:22:15] <jadew> enjoy
[15:37:55] <megal0maniac> I didn't. But I guess that's why it's exercise? :P
[17:39:05] <megal0maniac> Yay! It's done. http://codepad.org/0Wl8ibuH
[17:48:16] <megal0maniac> "How do I determine OS at runtime?"
[17:48:19] <megal0maniac> "Attempt to run the program for some time. If it gets killed in a crash, you're on Windows. If the OS gets updated to 5G or a cat, you're on a Mac. If you get hacked after 180 days, it's Linux. Otherwise it's BSD."
[17:48:44] <bss36504> ^haha
[18:47:00] <w|zzy> lol