#avr | Logs for 2012-10-11

Back
[00:01:33] * r0b- is in desperate need
[00:01:43] <r0b-> hey rue_bed
[00:01:43] <r0b-> :P
[00:01:52] <rue_bed> yes?
[00:01:56] <r0b-> sup
[00:02:05] <rue_bed> cieling
[00:02:07] * r0b- is very pissed
[00:02:19] <rue_bed> cause you missed me?
[00:02:24] <r0b-> no
[00:02:25] <r0b-> :P
[00:02:26] <rue_bed> I cant remmeber your question
[00:02:35] * r0b- might have fucked his AVR Atmega328
[00:02:40] <rue_bed> ah
[00:02:44] <rue_bed> applied power backwards?
[00:02:47] <r0b-> running arduino and it wont USB program
[00:02:56] <r0b-> no that was the last one
[00:03:06] <r0b-> this one the bootloader bot messed up
[00:03:13] <rue_bed> ok, so reflash it
[00:03:17] <r0b-> im trying
[00:03:31] <rue_bed> not via usb
[00:03:32] <r0b-> using a slow programmer
[00:03:37] * r0b- has a buspirate
[00:03:38] <rue_bed> heh, slow
[00:03:46] <r0b-> but its all i got
[00:03:59] <rue_bed> if you have one of toms programmers, you can recover if you screw up the fuses
[00:04:24] <rue_bed> do you know if the clockrate for the board matches the firmware you tried to put on it?
[00:04:27] <r0b-> i dont
[00:04:33] <r0b-> yes
[00:04:38] <r0b-> its an Arduino uno
[00:04:38] <rue_bed> whats the speed of the crystal on it
[00:04:42] <r0b-> 16Mhz
[00:04:54] <rue_bed> your sure the firmware is set to 16Mhz?
[00:04:58] <r0b-> yes
[00:05:03] * r0b- hasnt had this issue
[00:05:10] <r0b-> till i started playing with ISP
[00:11:53] <r0b-> http://www.mouser.com/Search/ProductDetail.aspx?R=ATMEGA328P-PUvirtualkey55650000virtualkey556-ATMEGA328P-PU waaaaa
[00:12:26] <r0b-> eh bbl
[00:58:07] <OndraSterver_> heh
[00:58:15] <OndraSterver_> AVR MEGA (DIP) prices are huge, I know :P
[04:16:45] <edmont> hi
[04:17:36] <edmont> i'm trying to use the analog comparator in atmega128rfa1 withouth success
[04:18:28] <edmont> this is how i set it:
[04:18:37] <edmont> void ready_to_sample(void) {
[04:18:37] <edmont> DIDR1 |= (1 << AIN1D) | (1 << AIN0D); // Enable analog inputs (PE2-PE3)
[04:18:37] <edmont> ACSR |= (1 << ACIE); // Enable AC interrupt, toggle mode
[04:18:37] <edmont> DDRB |= (1 << 0); // Set LED as output
[04:18:37] <edmont> }
[04:19:00] <edmont> and this is the ISR:
[04:19:10] <edmont> ISR(ANALOG_COMP_vect) {
[04:19:10] <edmont> PORTB ^= (1 << 0); // Toggle the LED
[04:19:10] <edmont> }
[04:20:11] <edmont> then i put 0.8 V in AIN1 and a 2 Hz 800 mVpp, 0.8 Vdc sine wave in AIN0
[04:20:23] <Tom_itx> what is DIDR?
[04:20:31] <edmont> shouldnt i see the led blinking?
[04:21:02] <Tom_itx> also check the ISR names in the header file
[04:21:02] <edmont> Tom_itx: digital input disable register
[04:21:54] <edmont> Tom_itx: i chedked that the ISR is executing sometimes, if i let the imput catch noise
[04:22:06] <edmont> so i can see the led blinking
[04:22:19] <edmont> but not with the sine signal i want
[04:22:54] <Tom_itx> what's the comparator voltage set to?
[04:24:03] <edmont> 800 mV in negative input
[04:49:47] <mmp> Hell; I built usbasp programmer maybe a year ago; at that time worked fine; now after 1-2 years I pulled if back from shelf, but it stops with 'device not accepting address', although it presents itself as lowspeed device
[04:49:51] <mmp> *Hello :)
[04:50:20] <mmp> There were some places I had to resolder, but I think everything went just fine..
[04:50:42] <mmp> my question is -- does USBasp work correctly even in case when there is no target connected?
[04:59:09] <jadew> hey w|zzy, let me know if you want to try the alpha version of the logic analyzer
[04:59:18] <w|zzy> you tell me jadew :P
[04:59:25] <jadew> hey
[04:59:28] <w|zzy> maybe tonight... but if you give me access i can go for it :P
[05:00:40] <jadew> cool, I'll compile a release version now and I'll update it later, I'm doing the UART parser now so if you get it now, it won't have UART support
[05:00:52] <jadew> however it knows i2c, spi and 1wire - not fully implemented tho
[05:01:16] <jadew> anyway, the parsers are kinda low priority right now, since they're easy to write / fix
[05:02:28] <jadew> let me know if you need sample recordings
[05:03:15] <RikusW> jadew: what kind of hardware is involved ? FPGA ?
[05:03:34] <jadew> also, if you get to record other protocols while you're playing with it, please save them and send them to me, I only have access to i2c, spi, uart and 1wire
[05:03:42] <jadew> RikusW, the open bench logic sniffer
[05:03:44] <jadew> yeah
[05:06:40] <jadew> w|zzy: http://dumb.ro/files/lafront/OLSFront.zip
[05:07:26] <jadew> a few things that you might not find out right away (since it doesn't have a help file yet)
[05:07:57] <jadew> holding shift down will start taking under cursor measurements, showing you the distance in time between the sample changes on that channel
[05:08:07] <RikusW> http://www.codeproject.com/lounge.aspx?msg=4393767#xx4393767xx
[05:08:08] <jadew> shift + drag will let you select a piece of recording
[05:08:17] <w|zzy> jadew: what other protocols are there :p
[05:08:18] <jadew> and when it's done it will measure the frequency / time
[05:08:39] <jadew> w|zzy, didn't make a list :P can, lin stuff like that :)
[05:08:48] <RikusW> JTAG ?
[05:08:52] <jadew> jtag
[05:09:06] <w|zzy> ahhh
[05:09:10] <jadew> :)
[05:09:31] <jadew> another thing, when taking under cursor measurements, if you hold ctrl and you click
[05:09:37] <RikusW> irda ?
[05:09:37] <jadew> it will log that data into the log window
[05:09:47] <RikusW> but afaik irda is sort of uart
[05:09:58] <jadew> it might be
[05:10:31] <jadew> w|zzy, clicking on a cursor's header (on the top left side) it will position the view on the cursor
[05:10:40] <w|zzy> this is windows right?
[05:10:45] <jadew> yes
[05:10:49] <w|zzy> cool.
[05:10:54] <w|zzy> obviously i havent downloaded it yet
[05:11:00] <jadew> double clicking on decoded data (in the decoded data window) will position you at the start of the sample that generated that data
[05:11:03] <w|zzy> t
[05:11:14] <jadew> shift double clicking, it will position you at the end
[05:11:45] <jadew> ctrl + dbl click will position a cursor at the start of the sample, ctrl + shift + dblclick, at the begining
[05:11:53] <jadew> and I think you'll figure out the rest
[05:12:05] <jadew> this was a bit obscure so I had to mention it
[05:14:02] <jadew> for the protocol parsers, I'll write complete documentation on how to write them before I decide it's a final release, at the moment I keep adding stuff so it's pointless to write docs on that yet
[05:14:40] <jadew> pfew... can't believe I actually got to the alpha stage hehe
[05:14:53] <jadew> spent all my free time for the past month on this thing
[05:17:51] <w|zzy> I admire your drive
[05:18:20] <jadew> yeah, it's been quite challanging
[05:18:52] <w|zzy> what library did you use?
[05:18:57] <jadew> for what?
[05:19:38] <RikusW> jadew: so did you build it, or are you writing addon sw ?
[05:19:46] <jadew> I built it
[05:19:51] <jadew> wait
[05:19:53] <RikusW> nice :)
[05:19:56] <jadew> built what?
[05:19:59] <jadew> I built the app
[05:20:03] <jadew> the client
[05:20:06] <RikusW> ah
[05:20:10] <RikusW> and the actuall hw ?
[05:20:13] <w|zzy> yeah.. but what language/framework/libraries?
[05:20:23] <w|zzy> the hardware is the open logic sniffer
[05:20:36] <jadew> I bought the hw, I plan to support other hardware as well
[05:20:49] <RikusW> ah
[05:21:20] <w|zzy> visual c# jadew?
[05:21:24] <jadew> w|zzy, at first I started writting it using WTL, then I realized I can't get proper docking windows, not unless I would have spent a month doing them myself
[05:21:38] <jadew> so I switched to MFC for some parts
[05:21:46] <w|zzy> ok :)
[05:21:47] <jadew> so it's a MFC + WTL hybrid
[05:21:50] <w|zzy> it looks nice and loads
[05:22:04] <jadew> cool :)
[05:22:09] <jadew> did you sniff anything yet?
[05:22:13] <w|zzy> no.
[05:22:19] <w|zzy> i am using it on my desktop from my ipad :P
[05:22:26] <jadew> ah :P
[05:22:41] <w|zzy> yeah. damn thing cant plug cables in.
[05:23:06] <w|zzy> So this thing will remain a windows only client...
[05:23:12] <w|zzy> Not that that matters...
[05:23:39] <jadew> yeah, it's been a lot of work and I don't think I'll port it, however, I might make it work on wine
[05:24:05] <jadew> (if possible - not a promisse)
[05:24:15] <w|zzy> Yeah. Probably the best work around.
[05:24:22] <w|zzy> You never set out to make it cross platform
[05:24:33] <w|zzy> is it nice code or?
[05:24:44] <jadew> my code is always nice
[05:25:16] <w|zzy> :)
[05:25:44] <jadew> http://dumb.ro/files/lafront/current.png
[05:25:49] <RikusW> jadew: I've been working on a toolkit thats easily portable between win/lin for a while now, but its been dormant for even longer...
[05:25:51] <jadew> here's a screenshot with decoded data, i2c
[05:26:06] <jadew> RikusW, for UI?
[05:26:15] <RikusW> and there is still a LOT of work to be done, and the layouts is a bit buggy...
[05:26:15] <RikusW> yes
[05:26:20] <w|zzy> it looks a lot better than the "official"
[05:26:42] <jadew> w|zzy, my hope is that it works better than the alternatives :)
[05:27:01] <jadew> RikusW, sounds like a big project to take on
[05:27:06] <RikusW> yeah
[05:27:13] <RikusW> I started it end 2004
[05:27:23] <RikusW> but its been lying around for years
[05:27:24] <w|zzy> but technology has changed soo much since then
[05:27:31] <jadew> not that much really
[05:27:38] <jadew> win32 is the same
[05:27:43] <jadew> X api is probably the same
[05:28:02] <RikusW> its got a partial C++ parser for implementing signals/slots
[05:28:07] <w|zzy> in the cross platform gui world
[05:28:22] <jadew> RikusW, you could have made use of the boost signals
[05:28:27] <RikusW> and buttons checkboxs radiobuttons and tabcontrols is working
[05:29:14] <jadew> w|zzy it's mostly the same bloated stuff, but I suppose there's no other way to do it
[05:29:41] <w|zzy> bloat doesnt matter too much these days
[05:29:53] <w|zzy> computers are cheaper than developer hours
[05:30:04] <jadew> RikusW, do you create actual windows on windows? or handle that yourself?
[05:30:14] <RikusW> handle it myself
[05:30:15] <jadew> and have messages delivered to a single window?
[05:30:23] <RikusW> only a main window + popup windows
[05:30:26] <jadew> I see
[05:30:28] <RikusW> yes
[05:30:42] <RikusW> I do use clipping
[05:31:01] <jadew> yeah, that should solve the drawing issues
[05:31:17] <RikusW> I'll have a look at boost, by my signals are working jsut fine
[05:31:26] <RikusW> I didn't know about boost way back then
[05:31:54] <RikusW> actually it should work right without clipping too ;)
[05:32:02] <jadew> oh, that reminds me, w|zzy, you might encounter some flickering, I didn't take it out yet because it helps me spot out performance problems
[05:32:39] <RikusW> jadew: its very much like Qt, but minimal, the source is 10kloc, about 360kb
[05:32:40] <jadew> shouldn't be noticeable
[05:33:03] <jadew> RikusW, something like that would be great
[05:33:18] <jadew> but again, I'm fairly sure it's really big project to take on
[05:33:33] <jadew> you probably need to invest a full year in it to get something complete
[05:33:46] <RikusW> yeah
[05:33:59] <RikusW> I want to make it skinnable
[05:34:07] <w|zzy> jadew: That is HOT!
[05:34:09] <RikusW> currently it looks win95ish
[05:34:22] <jadew> w|zzy, what's hot? :)
[05:34:28] <w|zzy> Your program.
[05:34:31] <w|zzy> Running some i2c on it now
[05:34:35] <jadew> hehe, thanks
[05:35:00] <jadew> btw, ctrl + wheel to zoom, I guess you figured that out already :P
[05:35:04] <w|zzy> It is honestly a good quality peice of software
[05:35:14] <jadew> it's still alpha! :D
[05:35:27] <RikusW> jadew: there is a RFile / RCom (uart) class too, so written properly the app should be entirely portable
[05:35:27] <jadew> just wait for the beta lol
[05:35:44] <w|zzy> the time between pulse... When there isnt room to put it in there you should put it in the statusbar
[05:35:46] <vectory> i wonder why ltspice isnt ported to but instead supports whine, dont expect it to be easier this way around
[05:35:46] * RikusW needs to get a hold of MacOS now....
[05:35:53] <vectory> i dont anyway
[05:35:59] <jadew> w|zzy, good idea! thanks
[05:36:19] <w|zzy> :D im full of it.
[05:36:26] <jadew> hehe
[05:36:26] <w|zzy> I am really impressed.
[05:36:36] <jadew> I'm glad you like it
[05:36:57] <jadew> btw, you can click on an annotation
[05:37:16] <jadew> and then shift + click on another one to select the samples between the 2, in the decoded window
[05:37:25] <jadew> then you can right click on the decoded data and set a color
[05:37:44] <jadew> it makes it easier to figure out where the blocks of data are, when you have a lot of decoded data
[05:38:29] <w|zzy> little crap like that!
[05:38:42] <w|zzy> This going to be open source?
[05:38:49] <jadew> nope, sorry
[05:38:53] <w|zzy> thats fine.
[05:38:59] <w|zzy> freely released?
[05:39:03] <jadew> yes
[05:39:23] <jadew> so you like it eh?
[05:39:33] <w|zzy> Ill fiddle for a while longer... But i think you have a releasable product thus far!
[05:39:52] <w|zzy> Which could really help you come up with ideas from feedback
[05:40:35] <jadew> how does it compare with the other 2 alternatives?
[05:40:42] <w|zzy> craps all over them.
[05:40:47] <jadew> I thought so :)
[05:40:50] <w|zzy> sure some help files would be good.
[05:41:03] <w|zzy> In basic usability and interface!
[05:41:04] <w|zzy> bam
[05:41:59] <RikusW> jadew: it seems that my signal/slot syntax is cleaner than boost's
[05:42:19] <jadew> RikusW, yeah, the boost syntax is always a bit... hardcore :P
[05:42:42] <jadew> w|zzy, one thing on the todo list is to have the option of not showing the cursor's data on the left side, but instead add them in a toolbar
[05:42:46] <RikusW> I put SIGNAL(FuntionName)(int p1); inside a class
[05:42:56] <RikusW> or SLOT(Name)();
[05:42:58] <jadew> so if you have too many cursors, they won't eat up the space
[05:43:18] <jadew> ah, that's a macro
[05:43:24] <jadew> that's why it's nicer :P
[05:43:37] <RikusW> and whats more, a signal with 4 parameters can connect to a slot with less or no parameters, as long as the types match
[05:43:40] <w|zzy> :)
[05:44:11] <w|zzy> Well.. off to bed now. Once again, very impressed. you should consider releasing it to more people...
[05:44:25] <jadew> w|zzy, once it's ready :)
[05:44:33] <jadew> thanks a lot and good night
[05:44:59] <w|zzy> Stronger decoders and you'll be there :P
[05:45:00] <w|zzy> cya
[05:45:06] <RikusW> sending->Connect("sig(int,void*)",receiving,"slot(int)");
[05:45:07] <jadew> see ya
[05:45:44] <RikusW> I used text instead of function pointers
[05:45:50] <jadew> interresting
[05:45:54] <jadew> and you keep a table?
[05:45:57] <RikusW> yes
[05:46:00] <jadew> nice
[05:46:01] <RikusW> autogenerated
[05:46:09] <jadew> yeah
[05:46:31] <RikusW> the parser was fairly easy to construct
[05:47:07] <RikusW> But I have taken some shortcuts... only to have it come back and bite me ;)
[05:47:21] <jadew> shortcuts always do that :P
[05:47:26] <RikusW> the RString class COW is still incomplete...
[05:47:40] <RikusW> and string mem management too...
[05:48:27] <jadew> why are you doing that yourself?
[05:48:34] <RikusW> yes
[05:48:50] <RikusW> portability
[05:48:55] <RikusW> Qt has become a pain
[05:49:07] <RikusW> initially it was just a toy project
[05:49:13] <jadew> I mean about the memory management
[05:49:32] <jadew> I know the reasons why you started the project :)
[05:49:53] <RikusW> what other way is there with strings ?
[05:50:04] <RikusW> I don't want to be dependent on any particular lib
[05:50:45] <jadew> well, you could use std::string
[05:50:48] <jadew> and shared_ptr
[05:50:55] <jadew> if not from boost, your own implementation
[05:51:01] <RikusW> hmm
[05:51:04] <jadew> it's fairly simple to write a shared_ptr
[05:51:15] <jadew> are you familiar with it?
[05:51:41] <RikusW> no
[05:51:55] <jadew> something like this shared_ptr<std::string> = new std::string();
[05:52:04] <jadew> well, with a variable name there
[05:52:11] <jadew> let's say shared_ptr<string> x;
[05:52:35] <jadew> then, you can pass x to other functions and it would only copy a small ammount of data, the pointer and the counter
[05:52:50] <jadew> and if you go out of scope, the internal counter gets decremented
[05:53:03] <RikusW> http://sites.google.com/site/megau2s/home -> software -> RavrProg. it includes the RFile and RString parts
[05:53:07] <jadew> when it reaches to 0, it means no other part of the code is using that string anymore
[05:53:09] <jadew> so it deletes it
[05:53:33] <RikusW> reference counting
[05:53:39] <jadew> yes, that's the word
[05:53:52] <RikusW> Seems I have to have a closer look at STL indeed
[05:54:45] <jadew> yeah, it's part of the STL since c++11
[05:54:59] <RikusW> currently I read a text file and RString points into the file buffer
[05:55:10] <RikusW> but the COW bit should be set..
[05:55:58] <RikusW> and I prefer pointer + length instead or \0 termination
[05:56:12] <jadew> yeah, it's binary safe
[05:56:19] <jadew> std::string works like that
[05:56:24] <RikusW> its more flexible when manipulating strings, particularly if trimming strings thats COW
[05:56:53] <RikusW> Copy On Write
[05:58:06] <RikusW> I want it to work on older compilers too....
[05:58:07] <jadew> I think you could handle that trough function parameters alone, if you were using std::string
[05:58:46] <RikusW> the intention is portability
[05:58:55] <jadew> yeah, I get it
[05:58:55] <RikusW> maybe I could use C++11 for V2
[05:59:11] <jadew> are you still planning to work on it?
[05:59:18] <RikusW> yes
[05:59:44] <jadew> neat
[05:59:50] <RikusW> I need to fix the layouts a bit, its tricky code to make it all work right...
[06:00:20] <jadew> I bet, the UI is always a PITA
[06:00:22] <RikusW> I've got H / VBoxes and a Grid box too
[06:00:41] <jadew> sweet
[06:01:05] <RikusW> I use min / max sizes and recommended size
[06:01:20] <RikusW> will have to go over it all again
[06:01:29] <RikusW> its been years since I've worked on it...
[06:01:30] <jadew> it sounds like a great project
[06:01:36] <RikusW> thanks :)
[06:01:51] <RikusW> will try and get RavrProg working on it, and post it on the site
[06:02:04] <RikusW> its partly ported already
[06:02:24] <RikusW> had to create a combobox this week, there wasn't any :-P
[06:02:37] <RikusW> butthe menus does work
[06:02:44] <jadew> hehe
[06:02:58] <RikusW> so just modified the RPopup class and put a listview inside
[06:03:12] <RikusW> so the combobox is a composite control
[06:03:47] <RikusW> then there is a issue of Font handling
[06:03:59] <RikusW> in win it was easy, I used monospace
[06:04:07] <jadew> oh
[06:04:17] <jadew> the old font problem :)
[06:04:26] <RikusW> and there is a tree view too, and a working file system browser
[06:05:06] <RikusW> so the editbox works right in win, but the cursor is incorrectly position on lin...
[06:05:14] <RikusW> same to the textedit control
[06:05:23] <jadew> because of the text width?
[06:05:32] <RikusW> char width yes
[06:05:41] <jadew> there has to be a function in linux to measure that
[06:05:43] <RikusW> will have to fix that sometime
[06:05:58] <RikusW> it was another shortcut :-P
[06:06:11] <RikusW> I just used monospace as an easy way out..
[06:06:14] <jadew> in windows you have GetTextExtent
[06:06:18] <RikusW> yeah
[06:06:25] <RikusW> was too lazy for that :-P
[06:07:05] <RikusW> or I did use it to get the monospace width
[06:07:15] <jadew> when you deal with text that affects other stuff, you really have to measure it
[06:07:30] <jadew> I hate it because I think it eats CPU cycles
[06:07:37] <jadew> but I don't think it matters that much
[06:07:41] <RikusW> yeah
[06:07:59] <RikusW> I'll think I'll just create a portable RFont class
[06:08:09] <RikusW> and let that handle the messy stuff
[06:08:31] <RikusW> btw its called Rtk
[06:08:43] <jadew> tk?
[06:08:48] <RikusW> toolkit
[06:08:52] <jadew> got it :)
[06:10:11] <RikusW> jadew: are you using win or lin ?
[06:11:26] <jadew> my main OS is windows
[06:11:49] <RikusW> I used VC++5
[06:11:50] <jadew> but I'm using both, usually I'm using linux to write and compile stuff for the work servers
[06:11:59] <jadew> lol, that's old
[06:12:00] <RikusW> but its project files easily import into VS2010
[06:12:10] <jadew> yeah
[06:12:38] <jadew> I like 2005 better, but it has no support for c++11 and it's missing other stuff as well
[06:12:40] <RikusW> want a peek ?
[06:12:44] <jadew> sure
[06:12:52] <RikusW> im me an email address ?
[06:16:08] <jadew> let me know
[06:19:52] <Rikus1> jadew: the Rtk.dsw file is in the VS97 dir (or was it ds97...)
[06:20:34] <jadew> it's clean, I like it
[06:20:44] <jadew> ds97
[06:20:57] <RikusW> I renamed it to VS97
[06:21:00] <RikusW> thanks :)
[06:21:18] <RikusW> though there is a whole lot of cleaning up to do
[06:21:43] <RikusW> and my radio buttons can go accross multiple tabs
[06:21:58] <RikusW> use the scroll wheel on the first set of radio buttons ;)
[06:22:12] <RikusW> its linked to the first row on the next tab
[06:22:39] <RikusW> the tabs itself are "radio buttons" too, just change the drawing function to a toggle button instead
[06:22:59] <jadew> looking for the .exe
[06:23:08] <RikusW> you'll have to compile
[06:23:13] <jadew> I did
[06:23:23] <RikusW> in win it will be in ds97/Release or something
[06:23:32] <RikusW> or just use F5 in VS
[06:23:54] <jadew> I know, I wanted to see how big it is
[06:24:01] * RikusW likes the win wheat theme :-P
[06:24:06] <RikusW> as you can see.
[06:24:38] <jadew> it's very responsive
[06:24:49] <RikusW> all drawing stuff is in drawman.cpp
[06:24:53] <RikusW> good :)
[06:25:07] <RikusW> I designed it to be as lightweight as possible
[06:25:19] <RikusW> and made it scroll wheel aware too
[06:25:44] <RikusW> the scroll bars are a bit buggy
[06:26:00] <jadew> they're ok
[06:26:07] <RikusW> do you have any idea how difficult it is to decide how to calculate the length of the bar ?
[06:26:13] <jadew> you should keep them highlighted while you have the capture
[06:26:23] <jadew> haha, I DO
[06:26:26] <RikusW> that would be easy to do
[06:26:42] <jadew> for the logic analyzer client I had to deal with HUGE scroll widths
[06:26:53] <jadew> so big that it overflowed the windows's cliprect
[06:26:54] <RikusW> ah
[06:26:59] <RikusW> oops
[06:27:02] <jadew> so I couldn't rely on the native scrolling
[06:27:16] <jadew> I had to build the scrolling behavious from the ground up
[06:27:25] <jadew> *behaviour
[06:27:51] <RikusW> sounds like effort..
[06:28:49] <RikusW> I intended Rtk for use in admin app and so on
[06:28:59] <RikusW> so no fancy stuff,... yet...
[06:29:04] <jadew> yeah, it can now scroll trough 9 million trillion units :P
[06:29:25] <RikusW> might add it later, once its more functional
[06:29:36] * RikusW prefer functionality over looks
[06:29:44] <RikusW> unlike some other big companies :-P
[06:29:46] <jadew> same here
[06:30:04] <RikusW> it seems their sw version number == unusability index :-P
[06:30:05] <jadew> but you shouldn't completely discard looks :)
[06:30:15] <RikusW> that will come later
[06:31:13] <RikusW> like win7 basic, its just a broken version of XP :S
[06:31:27] <RikusW> not even basic stuff like mmc works anymore
[06:31:35] <RikusW> its an admin's nightmare
[06:32:04] <jadew> I don't know win7 basic, but I'm pretty happy with my win 7
[06:32:46] <jadew> very stable
[06:32:51] <jadew> oh, I do have a complaint
[06:33:06] <jadew> my raid 1 stopped working properly and I have no clue why, there are no errors, no nothing
[06:33:17] <RikusW> typical
[06:33:51] <RikusW> MS stuff works until it doesn't anymore, and then it very difficult or impossible to fix, unless you count reinstall as fixing...
[06:34:21] <jadew> that's not gonna happen for a while, it takes me days to get everything back
[06:34:26] <RikusW> Rtk looks almost the same in Linux, the font is a bit different
[06:34:39] <RikusW> thats the problem with reinstalls :S
[06:36:23] <jadew> speaking of drawing, the analyzer diagram was particularly painful
[06:36:46] <jadew> I'm sure I can make it better, but damn...
[06:37:02] <jadew> the problem wasn't the drawing itself
[06:37:39] <jadew> but the ammount of drawing, cuz you could have a shitload of lines in there, when zoomed out
[06:38:05] <jadew> I wonder how the other analyzers are doing it
[06:38:18] <RikusW> hmm
[06:38:22] <RikusW> graphs..
[06:38:31] <RikusW> I've done some in xlib code
[06:38:39] <RikusW> just playing around
[06:38:57] <RikusW> but still repesenting a zoomed out one with 100 000 points....
[06:38:59] <jadew> the thing is that you could have 100 lines on the same pixel, so you can't draw them all no matter what
[06:39:20] <RikusW> I'll draw a vertical line from min to max
[06:39:41] <jadew> min and max beeing?
[06:39:50] <RikusW> top + bottom
[06:40:15] <RikusW> highest line + lowest line
[06:40:39] <jadew> the problem is figuring out which one is first and which one is last
[06:40:58] <jadew> you have both zoom and scroll
[06:41:09] <RikusW> just run all 100 points through a min / max function
[06:41:32] <jadew> pretty much what I did, but it's not as simple as it sounds
[06:41:36] <RikusW> and you have to know how many points per pixel
[06:41:36] <jadew> when you're zoomed out
[06:41:50] <jadew> you could have a block of filled stuff
[06:41:58] <jadew> but if you invalidate one line
[06:42:00] <RikusW> how many points are we talking about ?
[06:42:04] <jadew> you have to draw the exact same thing
[06:42:14] <RikusW> 1M ?
[06:42:19] <RikusW> 10M ?
[06:42:24] <jadew> something like that
[06:42:29] <jadew> 1 to 10M
[06:42:44] <RikusW> can be an interesting problem to solve
[06:42:47] <jadew> so you can't do the math from the begining of the stack
[06:42:58] <jadew> since you're zoomed out, but also scrolled
[06:43:17] <jadew> and you have to draw the exact same thing on the exact same line
[06:43:34] <jadew> which means you have to go back to calculate this thing, the right ammount of samples
[06:43:47] <RikusW> I'll probably add a graph control to Rtk later, that will be one of the non-themed controls
[06:43:54] <jadew> otherwise, you move the cursor and start invalidating lines, you could end up with white lines
[06:44:07] <RikusW> although the drawing function could still be overridden
[06:45:19] <RikusW> I want to be able to replace the drawing function for say 1 button or all buttons, LIVE
[06:45:58] <jadew> well, that could easily be handled by the client software
[06:46:03] <RikusW> And I'll probably add something like XUL too
[06:46:04] <jadew> unless you have something in mind
[06:46:11] <jadew> *something else
[06:46:17] <RikusW> it can
[06:46:40] <jadew> like, if (b) { parent->draw(); return; }
[06:47:02] <RikusW> I have a draw functor
[06:47:12] <RikusW> which can easily be changed
[06:47:19] <jadew> if you want to implement themes, you need a thing that draws different backgrounds and borders
[06:47:29] <jadew> and you'll have to use that object when you're drawing the controls
[06:47:31] <RikusW> yeah
[06:47:56] <RikusW> or just write a bitmap draw manager, and use bitmapped themes
[06:48:03] <RikusW> or better vector graphics
[06:48:04] <jadew> again, sounds like a lot of work
[06:48:22] <RikusW> thats why its left for later...
[06:49:12] <RikusW> using vector graphics will shift the work from code to data :)
[06:50:14] <jadew> vector graphics could also mean slower drawing
[06:50:47] <jadew> but it's good to have it around
[06:51:41] <RikusW> well theres many ways to get the controls drawn :-P
[06:51:56] <RikusW> will figure that out later
[06:51:59] <jadew> yeah
[06:52:34] <jadew> it would be nice if you'd finish it, altho I stay away of this huge personal projects, because I know I don't finish them
[06:53:00] <jadew> especially when I get close to the end, that's when I give up
[06:53:38] <jadew> I started writting a language once, sort of like php, but not stupid
[06:54:14] <jadew> got it to actually run stuff, instantiating classes, inheritance all that
[06:54:18] <jadew> and I gave up
[06:54:45] <RikusW> why ?
[06:54:50] <RikusW> to much work ?
[06:55:08] <jadew> don't know, too much work left + I lost the interrest once I realized I can do it :P
[06:55:32] <RikusW> yeah :-P
[06:55:33] <jadew> and I guess I didn't need it that much to keep me going
[06:55:50] <jadew> with the analyzer, I used a trick, otherwise I would have given up on it as well
[06:56:01] <RikusW> I need Rtk for RavrProg right now, at least basic functionality
[06:56:10] <jadew> I only wrote the protocol parsers when it was close to ready
[06:56:34] <jadew> because I knew that if I had those at an earlier stage, I could have used it to finish my primary project (the reason why I built the analyzer)
[06:57:23] <jadew> and I just delay the moment in which I'm actually going to use it for.. basically what I built it
[06:57:37] <jadew> it's a good trick
[06:58:19] <jadew> I employ it on all my personal projects
[06:59:38] <jadew> I'm actually doing all this, got into avr, bought an oscilloscope, built lots of crap, bought more crap, wrote software, etc, because I need all of this for my main project: a thermometer lol
[07:01:00] <RikusW> ah
[07:01:34] <jadew> if I were you I wouldn't finish RavrProg, instead I'd be like "I can't finish that one, because Rtk is not ready"
[07:01:39] <RikusW> seems like motivation on personal projects is a bit of an issue for all of use :-P
[07:01:56] <jadew> yeah, it's because we're doing it for the challange
[07:02:01] <RikusW> thats why I used Qt at first
[07:02:26] <RikusW> but got it to work fairly well
[07:02:39] <RikusW> even with Atmel USB programmers using libusb
[07:02:47] <RikusW> libusb is actually very easy to use
[07:02:55] <RikusW> unexpectedly easy :)
[07:02:55] <jadew> yeah, I've used it as well
[07:03:22] <RikusW> easier than the linux serial port api in fact
[07:03:44] <jadew> you mean the io ctl stuff?
[07:03:49] <RikusW> yeah
[07:03:54] <RikusW> I like libusb better
[07:04:02] <RikusW> its timeouts works at least
[07:04:12] <jadew> it's why I didn't even think about making this program for linux
[07:04:20] <jadew> because I realized I can't use linux for this stuff
[07:04:24] <RikusW> I had much trouble with linux serial ports..
[07:04:30] <jadew> I want arbitrary baud rates
[07:04:48] <jadew> getting that in linux is insanly hard
[07:04:50] <RikusW> the newer kernels are supposedly better
[07:04:54] <jadew> I know
[07:06:09] <dfffbv> avrdude
[07:06:11] <dfffbv> lol
[07:06:42] <jadew> what about it?
[07:06:43] <RikusW> heh, I'm working on the avrdude replacement :-P
[07:06:57] <dfffbv> I'm about to get into avr programming is all
[07:07:13] <dfffbv> and nice *Rikus
[07:07:33] <Richard_Cavell> RikusW: Is there something other than avrdude?
[07:07:38] <Richard_Cavell> And the Atmel Studio tools
[07:08:19] <RikusW> RavrProg
[07:08:27] <RikusW> its alpha sw atm
[07:08:52] <RikusW> Richard_Cavell: do you use Linux ?
[07:08:52] <Richard_Cavell> are you making it?
[07:08:56] <RikusW> yes
[07:08:57] <Richard_Cavell> RikusW: I do sometimes yes
[07:09:15] <Richard_Cavell> What's wrong with avrdude? It does everything
[07:09:29] <RikusW> I wanted a GUI
[07:09:33] <RikusW> mine use Qt4
[07:09:36] <RikusW> and soon Rtk
[07:09:44] <Richard_Cavell> so build a GUI around AVRDude
[07:09:51] <RikusW> no
[07:09:58] <RikusW> a custom lib -> RavrProg
[07:10:07] <RikusW> written from scratch
[07:10:15] <RikusW> about 8000 lines now
[07:10:42] <dfffbv> that sounds like a lot of work
[07:10:47] <RikusW> Richard_Cavell: http://sites.google.com/site/megau2s/home -> sw -> RavrProg
[07:10:50] <RikusW> it was
[07:11:13] <RikusW> Richard_Cavell: it would be nice it you could test STK600 support ;)
[07:11:20] <RikusW> ISP should work
[07:11:29] <RikusW> JTAG, well I need to fix some stuff
[07:11:42] <Richard_Cavell> sure mate
[07:11:54] <RikusW> since STK600 and AVRISP mkii ISP protocols is nearly the same
[07:11:56] <RikusW> it should work
[07:12:32] <RikusW> you'll need the Qt4 dev files and libusb-0.1.12 (or 0.1.4) + dev files for Linux
[07:12:42] <RikusW> qmake, then make
[07:13:00] <Richard_Cavell> where exactly is the software?
[07:13:03] <jadew> I have to start work for my job, see ya
[07:13:07] <RikusW> I had much trouble getting it to work in win...
[07:13:18] <RikusW> on my site ?
[07:13:37] <RikusW> supporting software page
[07:13:45] <RikusW> at the bottome
[07:14:08] <Richard_Cavell> ok
[07:14:10] <Richard_Cavell> looks complicated
[07:14:15] <Richard_Cavell> I'll give it a go this weekend
[07:14:21] <RikusW> ok
[07:15:11] <RikusW> afk
[07:27:40] <RikusW> Richard_Cavell: it does support all atmel programmers
[07:27:49] <RikusW> except for jtagice 3 and avrone!
[07:28:14] <RikusW> if the jtagice 3 simply use mkii protocol adding support for it will be trivial
[08:09:59] <JViz> at90usb1287 = at90usb1286 + otg?
[08:13:42] <JViz> so everything that works for the 1287 works for the 1286, except for otg mode?
[08:18:13] <JViz> anyone ever try using arduino libraries outside of arduino?
[08:18:26] <theBear> god no !
[08:18:52] <JViz> please elaborate
[08:21:16] <theBear> like many, i feel the arduino libs are a needless abstraction and simply cause more confusion and make it harder for people like me to help people with problems
[08:22:06] <JViz> oh, it's not out of some kind of artificial difficulty?
[08:22:32] <theBear> not as such, they just seem unnecesarry
[08:24:13] <RikusW> JViz: yes
[08:24:24] <RikusW> there is 646 and 647 too
[08:24:37] <JViz> 646 and 647?
[08:24:55] <RikusW> at90usb646
[08:25:21] <JViz> oh
[08:25:34] <JViz> ah
[08:25:42] <RikusW> xmega usb chips is likely to be cheaper
[08:25:56] <RikusW> ATxmega256A3U for example
[08:29:20] <JViz> i already have a teensy
[08:29:50] <JViz> i'm trying to find a more complete USB stack that works with it
[08:30:33] <JViz> the arduino libraries that it comes with are more complete than the C libraries it comes with
[08:33:52] <RikusW> LUFA
[08:36:07] <JViz> wow f'ck yeah
[08:36:24] <theBear> lol
[08:53:31] <theos> :P
[08:59:58] <karlp> JViz: it's ok, I use ard libs outside ard
[09:00:23] <karlp> it works ok, but far too much makfile hackery
[09:03:15] <RikusW> I just use asm instead :-P
[09:04:07] <mshroyer> hello... does anyone here know how to convert CodeVisionAVR / AVR Studio COFF debug info into ELF so that it can be used by avr-gdb?
[09:04:29] <RikusW> is that even supposed to be done ? ;-P
[09:04:34] <mshroyer> RikusW: probably not :)
[09:04:58] <RikusW> no idea, haven't had a reason to try that
[09:05:06] <mshroyer> I have a program written in CodeVisionAVR which I'd like to debug with the GNU toolchain and simulavr
[09:05:22] <RikusW> can't it be compiled with avr-gcc ?
[09:06:07] <RikusW> there is avr toolchain downloads on atmel.com
[09:06:15] <mshroyer> yeah figured it was a weird request, I've seen examples of using avr-objcopy to go from ELF to COFF but not the other way around
[09:06:28] <vectory> cant gdb handle the coff?
[09:06:33] <RikusW> just read the objcopy docs
[09:06:37] <RikusW> you might get lucky
[09:06:54] <mshroyer> vectory: it can't directly, at least when I tell it to it complains about an unrecognized format
[09:08:09] <mshroyer> RikusW: yeah I gave that a naive go, avr-objcopy -O elf32-avr --debugging blah.cof blah.elf
[09:08:29] <mshroyer> but it complained about an address out of bounds
[09:12:21] <mshroyer> and as for your other advice, yeah I could definitely give a more earnest attempt to recompile it with avr-gdb... it's just that I'm a complete newbie w/ AVR and there are scary #pragmas in there that I don't understand, so was wondering if I could easily avoid it :)
[09:23:17] <JViz> is it better to add lufa into my project or add my project into lufa?
[09:26:41] <RikusW> JViz: good question
[09:26:44] <JViz> hmm
[09:26:56] <RikusW> it your project is small it might be easier to add it to lufa
[09:26:57] <JViz> probably better to put lufa in my project
[09:27:07] <JViz> yeah, i also found this
[09:27:17] <JViz> http://elasticsheep.com/2009/04/testing-the-lufa-library-on-the-teensy/
[09:27:42] <JViz> i downloaded his project and it looks like it's just a few lufa files
[09:28:50] <RikusW> ask abcminiuser when he is around, he's the LUFA author
[09:29:11] <RikusW> though since starting to work at Atmel he isn't around much
[09:29:20] <JViz> oh wow
[09:29:24] <JViz> he's working for atmel?
[09:29:29] <RikusW> yes
[09:29:39] <RikusW> application development for AVR
[09:29:50] <RikusW> he started this year
[09:30:05] <RikusW> seems he does some customer support too
[09:32:14] <JViz> well it seems that LUFA has changed since that demo was made
[09:32:25] <JViz> but i'm going to try to add it into my project anyway
[09:37:01] <RikusW> or use an older version of LUFA
[09:37:27] <RikusW> the newer LUFA versions was changed to support multiple archs
[09:59:18] <JViz> man, i need to learn more about makefiles
[10:00:47] <JViz> bye rikus
[10:50:45] <megal0maniac> !seen abcminiuser
[10:50:45] <tobbor> abcminiuser was last seen in #avr on Oct 06 12:33 2012
[11:06:03] <OndraSterver_> drinking
[11:06:04] <OndraSterver_> probably
[11:06:10] <OndraSterver_> wait, it is still only thursday :(
[11:06:37] <OndraSterver_> I need to drink
[11:06:38] <OndraSterver_> a lot
[11:06:42] <OndraSterver_> otherwise I am going to murder somebody
[11:06:47] <OndraSterver_> after last math logic class
[11:06:48] <OndraSterver_> ..
[11:06:53] <OndraSterver_> and still one more lesson to go today"
[11:06:55] <OndraSterver_> bloody hell
[11:12:25] <megal0maniac> OndraSterver_: Come drinking with me :)
[11:12:33] <megal0maniac> I'm not *that* far away
[11:12:41] <megal0maniac> And I'm not going by myself
[11:15:47] <theos> OndraSterver_ like i used to think "if this prof doesnt stop teaching, either i will jump outside the window or throw him". that kinda feeling?
[11:16:00] <theos> :D
[11:19:48] <OndraSterver_> much worse
[11:22:20] <OndraSterver_> afk
[11:22:32] <OndraSterver_> math analysis class.
[11:24:50] <tmpvar> has anyone ever messed with a TLC5971?
[11:55:32] <tld> tmpvar: usually better to just ask what you're wondering about.
[12:00:38] <t4nk149> can anyone help me with some questions
[12:01:12] <megal0maniac> t4nk149: Only if you ask them
[12:01:17] <megal0maniac> Otherwise no.
[12:01:22] <t4nk149> :D
[12:01:38] <t4nk149> DDRB = DDRB & 0b11111101; // pin 1 of port B is input..
[12:01:47] <t4nk149> i dont understand this code.. why is it input
[12:02:03] <megal0maniac> DDR stands for Data Direction Register
[12:02:33] <megal0maniac> So its contents determine the direction of data. i.e. input or output
[12:02:36] <t4nk149> yeah i know it controls the pin direction
[12:02:38] <t4nk149> yes :)
[12:03:17] <megal0maniac> So, what you're doing there, is setting the whole register. You're making every pin output except for PIN B1
[12:03:30] <megal0maniac> Because 1=output and 0=input
[12:03:48] <megal0maniac> And as is customary with numbers, you start from the right
[12:04:07] <t4nk149> yes i understand that.. DDRB = 0b11111101 but couldt i just write ?
[12:04:11] <megal0maniac> So 0b11111101 affects pins 876543210
[12:04:29] <megal0maniac> Yeah, you could
[12:04:46] <t4nk149> its the same ?
[12:05:57] <t4nk149> ?
[12:06:45] <megal0maniac> The same as what?
[12:07:15] <tmpvar> tld, honestly I'm looking for some code to test out a breakout i've etched. My scope is busted (new one incoming tomorrow), so right now im just shoving bits into a void with no real way to debug :/
[12:07:20] <t4nk149> as DDRB = DDRB & 0b11111101
[12:07:56] <megal0maniac> Ah
[12:08:04] <megal0maniac> t4nk149: Do you know what & does?
[12:08:12] <t4nk149> yes
[12:08:26] <megal0maniac> Well then that's why it's different
[12:08:38] <t4nk149> i dont get it...
[12:08:52] <t4nk149> :S
[12:08:55] <megal0maniac> Also, in C, usually it's written DDRB &= 0b11111101
[12:09:09] <megal0maniac> It's the same as DDRB = DDRB & 0b11111101
[12:09:42] <t4nk149> yes i know... but i dont understand why i cant write DDRB = 0b11111101 :
[12:10:06] <t4nk149> isnt it the same ?
[12:10:17] <megal0maniac> No.
[12:10:25] <t4nk149> can you please exlapin the diff
[12:10:43] <megal0maniac> DDRB = 0bwhatever sets the register to 0bwhatever
[12:11:05] <megal0maniac> It doesn't care about what the current value is
[12:11:07] <t4nk149> yes ?
[12:11:13] <t4nk149> oh i see
[12:11:42] <megal0maniac> If you use &, then it ANDS the existing value and the one you're setting, bit by bit, and sets it accordingly
[12:12:08] <t4nk149> so DDRB = 0b11111101 would ALWAYS make pin B1 input and the rest output ?
[12:12:13] <megal0maniac> Yes
[12:12:25] <megal0maniac> Regardless of what DDRB is currently set to
[12:12:38] <t4nk149> yes .. but & looks at current value
[12:12:39] <t4nk149> ?
[12:13:41] <t4nk149> right?
[12:13:49] <megal0maniac> If the current value of DDRB was 0b00001111 and you set it to 0b11111101 with AND, then you'd get 0b00001101
[12:14:04] <Tom_itx> t4nk149, http://tom-itx.dyndns.org:81/~webpage/avr/c_bits/bits_index.php
[12:14:15] <megal0maniac> Yes, read that
[12:15:07] <t4nk149> okay just a few more questions,
[12:15:22] <RikusW> So I ordered a SIM900 GPRS modem and PA6H GPS from www.otto.co.za today :)
[12:15:37] <megal0maniac> RikusW: Wow. It's been a long time coming :P
[12:15:50] <RikusW> megal0maniac: its not even that expensive, the dev kits are considerably more expensive
[12:15:55] <RikusW> yeah
[12:16:00] <megal0maniac> What is cattle worth?
[12:16:06] <megal0maniac> I honestly have no idea
[12:16:09] <RikusW> about R3000 each
[12:16:19] <RikusW> or more depending on weight
[12:16:40] <RikusW> I've sold a few cows with small calves for R6000
[12:16:44] <RikusW> each
[12:17:32] <RikusW> 2 year old calves go for R15 to R20 per kg live weight
[12:17:58] <megal0maniac> It's less than I thought.
[12:18:04] <megal0maniac> t4nk149: Are you waiting?
[12:18:19] <RikusW> weighing 200 to 300 kg or more depending on breed
[12:18:47] <RikusW> megal0maniac: the meat is about half or less of that weight
[12:19:04] <RikusW> but still, the supermarkets are overcharging you a bit :-P
[12:19:40] * megal0maniac will buy his meat from RikusW from now on
[12:20:01] <RikusW> megal0maniac: you can easily check current prices in the "Landbouweekblad"
[12:20:17] <RikusW> there is a "Markneigings" section in the yellow pages
[12:20:21] <t4nk149> DDRC = DDRC | 0b10000000 // pin 1 of port C is output..... why is only pin 1 output ? ... .couldt it be all of DDRC was 0xff... in fact which value does DDRC have if this is the first code in my program
[12:20:32] <RikusW> "market tendencies"
[12:20:53] <t4nk149> of = if
[12:21:13] <t4nk149> couldt it be all = couldnt all pins be output
[12:21:16] <RikusW> megal0maniac: 7/9 it was about R16.60/kg
[12:21:37] <RikusW> and maize is around R2500/ton
[12:22:01] <RikusW> fish meal is expensive, like R14000/ton
[12:22:16] <RikusW> three zeros yes...
[12:22:33] * megal0maniac has never heard of fish meal
[12:22:51] <t4nk149> DDRC = DDRC | 0b10000000 // pin 1 of port C is output. why is only pin 1 output ? ... couldnt all of the others pins also be output... for example if DDRC was ob11111111 ??
[12:23:18] <RikusW> mutton is like R45/kg meat for class A2/A3 and R39 for B2/B3
[12:23:28] <megal0maniac> t4nk149: pin 1 would be set to output if DDRC was 0b00000010
[12:23:29] <t4nk149> the 0b11111111 ored with 0b10000000 = 11111111 right ?
[12:23:37] <t4nk149> i mean pin 7 sorry
[12:23:58] <megal0maniac> Then it must be ORing with 0x00
[12:24:03] <RikusW> and pig is like R15/kg
[12:24:10] <t4nk149> how can i now its oring with 0x00
[12:24:12] <t4nk149> :S
[12:24:31] <t4nk149> is that the standard value of DDRX ? '
[12:24:36] <RikusW> megal0maniac: somewhere along the line someone is making excessive profits...
[12:24:41] <t4nk149> or what is the value of DDRX if i havnt programmed it
[12:25:04] <megal0maniac> I think it's 0x00
[12:25:10] <megal0maniac> RikusW will know :)
[12:25:24] <RikusW> megal0maniac: fish meal is the leftovers from the fishing industry thats dried and milled and fed in particular to chickens
[12:25:39] <t4nk149> ?.d
[12:25:57] <RikusW> DDRX ?
[12:26:22] <megal0maniac> RikusW: They must be. Retail pricing is excessive compared to that
[12:26:29] <RikusW> its 1<< by the 0 based bit position
[12:26:46] <t4nk149> ?
[12:26:56] <RikusW> megal0maniac: not to even talk about biltong at R190/kg....
[12:26:57] <megal0maniac> RikusW: What is the default, uninitialized value of a DDR?
[12:27:04] <RikusW> I think 0
[12:27:08] <RikusW> its in the ds
[12:27:14] <megal0maniac> t4nk149: There you go
[12:27:18] <megal0maniac> Read the datasheet as well
[12:27:27] <RikusW> most registers default to 0
[12:27:32] <megal0maniac> And there's no point in ORing if you haven't set it to anything yet...
[12:27:36] <mmp> Hello, anyone knows whether usbasp should work correctly on USB even if there is no target connected? (accept device number, etc.)
[12:27:37] <RikusW> unless otherwise specified in the ds
[12:27:52] <t4nk149> thaaaaaanks without knowing the default value ? how could i ever program something ?
[12:28:04] <megal0maniac> t4nk149: Initialize it?
[12:28:09] <RikusW> t4nk149: on first assignment I prefer to use = instead of &= or |=
[12:28:15] <RikusW> then you're sure of its value
[12:28:43] <t4nk149> yeah exatly.. but why should i ever use &= o or `= when i can just use =
[12:28:53] <megal0maniac> t4nk149: You don't need &= or |= unless you don't want to change a value which you know you've set
[12:29:15] <RikusW> t4nk149: there is situations where you need |= and &=
[12:29:32] <megal0maniac> You're not necessarily going to set thing statically every time. So you might not know what the values are, but you know how you want to change it
[12:29:48] <t4nk149> i see
[12:29:54] <t4nk149> okay heh!! thank you so much, i think i have to read some more and think...
[12:29:57] <t4nk149> thank you
[12:30:01] <RikusW> t4nk149: its used to change a single bit without disturbing others
[12:30:05] <megal0maniac> t4nk149: Read datasheets
[12:30:29] <megal0maniac> mmp: Why would you want to try and connect to a programmer, without a target?
[12:30:50] <RikusW> mmp: the usb side should enumerate
[12:30:50] <megal0maniac> Also that link from Tom_itx
[12:31:40] <t4nk149> yeah i wil look at it ,d
[12:31:44] <t4nk149> thanks.
[12:31:54] <t4nk149> i probably will return anonoying u some more
[12:32:22] <megal0maniac> t4nk149: It'll only be annoying if you ask us stuff which is in the datasheet ;)
[12:32:43] <megal0maniac> Think of it as your AVR bible
[12:32:48] <t4nk149> stupid question.. do you mean the datasheet of my avr ?
[12:32:58] <t4nk149> ah okay
[12:33:02] <megal0maniac> Yes. Which one do you have anyway?
[12:33:12] <RikusW> t4nk149: its generally written as DDRC |= (1<<DDC1) | (1<<DDC0);
[12:33:20] <t4nk149> atmel32 ?.
[12:33:30] <RikusW> or DDRC &= ~((1<<DDC1) | (1<<DDC0));
[12:33:33] <t4nk149> mega
[12:33:33] <megal0maniac> Atmel ATmega32
[12:33:35] <RikusW> ATmega
[12:33:38] <t4nk149> yeah
[12:33:41] <t4nk149> atmega32
[12:34:00] <RikusW> hex is permissible with PORT DDR and PIN registers I'd say
[12:34:09] <RikusW> but do use proper bit names with other registers
[12:34:26] <mmp> megal0maniac: because it does not work even with target connected and I need to do some basic debugging stuff and see what is the real problem :)
[12:34:46] <RikusW> t4nk149: if you look in the headers you'll see #define DDC4 4 etc
[12:34:46] <t4nk149> proper bit names?
[12:34:47] <megal0maniac> mmp: Define "does not work"
[12:35:00] <RikusW> t4nk149: the ones listed in the datasheet
[12:35:13] <RikusW> its also in the AVR header
[12:35:28] <RikusW> t4nk149: so you have a mega32 ?
[12:35:37] <RikusW> I have a free jtag ice mki for you
[12:35:38] <mmp> megal0maniac: does not accept address, basically
[12:35:40] <t4nk149> ye ?
[12:35:47] <RikusW> you'll need a mega8 or so to load it onto
[12:36:02] <t4nk149> what is that.
[12:36:08] <t4nk149> im using it with stk500
[12:36:18] <mmp> megal0maniac: it is correctly recognized as a low-speed device, so at least basics do work
[12:36:19] <RikusW> http://sites.google.com/site/megau2s/home -> jtag tab
[12:36:34] <RikusW> t4nk149: its a on chip debugger, it can even be connected to the stk
[12:37:00] <RikusW> t4nk149: there is some docs with AVR Studio explaining how its used
[12:37:02] <mmp> megal0maniac: unfortunately, it does not accept any device number, so I guess there's something weird in the analog part of USB interface
[12:37:16] <RikusW> t4nk149: you'll need AS4 to use the mki though
[12:37:20] <mmp> (read analog as resistors, zeners, etc.)
[12:37:24] <RikusW> or avarice and gdb
[12:37:43] <megal0maniac> mmp: Could you pastebin some kind of console output? I'm not really understanding
[12:37:48] <megal0maniac> RikusW: Don't confuse him :P
[12:38:01] <t4nk149> hmm thank you, but i guess i have to learn some more first
[12:38:03] <t4nk149> brb
[12:38:04] * megal0maniac is thinking of getting a mega32 to play with...
[12:38:16] <mmp> megal0maniac: unfortunately, my logs are cleared right now, let me see
[12:38:17] <RikusW> t4nk149: ever used the AS simulator ?
[12:38:28] <RikusW> it will be like that, only live on the actual chip
[12:38:40] <megal0maniac> RikusW: Maybe I'll get a Dragon :)
[12:38:45] <RikusW> megal0maniac: you'll need AS4 too
[12:39:02] <mmp> megal0maniac: but the whole story is that I have an usbasp, which worked a year or two ago, and now it does not accept addresses; maybe due bad soldering and mechanical stress, or something else..
[12:39:16] <RikusW> megal0maniac: the Dragon is R600 or so at RS
[12:39:43] <RikusW> I rarely use mine now, I use a U2S for ISP instead
[12:40:23] <megal0maniac> RikusW: I want it for dW and JTAG and PDI debugging
[12:40:27] <RikusW> though I still do use it for occasional debugging
[12:40:29] <mmp> megal0maniac: basically: http://pastebin.com/EDYFy5L5
[12:41:00] <RikusW> megal0maniac: the U2S can do JTAG on mki supported AVRS
[12:41:06] <RikusW> get a m162 m16 or m32
[12:41:51] <RikusW> megal0maniac: the U2S one actually supports new AVRs too
[12:41:53] <mmp> megal0maniac: errno -32 being 'EPIPE' (Broken pipe)
[12:41:59] <RikusW> but you'll need to hack avarice a bit
[12:42:04] <megal0maniac> RikusW: But I want to debug everything :P
[12:42:10] <megal0maniac> With Atmel studio
[12:42:19] <RikusW> basically just remove the restriction on new avr's
[12:42:20] <megal0maniac> I've looked at avarice and it's daunting
[12:42:31] <RikusW> eh, yeah
[12:42:53] <megal0maniac> mmp: It looks like it isn't enumerating at all. That has nothing to do with having a target connected
[12:43:05] <megal0maniac> Something is probably not 100% with the USB hardware
[12:43:13] <megal0maniac> Is it a genuine avrisp
[12:43:14] <megal0maniac> ?
[12:43:29] <mmp> slightly modified board design, give me a sec..
[12:43:59] <RikusW> megal0maniac: or you can try hacking AS4 to allow all AVRs with mki ;)
[12:44:04] <RikusW> have you ever done that before ?
[12:44:08] * RikusW have :)
[12:44:26] <mmp> megal0maniac: http://www.fischl.de/usbasp/ , the one from Pavel Zhurov (unfortunately no direct link available)
[12:44:34] <RikusW> I hacked AS4 to allow AS5 dragon fw, so for it works perfectly :)
[12:44:48] <RikusW> I used IDA pro and a few custom tools
[12:44:54] <RikusW> and VS
[12:45:05] <megal0maniac> RikusW: I looked around, but didn't see anything obvious. Like the xml files in AS6
[12:45:08] <RikusW> VS can actually debug binary only apps
[12:45:20] <megal0maniac> mmp: Try a different cable, perhaps
[12:45:20] <RikusW> I'm talking raw asm
[12:45:23] <megal0maniac> brb
[12:45:31] <RikusW> and AS6 don't support mki at all
[12:47:12] <mmp> megal0maniac: well, tried two of them and still no luck; also two different laptops
[12:48:11] <mmp> maybe I just should measure at least the D- voltage to see if it is correct
[12:49:14] <RikusW> megal0maniac: If you really want JTAG you can hack it, get a serial port loopback driver and write a virtual JTAGICE mkii
[12:49:20] <RikusW> then interface that with U2S ;)
[12:49:35] <RikusW> that should be the most portable solution
[12:49:59] <t4nk149> sorry one quick question while(1) does that mean it runs forever ? .. and why ...
[12:50:29] <RikusW> megal0maniac: you'll need to read AVR067 and the RavrProg sources will be helpful too
[12:50:37] <RikusW> t4nk149: yes
[12:50:49] <RikusW> its usually for the main loop
[12:51:01] <megal0maniac> RikusW: I think I'll get the Dragon, and THEN start hacking...
[12:51:07] <RikusW> a break; or return; will exit from it
[12:51:20] <t4nk149> okay i see thanks.. but why does the 1 make it run forever
[12:51:24] <RikusW> megal0maniac: all the sw will be on the PC itself
[12:51:28] <t4nk149> or is that just how it is
[12:51:31] <megal0maniac> t4nk149: while will run if the condition in the brackets. 1=true, 0=false
[12:51:33] <RikusW> the virtual mkii that is
[12:51:52] <RikusW> t4nk149: 1 == true
[12:52:00] <t4nk149> yes but what is true ?
[12:52:04] <t4nk149> when is it 1 or true
[12:52:11] <megal0maniac> The condition in brackets
[12:52:17] <megal0maniac> It's true
[12:52:23] <megal0maniac> Because 1 is true
[12:52:28] <megal0maniac> 0 is false
[12:52:29] <RikusW> 0 is false, all other values are true
[12:52:38] <megal0maniac> Ah, there you go
[12:52:57] <t4nk149> while(1) {DDRB = DDRB & 0b11111101}
[12:53:01] <megal0maniac> RikusW: Have you gotten the mkii thing to work?
[12:53:05] <RikusW> so while(true) { do this over and over };
[12:53:25] <t4nk149> okay and when is it false or true ?
[12:53:37] <t4nk149> how can it change from false true
[12:53:43] <RikusW> megal0maniac: I've written a partially implemented virtual STK500, but that was hooked directly into AS4
[12:53:51] <RikusW> not via a virtual comport loopback
[12:54:07] <mmp> megal0maniac: anyway, thank you :-)
[12:54:09] <RikusW> t4nk149: while(a > b)
[12:54:10] <megal0maniac> t4nk149: Use a variable, and change it in the loop
[12:54:40] <RikusW> t4nk149: or while(a != b) or any other condition you'd like
[12:54:44] <t4nk149> i understand that a > b is a condition... but how can 1 or true be a condition
[12:54:56] <RikusW> it is
[12:55:11] <megal0maniac> The while loop checks the result
[12:55:17] <t4nk149> how ? while 1 == a is a condition.. but how is 1 a condition
[12:55:18] <megal0maniac> of whatever is in brackets
[12:55:28] <megal0maniac> 1 does not require any processing, it is the result
[12:55:48] <megal0maniac> a > b means that it needs to compare, the result of the compare is what triggers the while loop
[12:56:13] <t4nk149> hmm..
[12:56:27] <RikusW> t4nk149: if(0) { commented code }
[12:56:36] <RikusW> almost commented anyways
[12:56:40] <t4nk149> what would while(0) do ? never run
[12:56:41] <t4nk149> =
[12:56:53] <RikusW> syntax errors will still be seen
[12:56:57] <RikusW> yes
[12:57:14] <RikusW> while(0) { comments }
[12:57:25] <t4nk149> but it would never run
[12:57:26] <RikusW> err s/comments/ dummy code/
[12:57:32] <RikusW> it wouldn't
[12:57:44] <RikusW> so while(0) is useless
[12:57:58] <RikusW> except for a comment ;)
[12:58:00] <t4nk149> i dont get how 1 or 0 is a condition... but i just have to be satisfied with that 1 = forever ..and 0 = never
[12:58:05] <t4nk149> haha :d
[12:58:11] <megal0maniac> For now, yes
[12:58:21] <RikusW> while (condition is true)
[12:58:32] <megal0maniac> t4nk149: Do you know any programming?
[12:58:59] <t4nk149> not much, a little bit of c
[12:59:07] <t4nk149> while if else arrays functions and stuff
[12:59:20] <t4nk149> basic stuff
[12:59:38] <RikusW> for(init; condition; action) ?
[12:59:43] <megal0maniac> t4nk149: You can use while(true) if you prefer, it means the same thing
[12:59:43] <t4nk149> yes
[12:59:59] <t4nk149> but what is true ? while what is true..
[13:00:10] <megal0maniac> Okay.
[13:00:14] <t4nk149> while my computer is running is true ?
[13:00:24] <t4nk149> or while im eating pizza is true
[13:00:25] <RikusW> t4nk149: heard of boolean variables ?
[13:00:29] <t4nk149> yes
[13:00:47] <megal0maniac> The while loop checks whether the condition in the brackets is true.
[13:01:00] <megal0maniac> (1 = 1) is true
[13:01:12] <megal0maniac> (true) is also true.
[13:01:30] <RikusW> if(a = b) will be true if b != 0
[13:01:43] <RikusW> its a common mistake to use = instead of ==
[13:01:43] <t4nk149> and when is it != 0 ???
[13:01:52] <RikusW> but sometimes = can be useful too
[13:02:00] <megal0maniac> RikusW: Sorry :P
[13:02:27] <RikusW> t4nk149: any value other than 0
[13:03:04] <RikusW> if(b!=15) { run if b is any value but 15 }
[13:03:13] <t4nk149> while(3>1) {dance();} while(223213<3242432432432) {die();} ..... but i cant understand while(1)... while 1 what ? while 1 is bigger than ?? or ..
[13:03:19] <RikusW> else { run if b == 15 }
[13:03:30] <t4nk149> or so it runs as long as it is = 1 =
[13:03:36] <LoRez> 1 is true.
[13:03:40] <RikusW> 1 is just true
[13:03:54] <t4nk149> okay so it means it runs as long as it is 1 or true ?
[13:03:56] <t4nk149> right
[13:04:00] <RikusW> any value is true as long as its not zero
[13:04:19] <t4nk149> BUT WHEN is it true or 1 ?? ... and when is not zero... ? .. where does it read that vfalue from
[13:04:24] <RikusW> ONLY 0 == false
[13:04:44] <RikusW> its a constant value
[13:04:45] <t4nk149> please i get all that... i just.. where does it read from ? what do it compare 1 to ?
[13:05:07] <RikusW> the compile will probably optimize it into non existence as it does with all constants
[13:05:28] <RikusW> so it read from nowhere :-P
[13:05:53] <t4nk149> while(a>b) or a == b ... there is a comparing going on there
[13:06:00] <RikusW> yes
[13:06:02] <t4nk149> but while(1) doesnt compare anything ?
[13:06:10] <RikusW> no
[13:06:30] <RikusW> its the same as loop: do something goto loop;
[13:07:18] <megal0maniac> Compare doesn't give you an arithmetic answer, it returns 1 if true and 0 if false
[13:07:18] <RikusW> t4nk149: still got access to a win9x machine ?
[13:07:32] <t4nk149> okay thanks
[13:07:43] <RikusW> megal0maniac: actually it gives a result in the CPU flags register and then a conditional jump is done
[13:08:59] <RikusW> while(r16) {} ----> loop: --code-- test r16 brne loop
[13:09:15] <RikusW> err
[13:09:25] <RikusW> that asm for do{}while(r16)
[13:10:31] <t4nk149> if (pinc & 0b00100000) ... what does it check for ?
[13:10:43] <RikusW> Z en E flags are the same -> Zero and Equal because its derived from the sub/cmp instruction
[13:10:45] <t4nk149> if it is = 1 =
[13:10:45] <t4nk149> ?
[13:10:57] <RikusW> if PINC5 is true
[13:11:17] <RikusW> if(PINC & (1<<PINC5))
[13:11:29] <RikusW> if(PINC & 0x20)
[13:11:37] <t4nk149> tthat is if pinc = 0xff right ?
[13:11:37] * RikusW prefers hex :)
[13:11:44] <t4nk149> ha.d
[13:11:48] <RikusW> that too
[13:11:59] <t4nk149> i wouldt be orrect if pinx = 0x00
[13:12:01] <RikusW> but more specifically if pinc == 0x20
[13:12:05] <t4nk149> wouldt be correct*
[13:12:12] <RikusW> or if PINC5 bit is true
[13:12:17] <RikusW> yes
[13:12:29] <t4nk149> so i have to define pinc to 0x00
[13:12:30] <t4nk149> right?
[13:12:41] <RikusW> would be false if PINC == 0xDF too
[13:13:01] <RikusW> 0b1101 1111
[13:13:10] <RikusW> you cannot assign PINC
[13:13:16] <RikusW> its input
[13:13:30] <RikusW> but PORTC does affect it if DDRC is output
[13:13:42] <megal0maniac> Was about to say...
[13:13:54] <t4nk149> so pinc standard value is 0x00
[13:13:55] <t4nk149> right?
[13:14:01] <megal0maniac> Yes
[13:14:09] <t4nk149> these things should stand in my book
[13:14:10] <RikusW> depends on the input pin states
[13:14:12] <megal0maniac> Most registers are zero to begin with
[13:14:43] <megal0maniac> input pins are a different story. When you're working with registers, they mostly start as 0
[13:14:55] <RikusW> t4nk149: if DDRC = 0; and PORTC = 0xFF; all inputs will have the internal pullup resistors enabled
[13:15:12] <RikusW> then you can connect buttons between the pins and gnd
[13:15:33] <megal0maniac> Unless you have an xmega :/
[13:15:35] <RikusW> so PINC will read 0xFF by default
[13:15:53] <RikusW> ugh, xmega is a different mission altoghether
[13:16:02] <RikusW> its port registers is much different
[13:16:14] <RikusW> so is AVR32
[13:16:26] <megal0maniac> Think it even has pulldowns
[13:16:36] <RikusW> and open drain
[13:16:38] <megal0maniac> It's super versatile
[13:16:42] <RikusW> yeah
[13:16:50] <RikusW> and super complicated to program ;)
[13:17:00] <RikusW> i guess until you're used to it anyways
[13:17:25] <megal0maniac> I haven't figured out how to set a pull-up and read input state on that pin yet :P
[13:17:40] <megal0maniac> mega is easy
[13:17:42] <RikusW> on xmega ?
[13:17:46] <megal0maniac> Yes
[13:17:57] <megal0maniac> Probably some funny register that I can't find
[13:17:58] <RikusW> rtfm :_P
[13:18:02] <megal0maniac> I DID!
[13:18:19] <megal0maniac> Did what it said and still no success..
[13:18:29] * RikusW will have a look too
[13:18:31] <megal0maniac> Actually, I'll pastebin
[13:18:43] <megal0maniac> Or...
[13:19:11] <megal0maniac> I'll upload a txt file for out gprs users ;)
[13:19:38] <t4nk149> int main (void) {DDRC = 0x00; while(1){ if (pinc & 0b00100000) PORTB = 0x55; ..... how can this ever be true ?? if pin c = 0x00 it would never be true .. right ? }
[13:20:11] <t4nk149> only if i "change" pin c bit 5 to 1 .
[13:20:14] <t4nk149> right ?
[13:21:20] <RikusW> if you connect a pullup resistor to PINC5
[13:21:31] <t4nk149> its in my stk500.
[13:21:37] <RikusW> or if you set PORTC bit 5
[13:21:41] <megal0maniac> RikusW: http://atinyhedgehog.za.net/xboardblink.txt
[13:21:43] <t4nk149> it has reverse logic or something like that..
[13:21:51] <t4nk149> my teacher said
[13:21:53] <RikusW> ah yes stk500 got nice builtin buttons
[13:22:00] <t4nk149> hehe
[13:22:15] * RikusW goes looking at the stk500 diagrams
[13:22:15] <t4nk149> so it would never be true right ?
[13:22:21] <megal0maniac> RikusW: Anything obviously wrong there?
[13:22:22] <t4nk149> hehe.d
[13:22:28] <RikusW> depends on the input pin state
[13:22:54] <megal0maniac> Well, I'm expecting the LED on PORTR to come on if I pull B0 down
[13:22:59] <t4nk149> with that code how do i know the input pin state ?
[13:23:11] <t4nk149> i only have that code
[13:23:23] <megal0maniac> brb, locking up
[13:23:25] <RikusW> t4nk149: the switches on the stk is high by default until its pressed
[13:23:40] <RikusW> then it is low or 0 or false
[13:23:53] <RikusW> s/or/and
[13:24:16] <t4nk149> so it would never be true right? unless i press a button and change then pin state
[13:24:38] <RikusW> it will always be true, unless you press a button
[13:25:00] <t4nk149> i mean it would never do whats under the if
[13:25:02] <t4nk149> sentence
[13:25:09] <RikusW> the leds need to be low to turn on too
[13:25:16] <t4nk149> if (pinc & 0b00100000) PORTB = 0x55;
[13:25:31] <RikusW> it will happen every loop
[13:25:52] <t4nk149> argh.. tihs is so confusing
[13:26:03] <RikusW> use if (!(pinc & 0b00100000) ) instead
[13:26:16] <t4nk149> its my stupid book
[13:26:24] <t4nk149> so stupid examples
[13:26:59] <RikusW> I assume you have the stk ribbon cables ?
[13:27:33] <t4nk149> this is an exmaple fro my book.... int main (void){ DDRB = DDRB & 0b11111101; // pin 1 of port B is input }
[13:27:49] <RikusW> if you connect the led port directly to the switch port the led will turn on if you push a button
[13:28:22] <RikusW> t4nk149: I'd set all as inputs when connecting to the switches on the stk
[13:28:25] <t4nk149> how is that true ??? of DDRB is 0xff it would be the opposite ??right .. pin 1 would be output. and the rest too
[13:28:42] <t4nk149> i just want to understand the example from the book
[13:28:51] <t4nk149> it says pin 1 = input
[13:28:58] <RikusW> read the ports chapter in the AVR datasheet
[13:29:00] <t4nk149> but it could be output if ddrb = oxxff
[13:29:18] <RikusW> its explained clearly there
[13:29:34] <t4nk149> please if you could just answer this question then i will read
[13:30:01] <t4nk149> int main (void){ DDRB = DDRB & 0b11111101; // pin 1 of port B is input } couldnt pin 1 be OUTPut...? if ddrb = 0xff
[13:30:04] <RikusW> in short the Buttons port will read 0xFF by default and setting the led port to 0 will cause all leds to turn on
[13:30:17] <t4nk149> yes i know.d thanks
[13:30:35] <t4nk149> isnt it wroing to say pin 1 of port b is input ??
[13:30:44] <t4nk149> it oculd be output ? if ddrb is 0xff
[13:30:49] <t4nk149> right?
[13:30:54] <RikusW> pins are numbered 7654 3210
[13:31:05] <t4nk149> yes i know
[13:31:21] <RikusW> and if a DDR bit is 0 its input 1 is output
[13:31:29] <t4nk149> yes i know
[13:31:41] <t4nk149> my point is... he says PIN 1 is input.... but that is only if DDRB = 0x00 right ??
[13:31:45] <t4nk149> in that code
[13:31:48] <RikusW> if DDRB = 0xFF its all output
[13:32:01] <t4nk149> if DDRB = 0xff pin1 would be output right?
[13:32:09] <RikusW> yes
[13:32:22] <t4nk149> so isnt it stupid to write
[13:32:26] <t4nk149> my point is... he says PIN 1 is input.... but that is only
[13:32:31] <RikusW> this will set DDB1 to 0 -> DDRB = DDRB & 0b11111101;
[13:32:33] <t4nk149> ups
[13:32:35] <t4nk149> i mean
[13:32:36] <t4nk149> "DDRB = DDRB & 0b11111101; // pin 1 of port B is input"
[13:32:49] <t4nk149> i doesnt make sense to write that... how the !!! can it be input.. it could be both things
[13:32:54] <RikusW> that is correct
[13:33:02] <t4nk149> what im saying or the book ?
[13:33:12] <RikusW> "DDRB = DDRB & 0b11111101; // pin 1 of port B is input"
[13:33:21] <t4nk149> is that correct =?
[13:33:47] <RikusW> could be written at DDRB &= 0b11111101; too
[13:33:49] <RikusW> *as
[13:34:20] <RikusW> I'd prefer to write DDRB = 0; when its connected to the switches
[13:34:29] <RikusW> its safer that way
[13:34:32] <t4nk149> and the rest of the bits could be either input or output right ?
[13:34:54] <t4nk149> DDRB = DDRB & 0b11111101; in this example
[13:34:56] <RikusW> This will only change bit1 -> "DDRB = DDRB & 0b11111101; // pin 1 of port B is input"
[13:35:13] <RikusW> the other bits will be whatever they were before
[13:35:16] <t4nk149> why can it only change one bit ?
[13:35:36] <RikusW> thats what bitwise operators do when used like that
[13:35:47] <t4nk149> they only change one bit ?
[13:35:59] <RikusW> http://tom-itx.dyndns.org:81/~webpage/ --- see the article on bitwise operators on there
[13:36:02] <RikusW> yes
[13:36:29] <t4nk149> but if DDRB = 0x00 ....it would be anded with 0b11111101... then it would be 0b00000000.... or not ?
[13:36:34] <RikusW> DDRB &= 0b00110101; // clear bits 7 6 3 1 at the same time
[13:36:36] <t4nk149> i will.. i have read a loot!.d
[13:36:55] <t4nk149> then it would all be input
[13:37:06] <RikusW> 7 6 3 and 1 yes
[13:37:15] <RikusW> the other bits is unknown
[13:37:19] <RikusW> or the previous value
[13:37:30] <t4nk149> just to be 100 %
[13:37:53] <megal0maniac> I have to go. RikusW, do you see anything wrong with my code?
[13:38:01] <RikusW> will have a look
[13:38:06] <RikusW> will you be online at home ?
[13:38:18] <megal0maniac> I made it a tiny text file for you :)
[13:38:20] * RikusW have been to busy to look yet :-P
[13:38:32] <megal0maniac> Maybe, but not for long. Probably not. I've got beer :P
[13:38:45] <RikusW> tiny indeed
[13:39:01] <t4nk149> DDRB = DDRB & 0b11111101; if DDRB = 0x00 ...when its anded with 0b11111101... then it would be become 0b00000000.... or not ? then all bits would become input
[13:39:03] <RikusW> I'll have to got rtfm
[13:39:08] <megal0maniac> lol
[13:39:11] <t4nk149> this is my lat question.d
[13:39:14] <megal0maniac> It's not so tiny
[13:39:15] <t4nk149> last*
[13:39:16] <t4nk149> hehe
[13:39:20] <RikusW> megal0maniac: I'm not that familiar wit xmega yet
[13:39:49] <RikusW> t4nk149: if its already 0 it will remain 0
[13:40:04] <RikusW> if it was 0xFF then it will become 0xFD
[13:40:06] <megal0maniac> Me neither
[13:40:08] <megal0maniac> Or mega even
[13:40:10] <megal0maniac> Or C
[13:40:17] <t4nk149> but the other bits was 1
[13:40:26] <RikusW> megal0maniac: seems like I have a slight advantage then :-P
[13:40:29] <t4nk149> 0b11111101 so they all become input ?
[13:40:47] <RikusW> t4nk149: only bit 1 becomes 0
[13:41:01] <t4nk149> why not the rest ?
[13:41:03] <RikusW> thats basic and/or logic
[13:41:21] <t4nk149> when i AND 1 with 0 i get 0
[13:41:30] <RikusW> yes
[13:41:33] <t4nk149> so 0b11111101 anded with 0b00000000
[13:41:39] <t4nk149> would be 0b00000000
[13:41:43] <RikusW> yes
[13:41:50] <t4nk149> so DDRB = DDRB & 0b11111101;
[13:41:58] <t4nk149> if DDRB = 0b00000000
[13:42:06] <t4nk149> all bits would become input
[13:42:10] <RikusW> and so 0b11111101 anded with 0b11111111 would be 0b11111101
[13:42:26] <t4nk149> all bits would become input ..right ?
[13:42:30] <RikusW> t4nk149: it already were input
[13:42:46] <t4nk149> how ??? it was 0b11111101
[13:42:53] <t4nk149> 1 = output
[13:42:57] <RikusW> no that was the and mask
[13:43:04] <t4nk149> so all except one bot was output..
[13:43:32] <t4nk149> so it doesnt and all of it ?
[13:43:34] <RikusW> 0b11111101 is not the register value, its merely the & mask used
[13:44:10] <t4nk149> so it only ands bit1 ?
[13:44:24] <RikusW> clears bit 1 only yes
[13:44:49] <t4nk149> so in avr or C .. i can only manipulate one bot at the time ?
[13:44:50] <t4nk149> bit*
[13:45:00] <RikusW> yes
[13:45:08] <RikusW> or multiple using the right mask
[13:45:19] <t4nk149> how ?
[13:45:34] <RikusW> 0b00110101 for example
[13:45:48] <RikusW> == 0x35
[13:46:12] <t4nk149> it would only and with bith 7 6 1 3
[13:46:14] <t4nk149> right ?
[13:46:27] <RikusW> yes
[13:46:33] <t4nk149> so basically
[13:46:39] <t4nk149> it only ands with zeroes ?
[13:46:42] <t4nk149> and not ones
[13:46:48] <t4nk149> it looks for the zeroes
[13:46:50] <RikusW> if you |= with it, it will set bits 0 2 4 5
[13:47:22] <t4nk149> why is that
[13:47:41] <RikusW> read the bitwise stuff on tom's site :-P
[13:47:46] <t4nk149> okay hehe
[13:47:57] <RikusW> you know or logic right ?
[13:48:10] <t4nk149> although i think i got it.. but i read now
[13:52:42] <RikusW> t4nk149: |= and &= is a read modify write operation
[13:52:57] <RikusW> google if you need an explanation for that :-P
[14:24:08] <t4nk149> u still there ?
[14:25:06] <t4nk149> ??
[14:25:23] <RikusW> yeah
[14:25:36] <t4nk149> allright i read it... :) but there is still one thing i dont get
[14:25:46] <RikusW> whats that ?
[14:26:06] <t4nk149> why does DDRB = DDRB & 0b11111101 why does this only make pin1 input
[14:26:19] <t4nk149> and not the others
[14:26:31] <t4nk149> u said its possible to do multiple bit manipulation
[14:26:43] <RikusW> because it only clears bit 1
[14:27:07] <RikusW> 0b11101101 will clear two bits, 1 and 4
[14:27:34] <t4nk149> so it only & (ands) the zeroes
[14:27:35] <t4nk149> ?
[14:27:47] <jadew> no
[14:27:49] <jadew> 1 and 1 = 1
[14:27:53] <Tom_itx> it has to be DDRB 1 AND your mask 1
[14:27:53] <jadew> 1 and 0 = 0
[14:27:59] <jadew> 0 and 0 = 0
[14:28:06] <RikusW> new = original & 1 ---- then ---- new == original
[14:28:19] <RikusW> new = original & 0 ---- then ---- new == 0
[14:28:28] <RikusW> for 1 bit that is
[14:28:38] <Tom_itx> DDRB 1<< Bit1;
[14:29:03] <t4nk149> so when i AND with 0 it changes. but when i change with 1
[14:29:05] <t4nk149> it stays as it is
[14:29:10] <RikusW> yes
[14:29:16] <Tom_itx> because they're both not 1
[14:29:17] <t4nk149> is it always like that ?
[14:29:21] <RikusW> the opposite is true for OR
[14:29:22] <Tom_itx> because they're both not 1
[14:29:23] <Tom_itx> because they're both not 1
[14:29:23] <RikusW> yes
[14:29:24] <Tom_itx> because they're both not 1
[14:29:35] <Tom_itx> OR doesn't care
[14:29:39] <Tom_itx> XOR does
[14:29:49] <RikusW> XOR inverts
[14:29:52] <Tom_itx> 1or1=1
[14:29:55] <jadew> t4nk149: http://pastebin.com/07tfH8xD
[14:29:57] <Tom_itx> 0or1=1
[14:30:04] <Tom_itx> 0or0=0
[14:30:07] <RikusW> new = orig | 1 -> new == 1 always
[14:30:19] <RikusW> new = orig | 0 -> new = orig
[14:30:23] <Tom_itx> t4nk149, did you even read the page i posted?
[14:30:41] <t4nk149> i reah this
[14:30:41] <t4nk149> http://tom-itx.dyndns.org:81/~webpage/avr/c_bits/bits_index.php
[14:30:48] <t4nk149> read'
[14:31:03] <t4nk149> i understand all about & and | .. thats not the problem
[14:31:04] <Tom_itx> that explains it
[14:31:06] <RikusW> new = orig ^ 1 ---> new = !orig // XOR
[14:31:08] <t4nk149> I JUST wondered...
[14:31:10] <t4nk149> why
[14:31:21] <t4nk149> DDRB = DDRB & 0b11111101
[14:31:35] <Tom_itx> will clear bit one
[14:31:43] <Tom_itx> because it's the only 0
[14:31:43] <jadew> because DDRB is probably 255 before that line
[14:31:49] <jadew> and after it it will be 0b11111101
[14:31:50] <RikusW> DDRB &= 0b11111101; does exactly the same
[14:32:11] <Tom_itx> yeah and more commonly written that way
[14:32:16] <RikusW> Tom_itx: read scroll up :-P
[14:32:23] <Tom_itx> naw
[14:32:26] <Tom_itx> i'm leaving
[14:32:33] <RikusW> good idea :-P
[14:33:00] <t4nk149> i jus thought that DDRB = DDRB & 0b11111101 means that if DDRB is equal to 0b11111111... then when i and 0b11111111 with 0b11111110 then it would give 0b11111110
[14:33:25] <t4nk149> and when DDRB = 0b0000000 it would give 0b00000000 because when i and something with sexro it geives 0
[14:33:25] <RikusW> it would
[14:33:35] <RikusW> yes
[14:33:44] <RikusW> LOL
[14:33:45] <t4nk149> then
[14:33:47] <Tom_itx> email me a cow
[14:33:55] <t4nk149> if that is true
[14:33:59] <RikusW> t4nk149: LOL typo :-P
[14:34:06] <t4nk149> DDRB = DDRB & 0b11111101 then this makes all the bits 0
[14:34:13] <t4nk149> if DDRB = 0x00
[14:34:20] <RikusW> t4nk149: need a girlfriend ?
[14:34:31] <t4nk149> ?
[14:34:37] <t4nk149> oh.d
[14:34:38] <t4nk149> hehe
[14:34:44] <Tom_itx> someone to hold your hand
[14:34:50] <t4nk149> zero
[14:34:50] <t4nk149> .d
[14:35:01] <t4nk149> if DDRB = 0x00 then DDRB = DDRB & 0b11111101 then this makes all the bits 0
[14:35:12] <t4nk149> and therefore all bits are input
[14:35:15] <t4nk149> because they are all 0
[14:35:25] <RikusW> yes
[14:35:31] <grummund> huh. was 0x00 to start with
[14:35:37] <RikusW> they already were 0 and remain unchanged
[14:35:49] <grummund> 0x00 & anything = 0x00.
[14:35:58] <RikusW> only bit 1 will change to 0 if it weren't already
[14:36:08] <t4nk149> well then
[14:36:32] <grummund> 0xff | anything = 0xff.
[14:36:34] <t4nk149> MY example form the book is wrong
[14:36:38] <t4nk149> fform
[14:36:42] <t4nk149> because
[14:36:46] <t4nk149> look at example : int main (void){ DDRB = DDRB & 0b11111101; // pin 1 of port B is input
[14:37:07] <RikusW> its not wrong
[14:37:12] <t4nk149> it says than pin 1 = input....BUT WE JUST said that if DDRB = 0x00 then they would all be input..not only pin1
[14:37:16] <RikusW> it will indeed become a input
[14:37:22] <t4nk149> yes but all othes will too
[14:37:25] <t4nk149> right ?
[14:37:34] <RikusW> it they were 0 already
[14:37:46] <grummund> t4nk149: how do you know DDRB=0x00 to start with?
[14:37:48] <RikusW> which will generally be the case after a reset
[14:37:59] <RikusW> *if
[14:38:10] <t4nk149> how does the author know that its 0xff
[14:38:19] <t4nk149> is it just something he defines in his head
[14:38:25] <t4nk149> and that the reader should know
[14:38:32] <RikusW> he didn't say anything about the other bits, only bit 1
[14:38:46] <t4nk149> yes but the other bits could be input or output right ?
[14:38:54] <grummund> t4nk149: did the author say all other bits are *output* ?
[14:38:56] <RikusW> yes
[14:39:12] <t4nk149> allright then i UNDERSTOOD it hours ago...
[14:39:14] <t4nk149> doh
[14:39:24] <t4nk149> i thought u said i was wrong
[14:39:27] <t4nk149> before
[14:39:34] <grummund> the comment only mentions "pin 1" nothing is said about the other pins.
[14:39:36] * RikusW almost thought this was a lost cause :-P
[14:39:51] <t4nk149> hehe rikusw u told me something else!!!
[14:39:58] * RikusW goes running of chasing his tail :-D
[14:40:03] <t4nk149> u made me lose 2 hours on this
[14:40:07] <t4nk149> :D
[14:40:09] <t4nk149> hehe
[14:40:15] <t4nk149> but thanks because u helped
[14:40:25] <RikusW> :)
[14:41:16] <t4nk149> [20:22] <t4nk149> and the rest of the bits could be either input or output right ? [20:23] <t4nk149> DDRB = DDRB & 0b11111101; in this example [20:23] <RikusW> This will only change bit1 -> "DDRB = DDRB & 0b11111101; // pin 1 of port B is input" [20:23] <RikusW> the other bits will be whatever they were before
[14:41:28] <t4nk149> u see :p
[14:41:42] <RikusW> and thats correct
[14:42:07] <t4nk149> well :D
[14:42:15] <t4nk149> argh
[14:42:15] <t4nk149> nevermind
[14:42:16] <t4nk149> :D
[14:42:18] <t4nk149> thanks!:D
[14:43:30] <t4nk149> :)
[14:44:25] <t4nk149> do you guys know a good article guide whatever
[14:44:28] <t4nk149> that talks about pwm
[14:44:34] <t4nk149> and avr / c
[14:44:51] <grummund> the datasheet? :P
[14:44:55] <RikusW> t4nk149: you could google bitwise logic for the above discussion
[14:45:14] <RikusW> and appnotes too
[14:45:21] <t4nk149> appnotes ?
[14:45:31] <t4nk149> i want to make pwm with delay
[14:45:33] <RikusW> application notes on the atmel.com site
[14:45:44] <RikusW> why not use a timer instead ?
[14:45:50] <grummund> t4nk149: do you have an account on avrfreaks.net forum?
[14:45:58] <t4nk149> no.d
[14:46:10] <t4nk149> i could but this is what my teacher did
[14:46:16] <t4nk149> so i want to understand the code he made
[14:46:31] <t4nk149> he made pwm with delay
[14:46:44] <RikusW> using a timer is better :-P
[14:46:57] <t4nk149> i know.. but
[14:47:04] <t4nk149> i want to understand it.. for exams
[14:47:13] <RikusW> wikipedia
[14:47:21] <RikusW> pulse width modulation
[14:47:35] <grummund> t4nk149: www.avrfreaks.net/index.php?name=PNphpBB2&file=viewforum&f=11
[14:47:49] <grummund> tutorials there ^^
[14:48:13] <t4nk149> thanks
[14:49:20] <t4nk149> we connected this speaker
[14:49:21] <t4nk149> small one
[14:49:24] <t4nk149> that comes with stk500
[14:49:27] <t4nk149> to portb
[14:49:39] <t4nk149> then we had to change tone
[14:49:41] <t4nk149> make music
[14:49:49] <t4nk149> i jut dont get why delays can change the tone
[14:49:58] <Essobi> Hey... Wasn't there an embedded ARM/MIPS channel on freenode? I vaguely remember one.
[14:53:15] <asteve> avr has an arm offering?
[14:54:03] <OndraSterver_> no
[14:54:07] <OndraSterver_> different arch
[14:54:22] <asteve> it's not an ARM chipset?
[14:54:23] <vectory> heh? its called arm
[14:54:24] <RikusW> atmel does have ARM and 8051 too
[14:54:39] <asteve> the last time I heard MIPS mentioned was in my architecture class :)
[14:54:40] <vectory> theres a lot of arm archs
[14:54:42] <asteve> LC3b
[14:54:42] <OndraSterver_> AVR is AVR
[14:54:44] <OndraSterver_> ARM is ARM
[14:54:49] <asteve> you're arm
[14:54:54] <OndraSterver_> no, I am a leg
[14:54:59] <asteve> well then
[14:55:07] <RikusW> and AVR32 is a crossbreed of ARM and AVR :-P
[14:55:13] <t4nk149> ty
[15:00:00] <RikusW> have anyone ever done a PCB GSM antenna ?
[16:29:20] <jadew> w|zzy, if you're planning to use the LA let me know, I fixed a bug in the i2c parser and other minor bugs, in the current version
[17:52:53] -hubbard.freenode.net:#avr- [freenode-info] channel flooding and no channel staff around to help? Please check with freenode support: http://freenode.net/faq.shtml#gettinghelp
[19:46:37] <jadew> w|zzy, here's an update: http://dumb.ro/files/lafront/OLSFront.zip
[19:47:16] <jadew> it fixes several bugs in the program and an i2c issue
[19:47:30] <jadew> it adds that feature you suggested + UART parser
[19:50:34] <jadew> missing stuff: from 1-WIRE, it doesn't do overdrive. from UART, it doesn't handle synchronous uart yet, I need to set up two devices to test that out
[23:36:21] <jadew> any idea why avrdude would send me different erase chip commands when I'm emulating avrisp2 than it would send to usbtiny?
[23:39:54] <jadew> also, it appers it's giving me instructions for huge byte delays, while usbtiny has almost no byte delays
[23:45:15] <Casper> different programmer, different commands