#avr | Logs for 2011-12-12

Back
[00:32:16] <Valen> doublebeta: wassat?
[00:40:46] <doublebeta> 15:48 -!- nintendo [~chatzilla@dslb-084-058-177-009.pools.arcor-ip.net] has joined #avr
[03:18:23] <CapnKernel> inflex: You might have to get a job :-(
[03:20:11] <ziph> I've tried that. It doesn't stick. :)
[03:24:57] <CapnKernel> Don't tell me that. If I can't get my business of the ground, I may yet have to go back to a desk job. Can I make myself? Not sure I can. My missus can though, and so can the bank.
[03:25:11] <CapnKernel> Anyway, off to the WBEM now...
[03:25:20] <CapnKernel> That's World's Biggest Electronics Market
[03:31:51] <doublebeta> 'World's Biggest Electronics Market'? http://fc01.deviantart.net/fs71/i/2011/183/e/0/pinkamena_derp_by_zutheskunk-d3kq6ng.png
[04:32:06] <mehran> hi
[04:32:06] <tobbor> Hello mehran
[04:32:22] <mehran> do you know any about zigbee?
[05:29:48] <Fleck> hey RikusW :) i fixed my PSU :P
[05:31:11] <inflex> CapnKernel: !? How DARE you!
[05:31:34] <inflex> CapnKernel: but yeah, I've been picking up cash jobs here and there
[05:31:51] <RikusW> Fleck: what was the problem ?
[05:32:15] <inflex> Unfortunately, it's difficult for me to get a job on a longer basis as I have to tend to stay here to look after my wife.
[05:32:26] <Fleck> RikusW one resistor after that resistor came diode and then to small transformer... resistor was dead...
[05:33:39] <RikusW> Fleck: was it by any chance a FSP supply ?
[05:33:48] <Fleck> psp?
[05:34:02] <Fleck> *FSP? whats FSP?
[05:34:18] <RikusW> brand name of pc smps...
[05:34:32] <Fleck> it was not PC PSU :)
[05:34:49] <Fleck> PSU for panasonic wireless rear speakers...
[05:35:56] <RikusW> I fixed quite a few FSP supplies, same diode+resistor died.... causing loss of "power good"
[05:36:34] <Fleck> yep it was working, but got weak... diode was ok btw.. only resistor died
[05:36:47] <RikusW> I guess the diode died first putting 40kHz through 47Ohm to 100nF cap to gnd.... frying the resistor too
[05:37:05] <Fleck> not panasonic, philips, sorry
[05:37:35] <Fleck> yep it was 470ohm
[05:37:36] <RikusW> smps can be tricky...
[05:37:43] <Fleck> so i should check diode?
[05:37:45] <RikusW> mine was 47 Ohm
[05:37:54] <Fleck> ohh
[05:38:00] <RikusW> entirely different supply probably
[05:38:29] <RikusW> and 0805 smd too
[05:38:53] <Fleck> http://download.p4c.philips.com/files/h/hts9800w_37/hts9800w_37__fv_.jpg << white box at the left side :)
[05:39:04] <Fleck> http://fleck.rullz.lv/psu/IMG_20111206_220002.jpg
[05:39:36] <Fleck> blue resistor on the left side... above small transformer, on board side
[05:40:48] <Fleck> diode seems to be ok!
[05:41:09] <RikusW> I replaced mine with 1n4148
[05:41:29] <RikusW> its only for the power good signal
[05:41:52] <Fleck> heh, after repair its kind of noisy...
[05:42:31] <RikusW> like a high pitched sound /
[05:42:32] <RikusW> ?
[05:42:32] <Fleck> center speaker is so noisy and there is some high freq. beep comming out still
[05:42:35] <Fleck> yeah
[05:42:47] <Fleck> high pitch, i would say about 16KHz
[05:43:02] <Fleck> you can't even hear it at all angles... :D
[05:43:22] <Fleck> i have good hearing, so walking a cross room i noticed...
[05:44:10] <Fleck> and there is a noise too... like some filter is not working
[05:44:32] <Fleck> but psu is silent now... complelty, small transformer dosnt make a sound now
[05:44:48] <RikusW> check your caps
[05:44:54] <Fleck> well maybe it does, but my ear doesn't pick it up
[05:44:56] <Fleck> i did
[05:46:56] <RikusW> with smps caps is a common culprit ;)
[05:47:19] <abcminiuser> Jesus, watch this: https://www.youtube.com/watch?feature=player_embedded&v=5NBBn7Xm5Ag
[05:47:30] <abcminiuser> I don't know what substances they're on, but I hope they save me some
[05:57:07] <ziph> abcminiuser: I take it marketing is in the states?
[05:57:16] <abcminiuser> Norway
[05:57:21] <abcminiuser> But probably also in the states
[05:57:58] <ziph> Have you been tapering off your vegemite intake?
[05:58:53] <RikusW> vegemite ?
[06:00:15] <RikusW> Ah -> South African Marmite
[06:02:41] <inflex> O_o
[06:02:56] * inflex has tasted almost all of them.... vegemite is quite distinct from Marmite
[06:02:58] <inflex> (ZA)
[06:03:17] <norbi> hi guys, have you ever tried to write a program to comunicate with serial port? i mean in windows
[06:03:19] <inflex> Vegemite is perhaps the sharpest flavoured of them all
[06:03:27] <inflex> (but lacks body fullness)
[06:03:41] <norbi> i kinda want to make one, that is good for debugging, graphics, etc
[06:05:10] <RikusW> norbi: CreateFile("COMx",.......); ReadFile + WriteFile + CloseHandle
[06:06:20] <RikusW> inflex: I made something like that myself... used CMS thats fed to cattle, its fermented molasses used to make alcohol/vinegar
[06:06:44] <RikusW> boiled it with some salt, almost tastes like marmite.... slightly fruity...
[06:07:40] <norbi> RikusW: CreateFile() is part of winapi?
[06:08:33] <RikusW> norbi: SetCommTimeouts GetCommState SetCommState CreateFile("COM1",GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
[06:08:34] <RikusW> yes
[06:10:46] <norbi> RikusW: ok, i will check this out
[06:10:49] <norbi> thanks
[06:13:09] <RikusW> Vegemite had been banned in the United States -- because it contains folate, a B vitamin USA FDA is screwed up
[06:14:09] <RikusW> seems it is a rumour :O
[06:14:25] <ziph> Folate is added to bread in Australia by force now.
[06:14:46] <ziph> They'll put you in jail for selling bread without it. ;)
[06:15:17] <norbi> RikusW: how are the kangurus?
[06:15:38] <ziph> Are they smart Kangaroo's?
[06:16:04] <RikusW> norbi: I'm South African ;)
[06:16:04] <norbi> ah Kangaroo is how its written :D
[06:16:22] <karlp> I thought vegemite was banned because of the yeast content, not the folate.
[06:16:23] <norbi> RikusW: ive known that you live in Australia
[06:16:24] <ziph> He's from South Africa, which is where you live before you come to Australia.
[06:20:49] <norbi> hmmm, force restart
[06:20:59] <inflex> No, Vegemite has NOT been banned in the US
[06:21:06] <inflex> There -was- a story about it af ew years ago
[06:21:13] <inflex> but that was due to the folate being on the FDA restricted list
[06:21:49] <inflex> http://www.snopes.com/food/warnings/vegemite.asp
[06:22:21] <RikusW> good to know
[06:22:47] <karlp> however, banned or not, it was being confiscated at the border
[06:34:00] <Tom_itx> norbi did you get spi working?
[06:38:58] <norbi> Tom_itx: i think it works now well, not sure, but i think you need to hold straight the chip, to avoid noice and resonace
[06:39:06] <norbi> resonance*
[06:40:33] <norbi> but im not sure, im coding now a little program in glut to see the real effect of the degrees and coords in 3d space, after that applying maybe the kalman filter
[06:41:48] <norbi> i hope this will work
[06:43:16] <norbi> in 8g acc meter the noice or the sensibility ot the chip is bigger then at 2g?
[06:43:43] <Tom_itx> what's the sheet say?
[06:44:51] <norbi> if i understand it well, then almost 10 times, but im not sure
[06:45:10] <norbi> ah now, ive readed the 16g
[06:45:26] <Tom_itx> was i wrong on clocking the extra byte or was it just noise?
[06:45:27] <norbi> exactly 4 times
[06:45:40] <norbi> just noise
[06:45:50] <norbi> i cant add the extra byte
[06:45:56] <Tom_itx> ok
[06:46:02] <Tom_itx> i know sometimes you need to
[06:46:23] <norbi> yea, i think is needed here too, but i dunno how to add it and not screw things up
[06:47:06] <Tom_itx> does the chip signal when there is good data ready?
[06:47:18] <Tom_itx> or do you just enable the ss and ask
[06:47:27] <norbi> just enable ss and ask
[06:47:41] <norbi> not working with interrupts, yet
[06:47:56] <norbi> i mean in this application
[06:48:01] <Tom_itx> when you do that, the first byte clocked out may be garbage
[06:48:10] <Tom_itx> is that the one that is giving you trouble?
[06:48:23] <norbi> no
[06:48:26] <Tom_itx> or does the chip latch data in the buffer immediately
[06:48:40] <norbi> it does imediately
[06:49:03] <norbi> ive tried to get chip ID, but i cant
[06:49:07] <norbi> dunno why
[06:49:28] <Tom_itx> is it reading it backwards?
[06:49:41] <Tom_itx> fifo or lifo
[06:49:42] <norbi> send_byte(0x00); send_byte(0xFF); this should give me the id
[06:49:46] <norbi> fifo
[06:50:13] <norbi> it gives me 40
[06:50:19] <norbi> instead of E5
[06:50:29] <norbi> 0x40 instead of 0xE5
[06:51:30] <norbi> that means nothing...
[06:51:39] <norbi> just a read bit
[06:53:14] <norbi> visual studio wont install on my pc, it keeps give function error, im mad
[06:53:30] <Tom_itx> you want 11100101 and you get 1000000
[06:53:34] <Tom_itx> doesn't make sense
[06:53:40] <norbi> on windows 7 a microsoft product should install without any problems
[06:53:57] <norbi> Tom_itx: it makes, you need to send a r bit
[06:54:10] <norbi> so thats 0x40
[06:54:36] <norbi> it should give back the device ID, let me try instad of 0x00 0x40
[06:54:38] <norbi> address
[06:56:36] <Tom_itx> what's the part number again?
[06:57:49] <norbi> now it returns 97
[06:57:53] <norbi> adxl345
[07:01:14] <Tom_itx> too bad you don't have a logic analizer
[07:06:01] <norbi> now it is e5
[07:06:20] <norbi> i have an osciloscope
[07:06:26] <Tom_itx> that's what you want isn't it?
[07:06:39] <Tom_itx> how did you get 0xE5?
[07:06:57] <Tom_itx> have you tried setting THRESH_ACT to minimize noise?
[07:07:16] <Tom_itx> (0x24)
[07:07:32] <norbi> 97 suddenly transformed to e5
[07:07:45] <Tom_itx> 2nd try?
[07:08:05] <Tom_itx> maybe the first byte was garbage
[07:09:01] <norbi> Tom_itx: that treshact is for what? what it does exactly?
[07:09:17] <Tom_itx> The activity bit is set when acceleration greater than the value stored in the THRESH_ACT register (Address 0x24) is experienced on any participating axis, set by the ACT_INACT_CTL register (Address 0x27).
[07:09:30] <norbi> Tom_itx: and 97 to e5 transformed over lot of time of 97
[07:10:00] <Tom_itx> The inactivity bit is set when acceleration of less than the value stored in the THRESH_INACT register (Address 0x25) is experienced for more time than is specified in the TIME_INACT register (Address 0x26) on all participating axes, as set by the ACT_INACT_CTL register (Address 0x27). The maximum value for TIME_INACT is 255 sec.
[07:11:10] <norbi> yea, but how does that helps me?
[07:11:19] <Tom_itx> i'm not sure
[07:11:21] <Tom_itx> just reading
[07:11:23] <norbi> i should verify manually that bit?
[07:11:41] <norbi> im not using either interrupts
[07:11:46] <Tom_itx> P.21
[07:12:37] <Tom_itx> For SPI operation at 1.6 MHz or less, the register addressing portion of the transmission is a sufficient delay to ensure that the FIFO has completely popped. For SPI operation greater than 1.6 MHz, it is necessary to deassert the CS pin to ensure a total delay of 5 µs; otherwise, the delay is not sufficient. The total delay necessary for 5 MHz operation is at most 3.4 µs.
[07:15:21] <norbi> so that means? 5ms delay at each transmission?
[07:15:34] <Tom_itx> on the first one at least
[07:15:40] <Tom_itx> or the data may not be there yet
[07:16:13] <Tom_itx> once you start clocking data you need to get all 3 axis at once
[07:16:29] <Tom_itx> unless you're just reading one axis
[07:16:56] <Tom_itx> P.21
[07:17:19] <Tom_itx> Retrieving Data from FIFO
[07:18:04] <Tom_itx> is the data a word or byte?
[07:18:09] <Tom_itx> looks like it's a word
[07:18:37] <Tom_itx> x y z from address 0x32 to 0x73
[07:18:45] <Tom_itx> x y z from address 0x32 to 0x37
[07:19:58] <Tom_itx> there must be at least 5 µs between the end of reading the data registers and the start of a new read of the FIFO or a read of the FIFO_STATUS register
[07:21:05] <norbi> getting 0 now: delay_ms(5000); cbi(PORTB, adxl); send_byte(0x40);send_byte(0x00);byte = SPDR;sbi(PORTB, adxl);printf("%x",byte);
[07:21:29] <norbi> Tom_itx: it is byte, not word
[07:21:32] <norbi> 8bits
[07:21:39] <Tom_itx> k
[07:21:48] <Tom_itx> 6axis?
[07:21:51] <norbi> 3
[07:21:59] <Tom_itx> 2 bytes for each axis
[07:22:03] <norbi> yes
[07:22:31] <norbi> but 12bits for each axis, is set to 8g mode
[07:23:32] <Tom_itx> time to go
[07:23:40] <norbi> ok, bye, and thanks
[07:24:00] <Tom_itx> did you get an st arm discovery board?
[07:24:08] <Tom_itx> they have an accelerometer on it
[07:24:13] <Tom_itx> you might look at the code
[07:24:28] <norbi> no, i dont have that
[07:24:28] <Tom_itx> it's not the same part
[07:24:34] <norbi> i have cerebot2
[11:29:20] <Bushman> hmmm...
[11:29:48] <Bushman> have any one of you done recently a VGA output from AVR?
[11:39:24] <Steffanx> CANUCK (TEST)
[11:39:24] <tobbor> yankie, yankie, yankie.
[11:40:07] <Tom_itx> ban test
[11:40:20] <Steffanx> Have fun Tom_itx
[11:41:34] <OndraSter> Bushman, there was this project
[11:41:43] <OndraSter> it had RF for TV for sure
[11:41:45] <OndraSter> maybe even VGA
[11:41:48] <OndraSter> it was some uzebox?
[11:41:49] <OndraSter> or something
[11:41:51] <OndraSter> it had AVR in it
[11:46:30] <Bushman> it's a game console. i was rather looking for something dedicated as a display for homebrew projects for example driven via UART
[11:47:31] <Bushman> i've found a comercial solution but it's text-only and no way to change the font size
[11:54:37] <norbi> http://imageshack.us/f/35/sclk.jpg/ this is how my sclk looks on spi(image resized), at 4mhz
[11:54:47] <norbi> does it looks ok?
[11:55:57] <OndraSter> huh
[11:56:05] <OndraSter> that is oscope?
[11:56:16] <OndraSter> (yes)
[11:56:51] <OndraSter> shouldn't it be more... rectangular? with T=1/4M and almost perfect 50% duty cycle?
[11:56:59] <OndraSter> those spikes on the left are.. weird
[11:57:13] <OndraSter> it is channel A or B?
[11:57:24] <OndraSter> aka is it 10mV or 5V range
[11:57:39] <OndraSter> oops, it must be B
[11:57:47] <OndraSter> (DC vs AC select)
[11:58:01] <norbi> just a sec
[11:58:06] <norbi> i will give bether image
[12:07:12] <norbi> this is the new one: http://imageshack.us/f/685/sclk.jpg/ but its very weird
[12:07:15] <norbi> at 4mhz?
[12:09:55] <Essobi> Oh ya... so if I want a signal analyzer or a scope for xmas... What should I ask for? :D
[12:10:16] <karlp> is that a scope based on your sound card?
[12:10:22] <karlp> can it get anywhere near 4Mhz?
[12:10:41] <karlp> don't you need something like 2x-4x scope bandwith to measure a signal?
[12:12:02] <grummund> for a start you have it ac-coupled
[12:12:38] <norbi> it is 32Mhz 100ms/s scope
[12:12:45] <norbi> dso 2100
[12:13:19] <grummund> and those glitches look to be around 120Hz
[12:13:42] <grummund> and only 10mV vertical gain
[12:14:28] <norbi> yes, but this is the only lvl where you can see a thing
[12:14:37] <norbi> at 5V you dont see anythhing
[12:14:51] <norbi> i will calibrate my scope
[12:14:55] <norbi> just to be sure
[12:14:59] <grummund> well maybe there is nothing there...
[12:17:04] <norbi> it is calibrated now, and it works fine
[12:18:52] <grummund> what frequency do you expect SCLK to be?
[12:19:08] <norbi> 4mhz
[12:19:57] <grummund> ok, so what do you reckon would be a good timebase for the scope?
[12:21:36] <norbi> ok, what about this? http://imageshack.us/f/859/sclkq.jpg/
[12:22:41] <norbi> but m getting only 2mhz
[12:22:44] <grummund> well that looks more sensible, don't you think?
[12:22:48] <norbi> and some weird space at the end
[12:23:10] <OndraSter> that weird space is end of byte :)
[12:23:21] <OndraSter> seems a lot of capacitance on the bus...
[12:23:40] <norbi> yes it looks like that to me too
[12:23:55] <grummund> the scope is still ac-coupled
[12:24:16] <OndraSter> CHA is DC
[12:24:21] <norbi> is dc
[12:24:53] <norbi> maybe its done by the chip
[12:24:59] <grummund> yep sorry, trigger is ac-coupled that's fine
[12:26:52] <norbi> so is this ok for 4mhz preset?
[12:26:58] <norbi> the spi is set to 4mhz
[12:28:50] <grummund> looks like 2Mbps
[12:31:16] <karlp> is your clock actually running at the freq you expect?
[12:31:44] <karlp> norbi, also, I thought you had the spi working, you were just working on understanding the readings in more detail
[12:32:14] <norbi> it was on 2mhz, somehow
[12:32:22] <norbi> not its fine on 4
[12:32:50] <norbi> i dont know it is fine, it looks like there is some noise
[12:35:32] <norbi> this is my output, and i cant understand it: http://pastebin.com/wY5RcpTh
[12:35:40] <norbi> why is that happening
[12:37:37] <norbi> looks like the sensor is not very stable, whitout a filter it wont work better
[12:37:45] <norbi> or the power supply is doing this
[12:37:50] <norbi> bit i dont think so
[12:42:10] <norbi> somehow at every 10 seconds the cs is going low then high
[12:42:20] <norbi> in rest it looks like its high
[13:20:13] <OndraSter> I prefer using logical analyzer for this, norbi
[13:21:18] <norbi> OndraSter: i dont have any
[13:22:15] <OndraSter> hmm
[13:22:16] <OndraSter> well
[13:22:21] <OndraSter> you know what to wish for xmas :)
[13:27:35] <norbi> :))
[13:29:12] <Essobi> What's a decent inexpensive logic analyzer? :D I want one for xmas.
[13:29:51] <OndraSter> I got that $15? one from ebay
[13:29:55] <OndraSter> but I think I burned it lol
[13:30:07] <OndraSter> the input impedance is rather small lol
[13:30:24] <OndraSter> 30mA pin draw and the pin's voltage drops (from 5V) to about 1.something volts
[13:30:30] <OndraSter> ergo, watch out :D
[13:34:41] <landonf> Essobi: I have a http://www.saleae.com/logic/ and a ZeroPlus logic analyzer
[13:35:13] <OndraSter> yeah, the ebay ones are copy of saleae :)
[13:35:21] <landonf> Essobi: They're both OK, prefer the Saleae for the lack of engrish, and you're not paying per protocol for analyzer plugins.
[13:51:52] <norbi> i cant figure out why on this output http://pastebin.com/wY5RcpTh Axz and Ayz is changing place
[13:58:42] <norbi> can you please check out a bit this code: http://pastebin.com/a57HzJCc
[13:58:54] <norbi> i want to understand why x and y flips
[13:59:01] <norbi> http://pastebin.com/wY5RcpTh
[14:10:52] <Tom_itx> add the delay after SBI so the registers have good data
[14:12:10] <Tom_itx> err after ss is enabled
[14:12:25] <Tom_itx> what's the 0xF2 do?
[14:12:30] <Tom_itx> start the data conversion?
[14:19:26] <derp> Hello, im using http://pastie.org/3006910 to make a led dim when a buttons is pressed, how do i prevent it from going back to its original brightness when i release the button?
[14:20:01] <Tom_itx> tell it not to
[14:20:09] <OndraSter> delete the else { }
[14:20:41] <derp> lololol:P
[14:20:43] <derp> ty:)
[14:20:53] <OndraSter> np
[14:21:03] <OndraSter> and put to the beginning the SetPWM(1);
[14:21:05] <OndraSter> before the main loop
[14:21:11] <OndraSter> so it lits up before pressing any button
[14:21:14] <mouche> derp: basically if one of the conditions weren't true, it would set the PWM Output to 1 in the else
[14:21:20] <OndraSter> yap
[14:21:52] <derp> i kinda figured this already,and actually did delete it but i must have done sumting wrong testing and concluded it was sumting else^^
[14:22:11] <derp> ty lots for help:)
[14:25:33] <Fleck> ;p
[14:34:04] * RikusW got some thrown out terminal boxes, there seems to be a 80188 inside :)
[14:34:17] <RikusW> and easy access to the bus
[14:34:51] <RikusW> wonder how easy it is to change its fw ?
[14:35:06] <Steffanx> For you.. very east :P
[14:35:09] <Steffanx> easy
[14:35:09] <RikusW> its sunnix and uniterm boxes
[14:35:38] <RikusW> there is even a vga porg
[14:35:40] <RikusW> port
[14:35:51] <RikusW> and cga on the sunnix
[14:36:57] <ys0> hola
[14:57:40] <OndraSter> RikusW, 80188?
[14:57:42] <OndraSter> huh
[14:57:45] <OndraSter> let me bing that :)
[14:57:51] <OndraSter> oh
[14:57:53] <OndraSter> something like 186?
[14:57:59] <RikusW> yes
[14:58:21] <RikusW> integrated 8088 + periperals or something like that...
[14:58:22] <OndraSter> ah, 186 for 8bit buses
[14:58:47] * RikusW wonders if gcc compiles 16 bit x86 code.... ?
[14:59:39] <OndraSter> remember that I am young so I don't know everything :P
[15:00:12] <Steffanx> Yeah, RikusW is an old man :P
[15:00:17] <RikusW> 2 got an actel A42MX24 fpga inside and an empty space for an 82595FX ethernet controller
[15:00:36] <OndraSter> o_O
[15:12:53] <RikusW> seems it actualy boots with some selftest and setup app ;)
[15:14:50] <norbi> Tom_itx: tried all the way
[15:14:53] <norbi> nothing
[15:15:20] <karlp> it definitely sounds like you'r enot following the datasheet rules on how to read data out though.
[15:16:11] <karlp> whatever those rules might be
[15:17:34] <RikusW> loopback on serial works, it might actually be nice when doing linux kernel debugging... whenever that will be....
[15:29:47] <OndraSter> RikusW, I prefer actually taking USB<>serial, hooking it up and connecting it to... anything with UART :P
[15:29:52] <OndraSter> works the same way
[15:30:58] <OndraSter> plus MAX232 for RS232 levels
[15:33:27] <RikusW> this is a dumb terminal, for use with a server....
[15:34:22] <OndraSter> well you can connect this to PC and actually use keyboard and something like putty :)
[15:34:58] <RikusW> why putty, is is hardware putty ;)
[15:35:05] <RikusW> it is*
[15:35:31] <RikusW> it can do ansi or vt100 or a few others too
[15:35:57] <OndraSter> but... if you use putty... you don't need another screen and another keyboard! ;D
[15:36:30] <RikusW> if you do kernel debugging you do need it...
[15:36:42] <RikusW> like I'll do that anytime soon :-P
[15:36:48] <OndraSter> I expect you to have two PCs :)
[15:37:12] <OndraSter> plus, such things I would be doing in vmware or any other virtualizing software that has virtual serial ports
[15:37:20] <OndraSter> try connecting your hardware to that :D
[15:37:34] <RikusW> this works too, got a vga and keyboard port
[15:37:58] <OndraSter> keyboard = old DIN? :D
[15:38:06] <OndraSter> I would actually find 3 or 4 keyboards for that
[15:38:35] <RikusW> a few, the 2 fpga ones have ps2
[15:38:54] <RikusW> fpga+80188
[15:39:10] <RikusW> don't know why the cpu wasn't put into the fpga as well...
[15:56:36] <Eduard_Munteanu> Hrm... is the AVR USART buffered? I mean, does it ever queue more than 1 byte for reception/transmission?
[15:56:52] <Eduard_Munteanu> (I'm interested in asynchronous operation, if it matters)
[15:58:32] <RikusW> afaik its a 2 byte buffer
[15:58:58] <OndraSter> one being rcvd and one waiting in the buffer?
[15:59:09] <RikusW> think so
[15:59:15] <Eduard_Munteanu> Oh, hm. Not much.
[15:59:19] <RikusW> inside UDR and a shift register
[15:59:28] <OndraSter> ye
[15:59:34] <Eduard_Munteanu> I wish there was some notion of DMA.
[15:59:40] <OndraSter> ye
[15:59:42] <RikusW> Eduard_Munteanu: you can use the rx interrupt
[15:59:56] <Eduard_Munteanu> Yeah, I'm planning on doing that.
[15:59:58] <RikusW> Eduard_Munteanu: xmega and avr32 does have dma
[15:59:59] <OndraSter> I need to move out about 16B of SPI data exactly 32*50 times per second
[16:00:04] <OndraSter> so
[16:00:05] <OndraSter> xmega
[16:00:07] <OndraSter> is it worth
[16:00:14] <OndraSter> or should I turn to ARM nowadays :)
[16:00:15] <Eduard_Munteanu> Eh, this is an atmega324PA
[16:00:59] <Eduard_Munteanu> But I'm going a bit OCD over the SRAM size more than anything :)
[16:02:38] <Eduard_Munteanu> I guess I can sacrifice a few bytes for a buffer.
[16:03:19] <Eduard_Munteanu> (for 2 USARTs that's 4 buffers, but still)
[16:04:03] <RikusW> seems there is a 2 byte fifo + shift register...
[16:05:11] <RikusW> If you do blocking write then no tx buffer required
[16:05:12] <Eduard_Munteanu> RikusW: hrm... might be a good idea to wrap the sending/receiving in a while() in case I can (de)queue more than 1 byte?
[16:06:02] <RikusW> at high bauds that might be useful
[16:07:13] <Eduard_Munteanu> I guess it won't continue sending data indefinitely, unless I'm running really low clocks / high baud rates.
[16:08:51] <norbi> guys, im able now to read bytes from serial with my win32 console application, but how can i transform that into text like putty does?
[16:09:59] <Eduard_Munteanu> norbi: if it's sending text then it's pretty much done, except for stuff like line conversions and interpreting some control characters.
[16:10:26] <OndraSter> just echo it :)
[16:10:50] <Eduard_Munteanu> Yeah, assuming you've got some sort of terminal emulator.
[16:11:10] * Eduard_Munteanu isn't sure about Windows though
[16:11:55] <norbi> no, im printf it, and getting totally different that im sending
[16:12:19] <Eduard_Munteanu> norbi: how different? Make sure the serial port is configured correctly.
[16:12:32] <Eduard_Munteanu> Otherwise you'll just get garbage.
[16:16:33] <norbi> hmm, it looks like simple cahracters are working
[16:16:38] <norbi> problem is the "\n"
[16:17:24] <norbi> how can i solve that?
[16:17:35] <RikusW> or \r\n....
[16:17:41] <Eduard_Munteanu> norbi: you probably want to send \r\n
[16:17:41] <norbi> yea
[16:17:52] <norbi> \r\n should work?
[16:18:29] <Eduard_Munteanu> Yes. In the case of text streams in Windows, \n silently gets converted to \r\n.
[16:18:49] <Eduard_Munteanu> But here it's just getting raw data from the serial port.
[16:19:53] <Eduard_Munteanu> (one reason for the difference between opening files in binary or text mode, on a related note)
[16:22:03] <norbi> yea, \r\n works
[16:22:25] <norbi> but first i need to start the client application, then just start sending data for synch
[16:22:40] <norbi> other way im getting wrong data, is there a way to fix this?
[16:23:47] <Eduard_Munteanu> Devise a protocol, or some sort of handshake before starting exchanging data.
[16:23:52] <OndraSter> yap
[16:24:13] <norbi> the good news is, that my glut window is communicating with serial, in a pretty good way :) i can send now just the x,y,z vectors to it from the acc meter and i could try to rotate a cube :)
[16:25:05] <norbi> almost there, i have just a bit and the cube is ready
[16:25:21] <norbi> rotating it will be easy
[16:25:42] <norbi> im afraid of noise, physics and kalman filtering
[16:28:22] * Eduard_Munteanu idly wonders if he should have added some external RAM on this board.
[16:45:34] <RikusW> Silicon Sculptor II programmers. The new price is $1055 :( for actel fpga's....
[16:46:24] <norbi> i have the adxl345 data in my computer sent via uart
[16:46:39] <norbi> im working now with radians to rotate the cube :)
[16:46:43] <norbi> almost done
[17:03:07] <Tom_itx> norbi, gettin any further with the adxl?
[17:09:06] <norbi> Tom_itx: yea
[17:09:39] <norbi> ive created now an opengl application that comunicates via serial with the mcu, that transmits the adxl data
[17:19:57] <abcminiuser> Got me some sweet Google shirts yo
[17:20:00] <abcminiuser> Just arrived
[17:21:48] <Tom_itx> are they googlishus?
[17:23:45] <abcminiuser> Yes, very
[17:23:54] <abcminiuser> Kinda rethinking the "Android Pride" one
[17:23:59] <abcminiuser> But then again, who cares :P
[17:24:14] <abcminiuser> Can't scare away too many ladies, already caught one
[17:24:19] <Tom_itx> you'll have a whole wardrobe to wear to work
[17:30:14] <abcminiuser> Yeah, that's my plan
[17:30:22] <abcminiuser> Atmel'ians wear jeans + TShirt
[17:30:30] <Tom_itx> may be a little chilly for tee shirts though
[17:30:32] <abcminiuser> So I can confuse them with a different Google shirt each day
[17:30:41] <abcminiuser> You take off your jacket first :P
[17:31:04] <Tom_itx> you should find some that are exactly inverted colors to really screw with their heads
[17:31:32] <vectory> what about good old flanell shirts
[17:31:49] <vectory> flannel*
[17:34:49] <vectory> figured t-shirt wasnt quite the engineer's style
[17:35:27] <Eduard_Munteanu> Hrm... scary fact... the historical x86 Linux kernel stack is twice as large as my AVR's SRAM size :)
[17:36:44] <Eduard_Munteanu> (actually... that's the 4k stacks)
[17:37:11] <vectory> with 20 mhz you rather run an rtos
[17:38:04] <Eduard_Munteanu> RTOS? Heh, that's a bit of a stretch.
[17:38:26] <norbi> guys, is there a way to open serial port with 2 applications?
[17:38:47] <norbi> i would like to check with putty simultanous with my app
[17:39:14] <Tom_itx> i've done a pass thru before
[17:39:18] <Tom_itx> with a separate pc
[17:39:25] <Tom_itx> and logged both directions
[17:39:37] <vectory> you can pipe, too
[17:39:37] <Eduard_Munteanu> norbi: why not just log everything to a file?
[17:39:41] <Tom_itx> but not on the same pc
[17:39:42] <Tom_itx> dunno
[17:39:43] <Eduard_Munteanu> Or display to stdout.
[17:40:32] <vectory> wouldnt be the first time, right zebus?
[17:40:36] <vectory> oops
[17:40:49] <vectory> wrong chan
[17:41:06] <Tom_L> http://www2.electronicproducts.com/Tri_axial_accelerometers_are_half_the_size_of_previous_devices-article-hlrc02_jan2012-html.aspx
[17:41:08] <Tom_itx> 2x2mm accelerometer
[17:41:18] <Tom_itx> norbi!!
[17:41:43] <abcminiuser> vectory, tshirts is the new cool engineer's style
[17:41:55] <abcminiuser> White plain dress shirts is ye-olde engineer
[17:42:07] <vectory> laid back and all :D
[17:42:08] <abcminiuser> Modern day post-2000 engineer is all tshirts and cool hair
[17:42:40] <jacekowski> emm, no
[17:42:45] <jacekowski> sometimes
[17:54:37] <norbi> Tom_itx: yes sry
[17:55:19] <norbi> i have some problems here with thus app
[17:55:28] <norbi> i didnt seen that you had written
[17:55:34] <norbi> http://pastebin.com/3a1FMTwA
[17:55:39] <norbi> here is my receive code
[17:56:00] <norbi> mcu waits for character "n", then starts to send bytes
[17:56:15] <norbi> client sends "n" and starts to receive bytes
[17:56:22] <norbi> but it doesnt work
[17:56:46] <norbi> im getting just -0.334534 and similar negative values, and those are changeing randomly
[17:57:16] <norbi> in uart buff shouldnt been anything else just the data is sent and received
[17:57:27] <norbi> it should be synchronized but still not
[17:57:29] <norbi> or dunno
[18:17:20] <abcminiuser> norbi, that might be the slowest application I've ever seen on an AVR
[18:17:29] <abcminiuser> double/float is VERY slow on the 8-bits
[18:17:45] <abcminiuser> Also, if you're using GCC, double == float, as there's no double precision floating point support
[18:21:48] <vectory> wait, that snippet wasnt for x86?
[18:26:48] <inflex> abcminiuser: wooo... slowest ever eh... well I've got an infinite loop for you !
[18:27:11] <abcminiuser> Heh
[18:27:25] <abcminiuser> vectory, wasn't paying attention, might have been
[18:27:27] * grummund steals inflex's crystal
[18:28:39] <vectory> norbi: you might ned to clarify here
[18:29:11] <grummund> it's AVR (and i don't even need to look)
[19:00:24] <grummund> http://www.linkedin.com/groups/Atmel-AVR-Developers-107940
[19:00:34] <grummund> anyone here a member?
[19:01:16] <Casper> member of what?
[19:02:12] <tlvb> of what is linked above probably?
[19:02:29] <grummund> linkedin AVR group
[19:02:34] <Casper> of what I didn't saw?
[19:02:42] <LoRez> whut?
[19:02:55] <tlvb> Casper: 01:51 < grummund> http://www.linkedin.com/groups/Atmel-AVR-Developers-107940
[19:03:01] <Casper> ah not me
[19:03:17] <grummund> if you don't know what linkedin is then pls just ignore :P
[19:03:38] <tlvb> Casper: did you just join the channel? (I think I have those messages turned off)
[19:03:49] <Casper> tlvb: I restarted xchat
[19:03:53] <tlvb> ah
[19:09:18] <rue_house> Tom_itx, the regulator is for 3.3v?
[19:15:13] <norbi> back
[19:15:31] <vectory_> norbi: so
[19:15:38] <vectory_> was that snippet of avr code?
[19:15:44] <norbi> yes, i know, ive tested just, but now im doing the calculations on the pc
[19:15:55] <norbi> im just reading the spi
[19:16:01] <norbi> and send it over to pc via uart
[19:16:49] <norbi> this is now the avr code
[19:16:50] <norbi> http://pastebin.com/bBuutVWz
[19:18:15] <rue_house> I whould have tobbor post thsi every day...
[19:18:34] <rue_house> #define SetBit(BIT, BYTE) BYTE |= (1<<BIT)
[19:18:34] <rue_house> #define ClearBit(BIT, BYTE) BYTE &= ~(1<<BIT)
[19:22:48] <rue_house> norbi, I cant understnad enough about what your doing
[19:23:02] <norbi> rue_house: ?
[19:23:02] <Tom_itx> rue_house
[19:23:05] <grummund> how does that help?
[19:23:06] <Tom_itx> you got toys?
[19:23:11] <rue_house> I do!
[19:23:25] <Tom_itx> yeah it's 3.3v
[19:23:30] <Tom_itx> goes on the bottom
[19:23:36] <Tom_itx> but you need to cut a trace if you use it
[19:23:43] <rue_house> ok, I'm all 5V, so I leave as is then,yes?
[19:23:47] <Tom_itx> normally you won't use it
[19:23:49] <Tom_itx> yes
[19:24:02] <Tom_itx> plug it in, it should blink
[19:24:14] * rue_house looks for a plug...
[19:24:16] <grummund> norbi: are you reading 16-bit values from the spi device?
[19:25:18] <Tom_itx> grummund 2 8bit
[19:25:29] <Tom_itx> it's divided up into 8bit bytes
[19:25:32] <norbi> yes
[19:25:34] <Tom_itx> for all 3 axis
[19:26:06] <rue_house> hmm no LED, isn't blinking, I'll try the other one
[19:26:16] <grummund> norbi: check you have the MSB/LSB byte ordering correct
[19:26:55] <Tom_itx> rue_house the big one has an led
[19:27:05] <Tom_itx> the other one is blinking but you can't see it
[19:27:23] <norbi> what is this operation means? AccelX_float^2
[19:27:23] <rue_house> that wprks
[19:27:36] <norbi> grummund, the ordering is correct
[19:27:38] <Eduard_Munteanu> norbi: ^ is bitwise xor
[19:27:59] <norbi> but it cant be applyed to float
[19:28:07] <norbi> just to binnary
[19:28:10] <rue_house> Tom_itx, where is the avrdude command line example?
[19:28:15] <norbi> why it wants me to xor the binary?
[19:28:17] <rue_house> oh this dosn't have a bootloader does it?
[19:28:22] <Tom_itx> you don't use avrdude
[19:28:26] <Tom_itx> use flip or dfu
[19:28:32] <Eduard_Munteanu> I have no clue off the top of my head how it works on floats but I guess there is a way that makes sense.
[19:28:36] <Tom_itx> they both have bootloaders
[19:28:53] <norbi> what is the sense if i do that with binary?
[19:28:54] <Eduard_Munteanu> It could be bitwise xor on the float's representation
[19:29:05] <norbi> it goves complement of 2?
[19:29:09] <Tom_itx> grummund, http://tom-itx.dyndns.org:81/~webpage/pdf/accl/ADXL345.pdf
[19:29:17] <Tom_itx> that's what he's using
[19:30:07] <Tom_itx> rue_house, push the button for program mode
[19:30:07] <grummund> would make sense to log the raw data and manually check it for correctness
[19:30:10] <Eduard_Munteanu> norbi: well, a float is a "string" of bits after all, just integers
[19:30:14] <Eduard_Munteanu> *just like
[19:30:17] <grummund> looking at processed data you have no idea...
[19:30:34] <Eduard_Munteanu> Now I'm not sure, but it could involve promotion to integer.
[19:31:03] <rue_house> Tom_itx cant use avrdude eh?
[19:31:05] * Eduard_Munteanu stops guessing, somebody who knows that for certain should say
[19:31:23] <rue_house> why dont I recall anyone setting up or working with flip or dfu
[19:31:28] <grummund> ^2 will flip bit-1
[19:31:41] <norbi> that means complement of 2?
[19:31:48] <Tom_itx> because you've been asleep rue_house
[19:31:50] <grummund> xor 2
[19:31:51] <norbi> why do i need to flip that?
[19:31:56] <rue_house> Tom_itx, :)
[19:32:11] <Tom_itx> i have a somewhat guide on my site for it
[19:32:21] <norbi> this is my formula http://pastebin.com/6DcsRXab
[19:32:21] <Tom_itx> i don't use dfu though
[19:32:38] <rue_house> http://tom-itx.dyndns.org:81/~webpage/
[19:32:52] <grummund> norbi: ^2 means xor with 00000010
[19:33:17] <Tom_itx> rue_house, look under firmware update: http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_User_manual_index.php
[19:33:26] <Eduard_Munteanu> grummund: he's confused by the float value in there
[19:33:33] <Tom_itx> but hold on, i gotta restart the router
[19:33:34] <rue_house> did you say these cant be prgrammed with the isp?
[19:33:50] <Tom_itx> you can but it will erase the bootloader
[19:33:57] <grummund> forget floats... just print the raw data in hex
[19:34:00] <rue_house> aaah
[19:34:04] <Tom_itx> you're better off using the bootloader
[19:34:27] <rue_house> the avr uses the normal boot vector unless its hard reset?
[19:34:46] <Eduard_Munteanu> (gdb) print ((float) 3) ^ 2
[19:34:47] <Eduard_Munteanu> Integer-only operation on floating point number.
[19:35:05] <Eduard_Munteanu> Right... so I guess in that case it implicitly converts to an integer and back.
[19:35:35] <Tom_itx> brb
[19:40:58] <Tom_itx> !thislog
[19:41:04] <Tom_itx> !thislog
[19:41:05] <tobbor> This one: http://rueshouse.dyndns.org:82/~ircjunk/irclogs/html/%23avr-2011-12-13.html
[19:45:56] <norbi> Eduard_Munteanu: from net
[19:46:05] <norbi> ive got an aplication for adxl345
[19:46:31] <norbi> but atan() give me very low value and i dont know how to transform it into +360 degrees
[19:46:38] <norbi> not negtive values
[19:46:38] <Eduard_Munteanu> norbi: perhaps you should ask a math/physics question then, and figure out what formula you need, or what that formula actually means
[19:47:00] <norbi> Eduard_Munteanu: from who?
[19:48:28] <grummund> google convert radians degress
[19:49:33] <norbi> grummund: im getting 0.0015 and this kind of values
[19:49:42] <norbi> below 0
[19:50:17] <grummund> norbi: well i guess you must have a bug there somewhere
[19:50:34] <grummund> if you fix the bug then the readings should be okay
[19:53:05] <norbi> look this is how it looks: http://imageshack.us/f/40/rectf.jpg/
[19:53:47] <norbi> and this is my code: http://pastebin.com/TuGs7JDh
[19:56:49] <norbi> these maths are driving me crazy
[19:57:01] <grummund> AccelY_float^2 + AccelZ_float^2
[19:57:09] <norbi> ?
[19:57:31] <grummund> Whatever you believe that is doing, i seriously doubt it.
[19:58:06] <norbi> do you have any other working formulas for this acc meter?
[19:59:27] <grummund> norbi: you should also print the values of AccelX_float, AccelY_float, ...
[20:00:57] <grummund> Quite apart from the maths is so obviously wrong, it appears the input data isn't known to be correct either.
[20:04:29] <norbi> http://imageshack.us/f/845/rect.jpg/
[20:04:30] <norbi> here
[20:04:40] <norbi> ive printed the accelx,y,z
[20:06:29] <norbi> this is driving me crazy
[20:06:50] <norbi> plus one more problem is that i do the maths on the graphics part
[20:06:58] <norbi> where there is just 30fps
[20:07:11] <norbi> that means something like 30 reads/s
[20:07:40] <norbi> i have readings listed after 10 seconds that ive shutted off the mcu
[20:07:41] <norbi> ?
[20:07:51] <norbi> dunno yet how is that possible
[20:11:09] <Eduard_Munteanu> norbi: if you power off the MCU board you could just be getting garbage of the serial line
[20:11:12] <Eduard_Munteanu> *off
[20:11:56] <norbi> no, there is a delay
[20:13:30] <norbi> 4kbytes/frame
[20:13:32] <norbi> aprox
[20:13:47] <norbi> no sorry
[20:13:51] <norbi> bad calculation
[20:14:48] <norbi> it has to process 124kbytes/s and it does just 240bytes/sec
[20:15:13] <Eduard_Munteanu> 124KiB/s sounds like a lot for a plain serial line
[20:15:36] <norbi> so totaly delay is 516* normal reading
[20:16:02] <norbi> anyway on mcu the spi readings are simultaneous with serial speed
[20:16:12] <norbi> so at base is the 9600 baud
[20:17:56] <Eduard_Munteanu> I'm not sure what you're doing but you might want to try to trim down all that data.
[20:17:58] <norbi> so aprox 76k?
[20:18:44] <Eduard_Munteanu> 76k what?
[20:18:54] <norbi> Eduard_Munteanu: i have to figure out, how to read the serial with this program corectly, i mean real synchronization
[20:19:07] <norbi> second i need to separate somehow the readings from the graphics
[20:20:07] <norbi> because if i read simultaneously with the rendering, it will slow down the reading in a weird way, it creates a long delay of showing data, it shows 240bytes/s
[20:20:18] <norbi> of some kilos
[20:20:41] <norbi> but readings arent lost, just delayed
[20:20:43] <norbi> in time
[20:21:08] <norbi> instead of listing all the kilos / sec it delays it
[20:21:17] <norbi> it keeps them into a buffer or something
[20:22:20] <norbi> i know it sounds weird
[20:22:25] <norbi> but data is not lost
[20:23:04] <norbi> imagine an old pickup sound that rotates very slowly
[20:23:32] <norbi> you hear the sound but slowly
[20:23:56] <norbi> this happens here with the bytes, they are not lost between the frames
[20:25:43] <norbi> anyway i will let it go
[20:25:54] <norbi> it is 4 in the morning here
[20:26:04] <Tom_itx> you should be here then
[20:26:05] <norbi> i didnt sleept at all
[20:26:20] <norbi> Tom_itx: ?
[20:26:21] <Tom_itx> you will dream up a solution
[20:26:35] <norbi> i hope
[20:26:38] <norbi> but i need to rest
[20:28:29] <norbi> bye bye!
[20:28:37] <norbi> thank you for your support!
[20:28:41] <Eduard_Munteanu> norbi: good night
[20:28:52] <norbi> thanks, same to you when it comes :)
[20:28:56] <Tom_itx> later