Topic for #qi-hardware is now Copyleft hardware - http://qi-hardware.com | hardware hackers join here to discuss Ben NanoNote, atben / atusb 802.15.4 wireless, and other community driven hw projects | public logging at http://en.qi-hardware.com/irclogs
<hozer>
I have not tried anything with lm8 .. I am fighting with libstdc++ problems with iverilog now
<wpwrak>
grmbl. i load a busy loop into that LPC111x and it draws LESS current than the boot loader ??
<wpwrak>
at least this tells me that something has changed. don't see any I/O activity yet
<wpwrak>
now .. where's the stupid bug that keeps all this from working ...
<whitequark>
wpwrak: hm. yes. well, not literally.
<whitequark>
I missed something somewhere.
<whitequark>
wpwrak: I thought a lot if I should provide an AVR backend for my language implementation
<whitequark>
LLVM already has one; it seems that it could only work in quite a restricted mode compared to things I could freely do on 32-bit MCUs
<whitequark>
this is true of GCC as well, of course
<whitequark>
basically I decided to concentrate on ARM, more precisely Cortex-M3, first, and then see if/where should I expand the support.
<wpwrak>
makes sense. first see if the concept works at all, then go multiplatform
<whitequark>
exactly
<wpwrak>
victory ! :)
<wpwrak>
had to set the LSB in vectors to indicate thumb mode. duh.
<whitequark>
yeah. sometimes you need to fight with assembler to do that :)
<wpwrak>
it's all in C. i'm holding them to their promise that you can use that chip without ever touching assembler
<wpwrak>
i do check the assembler, though ;-)
<whitequark>
yeah, I like how the interrupt controller implements EABI itself
<whitequark>
it seems that they tried to pack half of an RTOS in hardware and succeeded
<wpwrak>
indeed ;-)
<whitequark>
also. not sure about NXP, but STM32 makes peripherals in a kinda nice way which for 80% of cases basically allows to chain them with DMA and trigger lines
<whitequark>
so that you don't even need to handle interrupts, most of the time
<whitequark>
yay power consumption
<whitequark>
(and the fact that I can take a user-readable map for such interaction written in Ruby, process it on the host and turn into register values, all without bothering the user too much ;)
<wpwrak>
i don't see DMA in my chip. it's a pretty low-endish one anyway.
<whitequark>
wpwrak: another very, very nice thing is how I avoid checking bounds on most array accesses yet make accidental memory corruption pretty hard
<whitequark>
the point is, you very rarely need to "just" index an element in an array
<whitequark>
almost all time you want to iterate it, or maybe add data to circular buffer, or push something onto stack, or whatever. so...
<wpwrak>
yes, if your compiler can figure out what the loops do, it can do the check outside the loop, and even decide it doesn't need one if the bounds are constant
<whitequark>
the trick is to use closures whenever possible
<whitequark>
in a very similar way, you could update elements in an array with #map! method, compute a sum (or any different derivative) with #reduce
<wpwrak>
yeah, a higher-level pattern to analyze then
<whitequark>
I don't even need to analyze anything
<whitequark>
I just spare the user from writing indexing code manually in most of the cases, and the problem with incorrect manually written indexing code fades away :)
<whitequark>
it is amazing how much errors you can eradicate by basically just shuffling code around, with nothing to pay at runtime, and without complex and possibly flawed static analysis
<whitequark>
my main optimization is inlining, as you can see. I inline methods and closures, everything, and up to the point where nothing else could be inlined. (In fact, I internally implement methods as closures.)
<whitequark>
and, again, I don't need anything too complex; performance impact of inlining all the simple cases dwarfs all the other ones, combined
<whitequark>
inlining (combined with SSA and escape analysis) is also how I infer types. without knowing what #each does, it won't be possible to determine the type of `val' inside the closure
<whitequark>
(SSA helps to figure out types for variables. e.g. `if foo; a = 1; else a = "bar"; end' is an error)
<wpwrak>
hmm. given a symbol whose address is known at link time. i want to use the negative address in a constant initializer. seems impossible, doesn't it ?
<wpwrak>
(it's to calculate a checksum)
<whitequark>
hm
<whitequark>
I think it is possible
<whitequark>
with linker scripts you can perform arbitrary arithmetics on symbol addresses, so define `b = 0 - a', and then use `&b' in your initializer
<whitequark>
this *should* work
<whitequark>
in fact, simply use 0 - &b in your initializer.
<whitequark>
and -Os
<wpwrak>
ah, that's a good idea. let's see if ld likes it, too
<whitequark>
the latter won't work: test.c:2:10: error: initializer element is not a compile-time constant
<whitequark>
(yeah, it's a link-time one. relocs probably cannot express the relation required here.)
<wpwrak>
doing the - in the linker script seems to do the trick. lemme check the math ...
<whitequark>
btw, why would you want such a checksum?
<wpwrak>
the LPC111x boot loader uses that to determine whether the vector table is valid
<whitequark>
I see
<whitequark>
what do you do with that nxp thingy? a new qi-hw project?
<wpwrak>
i'll use it to control my LED bar
<whitequark>
(btw, do check the errata list for your MCU. nxp is famous for not fixing obvious bugs :/)
<whitequark>
(on the other hand, STM kinda tends to miss them. a guy I know recently found that if PLL freq >= 64 MHz and MCU is put to sleep, it'll never wake up. Errata updated :)
<whitequark>
(problems with NXP included something like non-working SD card boot in revs A-F, which was found in rev A)
<wpwrak>
"let's not fix this since somebody may depend on that feature" :)
<whitequark>
I don't even want to know what was in the head of a manager who decided to avoid fixing that
<wpwrak>
it may be just that
<whitequark>
well, they fixed it eventually
<wpwrak>
they have lots of little feature updates. but each gets a new part number, not just a chip revision.
<whitequark>
of course, it's next to impossible to buy the right revision
<whitequark>
and none of the 3rd-party developer boards would have it
<wpwrak>
get to know your FAE and treat him well :)
<whitequark>
FAE?
<whitequark>
field applications engineer?
<wpwrak>
Field Application Engineer. the hybrid sales/tech critter manufacturers send to their "good" customers.
<whitequark>
oh, I also have a nice story about TI
<whitequark>
the same guy bought a Smart Battery System devkit
<whitequark>
you know, the one where battery authenticates the host via RSA (or something like that) prior to providing the power, and commits suicide if you try to update its EEPROM a little too hard
<whitequark>
(I still have no idea why battery authenticates the host and not vice-versa)
<wpwrak>
sounds like a fun concept :)
<whitequark>
it's probably in your notebook, if you have one
<whitequark>
*laptop
<whitequark>
so, he buys this devkit, plays with it for some time and forgets for half a year
<whitequark>
after that, he tries to redownload the datasheet. boom, there is zero hits on TI site by partnumber
<whitequark>
he asks the support where the datasheet is and gets a reply that they don't have such a part and never did
<whitequark>
he shows them the order number and photos
<whitequark>
and GETS BANNED.
<wpwrak>
;-)
<whitequark>
how the...? I don't even understand how such a thing is even possible?!
<whitequark>
and why?!
<wpwrak>
that would usually be a good moment to talk to some friends in the press. make sure whatever TI are trying to cover up gets as much coverage as possible :)
<whitequark>
the parts with adjacent numbers are still there
<whitequark>
heh
<whitequark>
for me, this just doesn't make a slightest bit of sense
<whitequark>
wpwrak: btw, do you have a degree in EE? or another kind of finished formal education?
<whitequark>
electronics-related, that is
<wpwrak>
well, there was a bit of electronics in comp. sci. and i have a phd in communication systems. (though that didn't involve the lower layers)
<wpwrak>
so the qi-hw stuff i'm playing with is mostly DIY learning
megharsh has quit [Ping timeout: 255 seconds]
<whitequark>
I wonder how would the fact that I'm a college dropout affect my employment (if the language thingy doesn't take off). Programming websites in ruby is nice, but it's definitely not what I'd like to do for the rest of my life.
<whitequark>
(and that what I learned has nothing to do with CS nor EE)
<wpwrak>
makes things more difficult, of course. it helps if you make projects that have a lot of visibility.
<whitequark>
(on the other hand, I'd need some kind of degree to emigrate anyway, so...)
<wpwrak>
degrees are useful to keep the paper-pushers happy :)
<whitequark>
this is their main purpose :)
<whitequark>
I've seen vacancies for cleaners with a degree. not joking.
<wpwrak>
somebody must be enjoying that
<whitequark>
well, it is not like HRs were extra clever anyway. another example: mail.ru (think russian yahoo) HR once interviewed my now-colleague. half a year (sic) later they send him a e-mail, say that they lost the results (sic) and ask him to come again
megharsh has joined #qi-hardware
<whitequark>
this is slightly below the median. again, I wish I was joking.
<wpwrak>
the world needs stupid people to keep the IQ balanced :)
xiangfu has quit [Quit: leaving]
xiangfu has joined #qi-hardware
megharsh has quit [Ping timeout: 264 seconds]
xiangfu has quit [Ping timeout: 255 seconds]
xiangfu has joined #qi-hardware
xiangfu has quit [Ping timeout: 276 seconds]
jekhor has joined #qi-hardware
jekhor has quit [Ping timeout: 264 seconds]
qwebirc19260 has joined #qi-hardware
<qwebirc19260>
hello
xiangfu has joined #qi-hardware
jekhor has joined #qi-hardware
wolfspra1l has joined #qi-hardware
wolfspraul has quit [Ping timeout: 265 seconds]
qwebirc19260 has quit [Quit: Page closed]
jekhor has quit [Ping timeout: 276 seconds]
jekhor has joined #qi-hardware
porchao has joined #qi-hardware
porchaso0 has quit [Ping timeout: 264 seconds]
<viric>
I've an old bttv card... does anybody have experience with that?
porchao has quit [Ping timeout: 255 seconds]
porchao has joined #qi-hardware
<wpwrak>
viric: i used to watch tv on that kind of critter
<viric>
it's a hell
<viric>
I used one slot, it said it can't route irq or so
<viric>
I used another slot, and the system doesn't see it
<viric>
and I don't have more slots
<viric>
What's a cheap device to capture from S-video or so, these days?
<wpwrak>
kyak: the PIN(mask) macro does that. see the README for all the details :)
wej has joined #qi-hardware
<wpwrak>
hozer: combine with a nonsense text generator and you can automatically file a few hundred patents per day. that should be a useful portfolio. whenever something new pops up, you search your nonsense patents for a match. every once in a while you ought to have something ...
<hozer>
wpwrak: it costs $125 a pop to file
<hozer>
so I think it would work better if there were humans in the loop
<hozer>
oh, that's US patents. I have no idea about international stuff
rz2k has joined #qi-hardware
<wpwrak>
$125 isn't all that much. humans are far more expensive.
<hozer>
okay fine, write me a nonsense patent generator and I'll start filing them :)
<hozer>
you can have 25% of the patent license fees recovered ;)
jekhor has joined #qi-hardware
<whitequark>
hozer: why XHCI is nonsense? it's industry standard and soon it will be everywhere.
<hozer>
show me the vhdl :P
<whitequark>
hozer: use the spec to write one
<hozer>
there's an opencores usb2.0 host, right?
<whitequark>
hozer: as far as I know, no. but my knowledge might be outdated. let me check
<whitequark>
yeah, it doesn't seem there is an EHCI controller on opencores
<whitequark>
ha. this new year eve resembles for me exactly what it is: just another regular day. and I like it.
mwic has joined #qi-hardware
<wpwrak>
low paranoia, moderate anger ? :)
<whitequark>
wpwrak: I think you might have a slightly biased view of me now :) stuff tends to accumulate for months.
<wpwrak>
;-)
<whitequark>
more like the opposite. doing socially expected stuff at socially expected holidays can be quite stressful.
<wpwrak>
indeed. the famous xmas effect. all those family dramas and so on.
<whitequark>
hm, I never encountered this as a well-known effect. just an observation. through this doesn't surprise me
<wpwrak>
i don't know if it has an official name. but each year around this time people get crazy.
<wpwrak>
particularly towards the 24th, of course. the 31st tends to be much better.
<whitequark>
here it is slightly different. almost no one celebrates 24th. those who do, make it at Jan 7th "old style" (calendar change, etc.)
<whitequark>
but it's not much either
<whitequark>
so all the insanity dumps into the air at 31th
<wpwrak>
i guess all those who feel that certain urge to kill their family/significant other/previous significant other/neighbours/etc. or be killed by them will have had opportunities to do so by now, so things are less tense
<wpwrak>
ah, i see
<wpwrak>
other countries, other insanity days :)
<whitequark>
yeah. I think it's due to the fact that USSR tried to eradicate religious holidays, with quite some success
<wpwrak>
not a bad idea
<whitequark>
why?
<wpwrak>
disentangle things a bit. well, depends on whether they remove them or whether they replace them with equally arbitrary holidays.
<whitequark>
of course, they replace with arbitrarily holidays. with names which make some religious things look perfectly sensible in comparison
<whitequark>
*arbitrary
<whitequark>
ha, it dawned on me that you (and anyone non-russian, for that matter) probably don't know anything about our holidays :) let me elaborate then
<whitequark>
there isn't much of them. Main ones:
Jurting_pc2 has quit [Read error: Connection reset by peer]
<whitequark>
1. Dec 31st. New Year, all that. Celebrated by gifting neatly packaged stuff (only children are lucky enough to get anything actually useful), dressing a fir tree in glass balls/figurines and colorful ribbons, and heavy drinking.
<whitequark>
two weeks before everything is paralyzed due to sheer traffic. week after is simply dead. two weeks after early brids return to work.
<whitequark>
everything kinda returns to normal to early-mid february
Jurting_pc2 has joined #qi-hardware
<whitequark>
2. Feb 23th. Day of Motherland's Defender (or something like that). Basically boys' day. (It is quite ironic that probably most of the people getting greetings on this day never were in army and have absolutely no intent). Celebrated by gifting cheap pens and notepads. Not a national holiday AFAIK.
<whitequark>
3. May 8th. International Woman's Day. (Is it actually "international"? I'm not sure.) Basically girls' day, symmetric to the previous one. Equally useless gifts, also flowers.
<whitequark>
er, March 8th, of course
<whitequark>
4. May 9th. Day of Victory (in WW2). Celebrated by wearing these bands http://img0.liveinternet.ru/images/attach/c/1//58/652/58652752_5116_1.jpg in places appropriate and not (they'll hang from everywhere for several extra months), saying how all of you are proud of veterans due to whom you're currently alive, and having no respect whatsoever to said veterans. (I wish I was being sarcastic.) Fortunately, soon there won't be any left to obser
<whitequark>
ve this shame, and it'll become just another day to drink on. National holiday. Usually clustered with a few more days off, producing a total clusterfuck in calendar where weekdays are arbitrarily shuffled.
<whitequark>
(I never understood what logic do they use to reorder days. It is incredibly confusing, and also some institutions suddenly decide they won't live up to a national standard. Like schools.)
<wpwrak>
31st sounds like 24/25th in the west
<wpwrak>
except that, at least in the northern hemisphere, people return to work relatively soon thereafter
<wpwrak>
in the southern hemisphere, this marks the begining of the summer holiday season
<whitequark>
5. Sep 1th. Day of Knowledge. Celebrated by observing kids on the internet and facepalming. Seriously now: everyone goes to school; kids in primary and middle school bring tons of flowers and chocolate to teachers.
<whitequark>
High school, basically the same, less flowers. University: even less flowers.
<wpwrak>
day of knowledge sounds sweet :)
<whitequark>
well, chocolate and flowers are the default gift for women here
<whitequark>
used on all holidays. it's just that teachers, especially in primary/middle school, are mostly women
<whitequark>
one can end up with 5-8 packs of chocolate sweets at the end of the day
<wpwrak>
useful for fattening up for that harsh russian winter
FrankBlues has joined #qi-hardware
<whitequark>
hmm, let me check if I missed something. is looking up holidays of your own country on wikipedia that bad?..
<whitequark>
ah, Jan 14th, "Old New Year". Oxymoron intended. Basically you have a week starting at 31th, 7th and 14th to begin drinking and get rid of hangover to prepare for the next one.
<whitequark>
Or just do it non-stop.
<whitequark>
also calendar-related quirk.
<whitequark>
lolwtf, Jan 14th is also Day of Creation of Pipeline Carrier Armed Forces.
<whitequark>
Stalin surely had a sense of humor.
<whitequark>
Jan 25th, Day of students. Day when MSU was founded. Nothing really interesting.
<hozer>
yeah, but where can I just 'apt-get install' it from :P
<wpwrak>
you check out the repository :)
<hozer>
so here's a theory.. say I lay out a board with Kicad, and annotate all the pins
<hozer>
no, not yet :)
<hozer>
and then I change out a Xilinx FT256 (17mmx17mm, 1.0 pitch), for a CSG324
<wpwrak>
and for modules, you also need to convert: check out and install fped (or apt-get install it - it's now in debian), then run "make" in kicad-libs/modules/
<hozer>
there should, in theory be some way to generate the part of the constraints file and auto-route the pcb, right?
<wpwrak>
huh ? not sure what you mean
<wpwrak>
what means "annotate all the pins" ?
<hozer>
when you make an fpga bitstream, you have this file that 'constrains' all the signals to physical pins on the fpga part
<wpwrak>
and what autorouter to you mean ? freeroute ?
<wpwrak>
oh, that. well, kicad knows nothing about that :)
<hozer>
I have no idea, I've never actually done this, but this is what I *want* to be able to do
<wpwrak>
you could make such a tool. of course, you'd want such tools for a great many other things, too.
<hozer>
so if I have a board, with a schematic, and I have an FPGA signal named MGTRXN1, and it's wired to pin5 on a mini-displayport or something
<wpwrak>
in the end, everybody does these mappings manually ...
<wpwrak>
yes, i understand. and it would be the same for, say, microcontrollers.
<hozer>
yep
<wpwrak>
i.e., "the gpio that connects to the green led"
<hozer>
*exactly*
<hozer>
and you type 'make' and the PCB autorouter and the FPGA placer go fight over what pin on the fpga (or micro) it gets
<wpwrak>
as far as i know, no tool that lets you work at that level exists
<wpwrak>
and we don't have a usable autorouter anyway :)
<hozer>
heh, why not ;)
<wpwrak>
you can choose between one that's open but doesn't work, and one that does work but is closed
<hozer>
so what's the open one that's busted
<wpwrak>
the one built into kicad. or at least it was there. may have been dropped since.
<wpwrak>
there's also an autoplacer that visually shows how kicad is looking for the worst possible placement. that makes it not only unusable but also incredibly slow.
<wpwrak>
i'd consider these critters misguided practical jokes
<wpwrak>
besides, an auto-whatever is rarely good enough to get the job done
<wpwrak>
interactive routers are much more useful
<hozer>
okay, does kicad have that?
<wpwrak>
ionly the external web-based and closed "freerouter"
<hozer>
so the ideal situation is the interactive router knows that there are X number of possible pins my LED wire can go to on the micro
<wpwrak>
yes, something like that
<hozer>
this is still really an art, isn't it?
<wpwrak>
when push-routing, it could then not only push traces out of the way, but also swap them as suitable
<wpwrak>
yes, pretty much
<wpwrak>
that sophisticated pattern matching engine we carry around in our skulls is still rather impressive :)
<hozer>
so sometime in the next 15 years I'll need to replace undocumented micros from bankrupt companies to get the old farm equipment working
<hozer>
I'm amused by them.
<hozer>
I love the excitement, but I don't think any of them have ever actually grown enough food to survive for a year
<whitequark>
I don't see how this is bad
<whitequark>
it's not like, for example, Qi HW is self-sustainable either...
<hozer>
they are excited about the 'lifetrac' , but don't seem to have any understanding of the practical reasons why the design of a tractor hasn't fundamentally changed in 30 years
<hozer>
what's changed on the tractor is addition of silicon... thus anyone getting into farming *now* will need Qi-HW
<whitequark>
hozer: what's wrong with lifetrac?
<hozer>
hrrm.
<hozer>
it's kinda like trying to use an FPGA on a high-volume production item where power consumption and battery life is critical
<hozer>
Lifetrac is basically a skid-loader, and does not work very well at all as a tractor
<hozer>
and having it try to do both functions makes it bad at both
<hozer>
tractors are designed to pull, thus the big wheels in back, and engine up front
<whitequark>
well, it's not like they actually can do mass-production yet. maybe it's better to use an FPGA at this stage.
<whitequark>
they seem to do a lot of real, tangible work. I'd love to see what comes out.
<hozer>
yeah
<hozer>
the thing is I bought a perfectly good tractor for $2500
<hozer>
they spend quite a bit more than that fabricating the lifetrac
<hozer>
that's not the labor, that's just the materials
<hozer>
now, if I could put some open-source GPS receivers and a network on my 30 year old combine, THAT would provide some real productivity gains
<hozer>
the best thing the OSE guys are doing is making open-source machine tools
<hozer>
so I could make a cold saw from their designs and cut and fabricate replacement parts from a scrap pile
<whitequark>
nice
<whitequark>
hozer: do you want to achieve self-sustainability for the sake of it? or something else?
<hozer>
so, in summary, I like what the OSE guys are doing. But as the guy who got (more than) half his income from corn/soybean sales this year, the *real* civilization starter kit is on #homecmos
<kristianpaul>
hozer: what feature you need from an open-source gps receiver implementation?
<kristianpaul>
Hi btw
<hozer>
centimeter accuracy
<hozer>
that's repeatable over a span of 25 years
<hozer>
so.. that's going to require some sort of ground-based RTK or whatever the acronym is base station
<kristianpaul>
that can be achieved not only by be open source, i meant is not the gps receiver fault at all
<hozer>
ground-penetrating radar (or a robot) to figure out if the tile maps are accurate befor digging would be nice too
<kristianpaul>
you can mix with glonass
<kristianpaul>
add navigation
<hozer>
in reality, I probably don't need (or want?) gps at all, I just want 802.11a/b/g with a couple of base stations at the corners of the field that do triangulation
<hozer>
if you have to do RF, you might as well transmit/receive usefull data over a standard protocol, right?
<whitequark>
hozer: 80211? triangulation?
<hozer>
well, why not?
<hozer>
if you have a software defined radio, and good timestamps, can't you figure
<hozer>
out how far away from the transmitter you are?
<whitequark>
oh, you want to measure signal propagation delay
<whitequark>
well, if you figure out how to synchronize clocks on such scale... good for you
<hozer>
hah
<whitequark>
this is going to be very hard IMO
<hozer>
well, that might be what gps is good for ;)
<whitequark>
wpwrak might know more about it
<whitequark>
hozer: gps does not provide the accuracy you need
<whitequark>
the Cu content is somewhere around 1.5%, IIRC, but it's a heavy metal nevertheless
<wpwrak>
ah right, lead-free formulas often have traces of copper
<whitequark>
huh, indium solder
<whitequark>
isn't In quite rare as it is to waste it on solder?
<wpwrak>
hmm, seems that there's no nice way for a process to find out if it has been mlockall'ed
<whitequark>
wpwrak: /proc should have that somewhere
<wpwrak>
neither /proc/<pid>/maps nor /proc/<pid>/pagemap reveals VM_LOCKED
<wpwrak>
must be the one thing that /proc doesn't have :)
<whitequark>
The VmLck field of the Linux-specific /proc/PID/status file shows how many kilobytes of memory the process with ID PID has locked using mlock(), mlockall(), and mmap(2) MAP_LOCKED.
<whitequark>
let me check how it changes...
<wpwrak>
hmm, that could be used as a hint ...
<wpwrak>
interesting. one page below VmSize or VmRSS
jekhor has quit [Ping timeout: 265 seconds]
<wpwrak>
that'll be good enough. thanks !
Maroni has joined #qi-hardware
<whitequark>
wpwrak: have you seen Unicore32?
<whitequark>
it seems that it is basically a Chinese clone of ARM ISA
* whitequark
sent an SMS 3 seconds prior to midnight. let's see how long will it take for it to arrive...
<whitequark>
1:25. not bad.
<hozer>
seems like we need a latency plot of sms messages vs time ;)
<whitequark>
hozer: new year. gsm networks were so overloaded at previous years as to go down completely for hours
<hozer>
commens on the kicad-libs.. wasn't there a guy that did 3-D modules?
unclouded has joined #qi-hardware
urandom_ has joined #qi-hardware
urandom__ has quit [Ping timeout: 245 seconds]
<whitequark>
ha, at 0:27: latency 1:55:00
<wpwrak>
two hours ? so it's something like 02:30 at your place ?
<wpwrak>
my world time map has most of western russia around 01:30