#avr | Logs for 2011-12-07

Back
[01:51:58] <geckosenator> I found 30 avrs today
[01:52:01] <geckosenator> in my boat
[01:53:11] <winferno> better than finding a hole in the bottom of it.
[01:53:43] <geckosenator> haha
[01:53:59] <geckosenator> I plan to use them for something
[01:56:54] <Casper> geckosenator: use them to make an autopilot
[01:57:30] <geckosenator> I was going to get those new honeywell magnetic sensors
[01:57:38] <geckosenator> they are 3 axis but cost <$1 in quantities
[01:58:11] <geckosenator> and I can't decide between the bma180 or the freescale mma8452q accel
[01:58:15] <geckosenator> not sure which one is better
[01:58:34] <geckosenator> but i already have reels of all the other components i need
[02:00:18] <geckosenator> but I need gyros for a decent autopilot
[02:00:38] <geckosenator> it may be possible without if it has gps so it can learn the boat dynamics over time
[02:01:28] <Casper> or just a compass
[02:01:34] <geckosenator> yes
[02:01:39] <geckosenator> but gps speed is helpful
[02:01:51] <geckosenator> because it can use it as feedback to learn the optimal steering pattern
[02:01:54] <Casper> gps + true compass should be good enought
[02:02:09] <geckosenator> but, if you want to steer for comfort, gyros are probably needed
[02:02:20] <geckosenator> actually just gps would probably work
[02:02:24] <Casper> gps should be precise and fast enought to tell if you're drifting
[02:02:40] <geckosenator> since gps gives you heading as well
[02:02:56] <geckosenator> it could be an issue in some of the sea states I've been in though
[02:03:08] <Casper> hmmm probably that just gps yeah....
[02:03:16] <geckosenator> really, gps+wind direction is the best
[02:03:26] <geckosenator> wind speed would be helpful as well
[02:03:36] <geckosenator> but wind direction is more important than magnetic heading anyway
[02:03:38] <Casper> and some vector math
[02:03:46] <Casper> and you find the true wind direction and speed
[02:03:52] <geckosenator> I already have wind speed and direction
[02:04:02] <geckosenator> true wwind direction is kind of irrelevant though
[02:04:06] <Casper> yes, but if you're in movement the data is not right
[02:04:10] <geckosenator> its fun to know but it isn't really important
[02:04:20] <geckosenator> yes especially if you are rolling a lot
[02:04:32] <geckosenator> and the wind sensor is at the top of the mast heh
[02:04:33] <Casper> well, it might be usefull to be able to compensate for it making the boat drift
[02:05:04] <Casper> and man... father used to have a boat, a 21ft
[02:05:11] <geckosenator> most autopilots only have a 2 axis compass
[02:05:16] <Casper> and when it was windy it was hard to take it out of the water
[02:05:26] <geckosenator> which makes them basically crap but they still keep a course
[02:05:46] <geckosenator> take it out?
[02:05:58] <geckosenator> the boat stays in the water all the time unless the wind gusts really hard heh
[02:06:16] <Casper> he had no way to leave it in the water
[02:06:23] <geckosenator> anchor?
[02:06:36] <Casper> yes, but no place to park
[02:06:36] <geckosenator> my boat is always in the water except last week when I careened it on a mud bank
[02:07:04] <geckosenator> in nz there is no shortage of places to keep a boat heh
[02:07:12] <Casper> the marina near where he live closed (and was charging an arm and a leg)
[02:07:39] <geckosenator> here they have iron posts stuck in the river
[02:07:44] <geckosenator> and you just tie on to two or more of them
[02:07:51] <Casper> and the river behind his house... the land is owned by an asshole who refused to let him park a boat...
[02:08:02] <geckosenator> normally you cannot own water
[02:08:09] <Casper> no you can not
[02:08:14] <Casper> but you can own the land around it
[02:08:18] <geckosenator> and if it is navigable water, then anyone can go there
[02:08:24] <geckosenator> you could anchor there though
[02:08:34] <Casper> yes, but no access right
[02:08:38] <geckosenator> but yeah without shore access is crap
[02:08:55] <geckosenator> the other problem with rivers...
[02:09:01] <Casper> the place to put the boat in water was only about 10 mins away
[02:09:02] <geckosenator> mosquitoes are biting my fingers as I type
[02:09:26] <Casper> that boat was quite powerfull
[02:09:27] <geckosenator> I want to get a boat with fold down wheels and bicycle pedal drive train
[02:09:38] <Casper> a reinel 1967, 21" sterndrive
[02:09:53] <Casper> 170hp v8
[02:09:58] <geckosenator> why not just anchor it in the river and take a dingy to it?
[02:10:12] <geckosenator> from 10 minutes or whatever
[02:10:36] <geckosenator> autopilots on powerboats are probably way easier to design heh
[02:10:56] <geckosenator> at least small ones since they don't go out in big seas
[02:11:10] <Casper> but man... that boat really had issues... he repaired LOTS of stuff
[02:11:37] <Casper> but one of the last thing he fixed was the rubber where the transmission fit...
[02:11:52] <Casper> you know, that rubber that prevent the water from going in...
[02:12:01] <Casper> had a nice hole 1" long
[02:12:14] <Casper> personally I think someone stick a knife in it
[02:12:29] <Casper> the rubber seemed too strong still for it to slice like that
[02:12:34] <geckosenator> sabotage is not uncommon heh
[02:12:38] <Casper> we went on the water
[02:12:49] <Casper> I noticed the bilge pump that was working....
[02:12:53] <Casper> and working....
[02:12:57] <Casper> .... and working....
[02:13:01] <Casper> and turning off...
[02:13:08] <Casper> and turning back on 5 seconds later...
[02:13:17] <geckosenator> at least it could keep up
[02:13:22] <Casper> ... checked the engine room, and wow...
[02:13:26] <geckosenator> I've been in weather where it couldn't
[02:13:43] <geckosenator> and I'm 40 miles out from san francisco
[02:13:50] <Casper> went back out... and we got issue to pull it out, wheels was spinning :D
[02:14:13] <geckosenator> with an engine you can route the cooling intake into the bilge too
[02:14:15] <Casper> pump worked for a good 2 minutes once OUT of the water
[02:14:33] <Casper> and that's a big pump
[02:14:43] <Casper> I estimate the flow to 2-3 garden hose
[02:14:57] <geckosenator> so its like a 2000gph
[02:15:03] <geckosenator> maybe 3000
[02:15:08] <geckosenator> I have one of those
[02:15:08] <Casper> possibly
[02:15:13] <geckosenator> it draws 18 amps at 12 volts
[02:15:39] <Casper> the store was closing down, massive sale, he took the biggest they had
[02:15:47] <Casper> and barelly fit under the engine
[02:16:02] <geckosenator> some pumps are direct drive off an engine belt
[02:16:09] <geckosenator> they can do like 10 gallons per second
[02:16:20] <geckosenator> you need like a 4 inch pipe
[02:16:31] <Casper> yeah some are massive
[02:16:52] <Casper> you know, you throw the anchor, and start fishing....
[02:17:03] <Casper> ... first thing you know is you hear BANG under the boat
[02:17:03] <geckosenator> but yeah my boat has so my foam in it it wont actually sink at least
[02:17:19] <geckosenator> hitting rocks?
[02:17:29] <Casper> the anchor wasn't strong enought, we were in a rocky area, going toward a small fall
[02:17:34] <geckosenator> I've done that, I hit stuff all the time
[02:17:42] <Casper> try to start the engine... click.... click....
[02:17:43] <geckosenator> I hit a reef in tonga
[02:17:57] <Casper> starter solenoid failed
[02:17:58] <geckosenator> need all chain for the anchor not line
[02:18:00] <Casper> wait
[02:18:00] <Casper> no
[02:18:03] <Casper> not the solenoid...
[02:18:06] <Casper> the wiring
[02:18:29] <Casper> the anchor was a 10lbs
[02:18:32] <Casper> way too small
[02:18:40] <geckosenator> yeah depending on type and bottom
[02:18:55] <geckosenator> if it's a danforth perfectly set in soft mud burried 3ft deep
[02:19:03] <geckosenator> it will hold like 6000 pounds
[02:19:18] <geckosenator> but in rocks it might not do anything
[02:19:49] <Casper> he tought of installing an air horn on it
[02:19:58] <Casper> but, well, that was kinda useless :D
[02:20:01] <geckosenator> how about some oars
[02:20:06] <Casper> oars?
[02:20:07] <geckosenator> or maybe a sculling oar
[02:20:19] <geckosenator> I used mine to get away from 8ft breaking surf off california
[02:20:24] <geckosenator> when I was becalmed
[02:20:31] <geckosenator> I don't have an engine to fail heh
[02:20:52] <geckosenator> I was like 4 boatlengths from the surf
[02:22:16] <Casper> but you know... that boat was a real hole...
[02:22:26] <Casper> everything was breaking
[02:22:34] <Casper> yet everything looked in good condition
[02:22:51] <Casper> and everything is expensive to fix...
[02:22:58] <geckosenator> yeah mine is the opposite
[02:23:10] <Casper> sail boat have less to break...
[02:23:12] <geckosenator> it looks like crap but everything can be fixed for cheap
[02:23:30] <Casper> less major that leave you stranded there...
[02:23:44] <Casper> on a power boat... too many things can go wrong
[02:23:53] <Casper> like the shifter switch
[02:24:06] <Casper> solenoid wiring
[02:24:09] <Casper> starter
[02:24:12] <geckosenator> yeah well sail is more rreliable
[02:24:16] <Casper> starter wire
[02:24:29] <Casper> gearbox
[02:24:31] <geckosenator> you can just about jury rig it with whatever
[02:24:37] <Casper> transmission
[02:24:46] <Casper> propeller pin
[02:24:48] <geckosenator> I have electric motors
[02:24:57] <geckosenator> they are relatively trouble free
[02:25:08] <Casper> starter solenoid
[02:25:15] <geckosenator> and since there are 2 it is pretty unlikely that both fail
[02:25:27] <Casper> that is part of what failed
[02:25:50] <Casper> mind you, there is a 90 degree gear... there was a missing chunk
[02:26:07] <Casper> sometime the chunk was going between the 2 gears
[02:26:11] <Casper> and make them slip
[02:26:38] <Casper> result: when it stopped slipping, the propeller was getting a massive force
[02:26:46] <Casper> and the pin was breaking
[02:27:29] <geckosenator> yes my motors have only 1 moving partt and no maintainence
[03:34:41] * RikusW have some MC6802P's and R6502AP's here.... wondering what could be done with it.
[03:43:54] <RikusW> some MC6821P's too
[04:54:40] <abcminiuser> At this point, I think I'll just choose any Norwegian bank with a website that offers english
[04:54:54] <abcminiuser> All the one's I've found are only in Norwegian, and break Google translate
[04:55:30] <karlp> just for my sanity, wsa that the first thing you've said in the last few hours?
[04:55:41] <karlp> or do I keep ending up on the wrong side of netsplits somewhere?
[04:56:01] <abcminiuser> First thing
[04:56:06] <karlp> ok, good :)
[04:56:09] <ziph> abcminiuser: You can't use a multinational that has branches in Norway?
[04:56:10] <abcminiuser> I tend to do a Seinfeld cold-start to convos
[04:56:16] <abcminiuser> ziph, like who?
[04:56:20] <karlp> that was also my primary reason when choosing a bank here :)
[04:56:27] <abcminiuser> Besides, probably get better interest with the Norge banks
[04:56:37] <karlp> that, and which ones had staff that were polite enough to take questions in english
[04:57:03] <abcminiuser> Would you trust your money to a bank that has website source like this one: www2.sparebank1.no
[04:57:08] <ziph> abcminiuser: HSBC?
[04:57:12] <abcminiuser> Look at that HTML. LOOK AT IT.
[04:58:35] <karlp> ziph: why go global when you can go local?
[05:00:20] <abcminiuser> I'm actually astonished they don't do English
[05:00:53] <abcminiuser> I don't want to do the whole foreigner arrangance thing, but English is the other language all Norwegians know
[05:04:16] <ziph> karlp: Because in all likelihood the local bank you go with is owned by a multinational anyhow.
[05:05:33] <abcminiuser> Given Norwegian socialism, I wouldn't be suprised if I get better rates with a local company however
[05:08:09] <charolastra> norwegen doesn't have sozialism but it has oil ;)
[05:08:36] <ziph> abcminiuser: You'll get a front row seat to the break up of the EU. :)
[05:10:07] <abcminiuser> Well, they have a socialistic outlook on everything
[05:13:08] <karlp> abcminiuser: sure, same here, but just because they all _know_ english doesn't mean they see a reason to make their websites english
[05:13:50] <abcminiuser> Yeah, but people like me try to check our account, and end up accidentally investing in ant shoelaces or something
[05:14:11] <karlp> sure is fun isn't it :)
[05:14:49] <karlp> and even if their english is excellent, try and get them to explain, in english, the differences between financial things.
[05:15:03] <karlp> "excellent english" very quickly turns into, "I can chat over a beer very well"
[05:16:53] <abcminiuser> I just want a place I can put in my salary, then extract with a card at an ATM :S
[05:16:56] <abcminiuser> Here it's easy
[05:17:59] <ziph> How will you understand what the ATM tells you?
[05:18:11] <karlp> simple, get used to nordic living,
[05:18:15] <karlp> don't take the cash out at all
[05:18:24] <karlp> just hand over your card every time you need to spend something
[05:18:37] <karlp> and presto, automatic itemised accounts :)
[05:20:39] <charolastra> i thought they use phones to pay
[05:31:18] <abcminiuser> charolastra, mostly card - cash use is kinda odd to them there, apart from the bus
[05:31:29] <abcminiuser> ziph, most ATMs have an english button on them
[05:31:35] <abcminiuser> At least, the ones I tried
[05:59:18] <inflex> hey there folks
[05:59:20] <inflex> lots of Aussies
[06:01:43] <karlp> or half aussies
[06:01:53] <karlp> or all of the above
[06:01:57] <karlp> good morning to you too :)
[06:25:46] <theBear> half aussie you say ? hmmm
[06:34:24] <abcminiuser> What the crap does Sonar Plus carry?
[06:34:32] <abcminiuser> I've got a $250 gift cert for it
[06:37:14] <theBear> fish finders ?
[06:37:26] <theBear> you know, it's like a gps for under your boat
[06:38:12] <charolastra> well, inverse gps
[06:40:45] <karlp> well, nothing like gps...
[06:41:56] <abcminiuser> Unless I want to get $250 in LEDs or something
[06:41:59] <charolastra> why not, both measure the time the signal takes for travel
[06:42:11] <jacekowski> no
[06:42:17] <jacekowski> gps relies on doppler shift
[06:44:52] <theBear> it looksl ike a gps
[06:45:09] <theBear> it's got a screen you watch when yer driving....
[06:45:22] <charolastra> jacekowski: then why isn't it mentioned in the wiki? i think your confusing it with sputnik
[06:45:25] <theBear> only difference is fish instead of roads really :)
[06:45:43] <charolastra> hehehe
[06:45:46] <theBear> gps works on doppler ? i thought it was pure timing
[06:46:10] <charolastra> just rechecked and it is pure timing
[06:46:18] <theBear> wow ! how bout that memory
[06:46:41] <theBear> nevertheless, i think we can all agree, that superficially, a fish finder looks a lot like a gps
[06:47:16] <charolastra> well, yes, on the surface; but the funktion is completly different
[06:47:31] <charolastra> *internal
[06:47:59] <theBear> obviously, but i think i got the point across
[06:48:06] <theBear> everyone now knows what we are talking about ;)
[06:48:16] <theBear> i mean, how are fish gonna tell you where to drive ?
[06:48:42] <jacekowski> gps uses doppler to calculate clock
[06:48:55] <charolastra> well, learn to speak fishian, seriously
[06:49:09] <Tom_itx> is abcminiuser having trouble spending his money?
[06:49:39] <abcminiuser> Tom_itx, won a gift voucher
[06:49:50] <Tom_itx> go for the leds
[06:49:53] <abcminiuser> Just found out the prize I won last week wasn't cash, but a Sonar gift voucher
[06:50:02] <abcminiuser> Haven't used them before, can't find anything practical
[06:50:09] <abcminiuser> Other than a bajillion misc discretes
[06:53:36] <jacekowski> sell that voucher to somebody
[06:54:23] <jacekowski> and then $200 should be enough for decent escort
[07:00:47] <abcminiuser> Hehe
[07:00:55] <abcminiuser> "Do you offer discretes?"
[07:01:08] <abcminiuser> "I'm looking for a charge pump..."
[07:02:24] <soul-d> you'd change it for multivibrator ?
[07:03:52] <theBear> i'm a disabled pensioner if anyone is having trouble spending their money...
[07:04:34] <theBear> apparently the decent thing to do is buy gifts.... if anyone knows what my bros gf wants, err, send it over :)
[07:35:14] <mapee> hi
[08:59:08] <Fleck> amee2k PSU fixed!! :))
[09:59:36] <_Shurik_> Hola!
[09:59:42] <_Shurik_> Anyone played with wiz200net module?
[10:11:52] <josh> I'm using C++ on the AVR (GCC 4.3.3) and I've come across something odd
[10:12:31] <josh> I have a class variable that I want to create as a static global, but when I do, my microcontroller just freezes
[10:12:33] <theBear> c++ on the avr ? no shit ?
[10:13:06] <josh> but if I put it in a "singleton" returning free-function as a function-static, everything works fine
[10:13:25] <josh> yeah, works pretty good
[10:14:09] <josh> templates and data hiding are very nice... also using virtual functions in some places
[10:14:37] <josh> otherwise it's mostly identical to C
[10:14:45] <Regenschein> "C with classes"
[10:14:50] <josh> no stdlib or anything like that
[10:14:55] <josh> yeah, exactly
[10:16:07] <josh> I just noticed that a lot of what I eneded up doing in C was just a poor imitation of C++ functionality (structs for holding shared data, passing that struct into operating functions like a "this" pointer, structs of function pointers, etc...)
[10:16:32] <josh> the list is longer, but you get my drift
[10:17:29] <untitled> what about speed?
[10:23:53] <josh> no difference really
[10:24:04] <josh> though I'm at 32Mhz on an Xmega
[10:24:44] <josh> some things in C++ can actually be faster than C just because of the information the compiler has to work with
[10:24:53] <untitled> any good manual how to start coding in C for arduino (uno)?
[10:31:14] <josh> the arduino website has many great examples
[10:31:50] <vanquish_> untitled: do you want to know how to code in C, or write C for an AVR chip?
[10:32:04] <untitled> like vanquish_ the second ofcourse ;)
[10:32:13] <untitled> without like
[10:32:25] <vanquish_> bah
[10:32:48] <vanquish_> nickserv seems to have alzheimers sometiems
[13:55:51] <GuShH> dofidum: we meet again.
[13:56:05] <dofidum> GuShH, :-)
[13:57:18] <age> Hello.
[13:57:34] <dofidum> I have a simple parallel-port programmer with which I can program my ATMega32... unfortunately I now no longer have a PC with a parallel port. Hence I wonder, would a USB to parallel converter be any use for this kind of task? or are there better solutions?
[13:58:38] <GuShH> you can get isp programmers for 10 dollars shipped, usb.
[13:59:57] <dofidum> GuShH, really? I've been googling for some and the only thing I've seen below 20 is a dodgy one that may or may not work on later windows versions...
[14:00:45] <age> I need choice advice and possibly some opinions, please. For a device that has to interface both USB and Ethernet (not at same time), I've selected AT32UC3A1512. Any comments on that? Past/present users of the series?
[14:00:50] <GuShH> from china, ebay. yes
[14:00:55] <GuShH> beats no programmer at all.
[14:01:22] <age> dofidum, you can make yourself a usbasp in one evening
[14:01:31] <age> faster if you make it on a breadboard.
[14:01:47] <dofidum> age, maybe you can, not sure I can ;)
[14:02:15] <age> dofidum, what, you can't fit some parts into a breadboard? why are you here, then?
[14:03:56] <age> or, they even have kits for those lazy.
[14:05:55] <dofidum> age, I could probably manage...
[14:06:46] <dofidum> age, just not really motivated to...
[14:12:40] <age> dofidum, isn't it fun to build a programmer on your own?
[14:13:27] <dofidum> age, not really... so do I need a programmer to program my programmer?
[14:15:51] <dofidum> am biased to GuShH's solution
[14:18:42] <dofidum> thanks for your help in any case :)
[14:21:24] <GuShH> dofidum: did you find 'em on eBay?
[14:21:24] <GuShH> they're on goodluckbuy.com also
[14:25:25] <dofidum> GuShH, yep, will buy probably buy the one of ebay... goodluckbuy looks decidedly american...
[14:26:01] <GuShH> dofidum: it's chinese, but I've bought from them
[14:26:01] <GuShH> it's fine.
[14:26:13] <GuShH> just takes some time to ship
[14:26:39] * GuShH notes that all of the isp programmers for 10 bucks are chinese as well
[14:27:19] <dofidum> GuShH, oh right, always weary when the currency is not sterling...
[14:28:09] <GuShH> theres no way anyone outside of china could profit from them otherwise
[14:28:31] <dofidum> GuShH, good chance they roll out of the same factory though
[14:29:12] <dofidum> that goodluckbuy is pretty cheap on some of their stuff!
[14:29:59] * dofidum fancies an 8x8 RGB LED matrix
[14:51:31] <dofidum> GuShH, judging from their advertisements I am beginning to wonder whether buying a USB to parallel converter will be a more reliable option!
[14:52:39] <mrfrenzy> thos usb parallell converters have really shitty drivers
[14:53:03] <mrfrenzy> I have two, both give you an "usb printer port", not a virtual parallell port
[14:53:30] <dofidum> mrfrenzy, so do those USB programmers by the looks of it (they use LibUSB for windows -- I am not a fan)
[14:53:49] * mrfrenzy hugs his stk500
[14:54:29] <dofidum> mrfrenzy, oh, ... I wouldn't be quite so concerned if I didn't spend the last year developing USB drivers for a living...
[14:54:41] <mrfrenzy> you can buy one for $50 at most unis
[14:54:53] <mrfrenzy> oh cool, for what kind of devices do you develop?
[14:55:24] <dofidum> mrfrenzy, its a controller that talks to signs and stuff on motorways
[14:56:12] <mrfrenzy> aic, so it's not for your own device but stuff you are trying to implement to your usb master
[14:57:28] <dofidum> mrfrenzy, we use usb for both internal communication between two PCBs and for allowing people to plug in their flash drives... but yes its not a personal project...
[14:58:01] <dofidum> mrfrenzy, it's the reason I am here... trying to expand my knowledge of the hardware side of things by starting some hobby projects at home
[14:58:34] <mrfrenzy> that's great. employers love people like you
[15:00:21] <dofidum> mrfrenzy, can't be getting bored :P
[15:37:35] <OndraSter> heeya
[15:37:41] <OndraSter> hah, so #avr exists :)
[15:37:54] <OndraSter> dongs, say what lmao
[15:37:55] <OndraSter> anyway
[15:38:01] <OndraSter> I am making graduation project
[15:38:11] <OndraSter> so far, I rewrote the bootloader into assembler
[15:38:30] <OndraSter> and let's face it, I am sometimes (most of the time) n00b in C
[15:38:42] <OndraSter> is it still worth writing in assembler whole application, guys?
[15:38:53] <OndraSter> the project is "huge" LED matrix
[15:38:57] <OndraSter> 32x96 pixels
[15:39:27] <OndraSter> (served by ADsomething chips... 8bit shift registers with current limiting capability built-in)
[15:41:01] <vectory> well, thats subjective opinion
[15:41:16] <vectory> for once, pure asm can be fit in smaller space perhaps
[15:41:30] <vectory> but c is quite efficient and easier to code
[15:42:40] <OndraSter> make it atmega128a
[15:42:48] <OndraSter> I got them cheaply, they are being sold out in one shop here
[15:43:03] <OndraSter> it requires "precise" timing (precise = usec or so)
[15:43:21] <OndraSter> but I feel like C is gonna be touching too much memory even when it doesn't have to
[15:44:17] <OndraSter> I could work out with registers and maybe few bytes of memory and that's it... not sure if C can push it (mostly when calling functions when it pushes params to stack... or it works differently on AVR GCC?)
[15:44:30] <OndraSter> similar to ARM where it pushes params to R0..R15?
[15:45:19] <vectory> test in a simulator
[15:45:42] <OndraSter> good idea mate
[15:46:18] <mrfrenzy> proper C is not that big when compiled with optimizations
[15:48:08] <dofidum> dang it, why can't they just stick a parallel port on modern PCs!
[15:53:48] <OndraSter> dofidum, because it is slow and requires too much CPU overhead :)
[15:55:57] <OndraSter> as far as I know, the original 82xx didn't have any rx and tx buffers, so after each byte was sent, CPU was interrupted and had the option to load another byte... and another one... and another one... now imagine doing few megabytes over that
[17:50:09] <abcminiuser> Youch, Google Store shipping, 40 pounds
[21:45:59] <raden> how do I just 1 pin as a variable ?? PA = PINA.0; gives a error
[21:47:22] <Casper> heee what?
[21:47:46] <Casper> you want to read the status of the pin? and store it in a variable?
[21:47:49] <raden> i want to assign the input from PINA.0 to a variable
[21:47:55] <raden> Casper, yes sir
[21:48:02] <Casper> there is no such thing as .0
[21:48:23] <raden> how do I just read 1 pin ?
[21:49:03] <Casper> PA = PINA & (1<<0); however that will have a side effect
[21:49:27] <Casper> if you read pin 0 it will read 1, pin1 will be 2, pin2 would be 4....
[21:49:49] <Casper> so if you want 1/0 you will need an if...
[21:49:58] <Casper> like
[21:50:22] <Casper> PA = (PINA & (1<<0)) ? 1 : 0; ← many don't like that form however
[21:50:52] <raden> Im baffled why is setting a variable from a pin so difficult ?
[21:51:03] <Casper> because a pin is a bit
[21:51:10] <Casper> that is part of a byte
[21:51:11] <raden> okkkkk
[21:51:28] <raden> and a variable has to be a byte ?
[21:51:28] <Casper> one port can hold up to 8 pins
[21:51:57] <Casper> you first need to extract the exact bit that you want from the register, which is a byte
[21:52:09] <Casper> a variable can be "any" size
[21:52:11] <raden> PINA accesses the port right ? why is an AND used ?
[21:52:18] <raden> ok
[21:52:29] <Casper> pina is one register, one byte, so 8 bits
[21:52:34] <raden> ok
[21:52:42] <raden> that makes sense to me
[21:52:52] <Casper> so you AND it with the mask for the pit you want, which isolate the bit
[21:52:54] <raden> where does the & "and" come in ?
[21:53:33] <Casper> the 1<<0 is a bit shift, it will be removed by the compiler for the result
[21:54:04] <Casper> 1<<0 = 0b00000001 1<<1 = 0b00000010 and so on
[21:54:42] <Casper> when you AND the pin with the mask, the result is the bits which BOTH are equal to 1
[21:55:39] <raden> so 1<<0 is reading the status of pin 0 ? since its set 0b000000001 ?
[21:55:42] <Casper> so if you have 0b01001000 & 0b00001000, the result would be 0b00001000
[21:55:47] <Casper> yes
[21:56:10] <Casper> you could put the value directly, but it's shorter and less confusing, once you get used to it
[21:56:24] <raden> can i presume 2<<0 = 0b00000010 ? or is that wrong ?
[21:56:29] <Casper> no
[21:56:32] <Casper> 1<<1
[21:56:44] <Casper> up to 1<<7
[21:57:20] <Casper> it's 1 shifted x places
[21:57:33] <raden> ok so the 1<<0 shifts 0 bit places to left and then read the pin ?
[21:57:43] <Casper> yeah
[21:58:00] <raden> so 1<<2 = 0b00000100 ?
[21:58:06] <Casper> the compiler will process it and convert it to 1, or 0b00000001 if you prefer
[21:58:41] <Casper> that is the joy of compiler: what it can calculate right now it will do it, so the target do not have to waste time to calculate stuff that don't change
[21:59:49] <raden> that & still has me messed up thinking its combined 2 things
[22:01:17] <raden> do I have the wrong mentality ?
[22:01:46] <raden> cause PORTA is like take everything from that and then the AND everything from 0b00000001
[22:01:57] <raden> how does it cancel out anything else ?
[22:02:33] <raden> maybe Im just messed up in my perspective but the 2 books I Have and the ATMEGA324 PDF don't explain it very well
[22:03:44] <raden> Casper, ?
[22:07:09] <Casper> hi
[22:07:50] <raden> that and is still messing me up
[22:08:04] <LikWidChz> Hey any of you know some transformer math?
[22:08:10] <raden> sure
[22:08:16] <raden> LikWidChz, what yea need ?
[22:08:48] <LikWidChz> so I have a transformer from a microwave infront of me... dont worry im not up to something evil, although... anwyay... how do you measure what voltage it amplifies to?
[22:09:13] <LikWidChz> restiance of primary coil, resistance of output coil... divide?
[22:09:30] <raden> input i normally just input a low voltage see what I get
[22:09:59] <LikWidChz> well the transformer takes AC in
[22:10:14] <LikWidChz> it would be HANDY to have an ac power supply although I dont have one
[22:10:17] <raden> they use a 9vac transformer to power it !
[22:10:25] <raden> just a regular transformer
[22:10:27] <raden> but anyway
[22:10:33] <LikWidChz> I have a bench psu
[22:10:50] <raden> 2 ohm on one side and 1 ohm on the other does not totally mean a 2:1 ratio
[22:11:00] <raden> might be 1.8:1
[22:11:06] <raden> or 2.2:1
[22:11:15] <raden> cause windings are never perfect in my experiance
[22:11:24] <LikWidChz> fancy that its probably a bit more since this is a microwave oven transformer.... this crap scares the crap out of me if it were powered
[22:11:43] <Casper> LikWidChz: turn ratio
[22:11:54] <raden> there should be some markings
[22:12:04] <raden> I know many are not labeled though
[22:12:11] <Casper> ex 120V in 360 turns, output 3600 turns = 1:10 = 1200V out
[22:12:29] <raden> Casper, so While ( PA == 1 ) { lite led etc.... }
[22:12:37] <raden> not working
[22:12:37] <LikWidChz> no its not labeled well its probably 1:20 as there was a 2200vAC 1.0uf cap attached to it
[22:12:53] <raden> I have a 1:16 here
[22:13:03] <Casper> raden: that do not assign anything
[22:13:03] <Casper> but
[22:13:11] <LikWidChz> is tahat enough power to make a jacobs ladder?
[22:13:29] <Casper> while (PINA & (1<<0)) { foo(); }
[22:13:35] <raden> Casper, i want to read the variable to turn on LED when pushed ( for example purposes )
[22:13:40] <LikWidChz> 2200volt? not sure what the air gap value is for a spark
[22:13:53] <Casper> LikWidChz: not sure, but you might want to find a true schematics
[22:13:59] <Casper> I doubt it's simply a transformer
[22:14:13] <raden> PA = (PINA & (1<<)));
[22:14:28] <LikWidChz> ... no im pretty sure it is! theres two ac lines going in and a primary coil out
[22:14:37] <LikWidChz> i was amazed at how simple a microwave really was
[22:14:41] <raden> while( PA = 0 ) {}
[22:14:49] <Casper> raden: you might want to just while(PA) {}
[22:14:57] <Casper> as long as PA isn't 0 it will work
[22:15:24] <raden> PINA.0 is pulled up im pulling down with button
[22:16:41] <Casper> while (!PA) {} ? :D
[22:17:34] <raden> wtf, while PA doesnt do a think with or without button pushed while(1) it runs
[22:18:30] <raden> Casper, !pa made it run but hitting button dont stop it
[22:18:46] <Casper> normal
[22:18:55] <Casper> if your loop do not update PA then it won't work
[22:19:06] <raden> I was just going to ask that
[22:19:41] <raden> so how do I exit my loop everytime ?
[22:20:29] <Casper> update it, or just check the pin in the while condition instead of the variable
[22:20:29] <raden> reading this chapter on control statements and not finding much
[22:21:28] <raden> so just set the variable at the end of my while statement >
[22:21:29] <raden> ?
[22:22:24] <raden> DDRA = 0x00 would set all of port A to inputs correct ?
[22:22:41] <Tom_itx> uh huh
[22:22:46] <raden> PORTA = 0xff would enable pull ups correct ?
[22:23:29] <Tom_itx> pretty sure
[22:23:31] <raden> my switch is wired from ground to PINA.0 its a momentary
[22:23:37] <raden> when I press nothing happens
[22:23:50] <Tom_itx> i would use external pullup myself
[22:23:55] <Tom_itx> ~10k or so
[22:24:16] <raden> but direct to ground there should be no issue
[22:24:19] <raden> or am I wrong ?
[22:24:27] <Tom_itx> should be ok
[22:25:01] <raden> im baffled
[22:27:40] <raden> Casper, do i have to completely exit the while loop everytime ?
[22:27:44] <raden> nothing seems to be working
[22:29:38] <Casper> while loop is a loop that continue until the condition stop to be meet,,,
[22:29:56] <Casper> you can however put 2 while loop
[22:29:56] <raden> doesnt seem to matter what I do it keeps going
[22:31:56] <raden> ok positive to that pin stop it
[22:32:03] <raden> but i have to touch it again to get it to go
[22:32:33] <Tom_itx> breadboard?
[22:32:57] <raden> proto soldered I made a few leds and some buttons
[22:47:28] * inflex crashes and burns
[22:53:40] <raden> Casper, http://pastebin.com/B7aUhwLX
[22:53:48] <raden> any idea what I'm doing wrong ?
[22:54:26] <Casper> yes
[22:54:28] <Casper> your code end
[22:54:43] <Casper> while(1) { while ..... {} }
[22:55:04] <Casper> like 15 while (1) { and 26 }
[22:57:27] <raden> so put a while in a while ?
[22:57:32] <raden> sorry little confussed
[22:58:36] <Casper> yes
[23:01:35] <raden> do i need to end it ?>
[23:03:04] <raden> did that still just keeps ruinninng
[23:03:16] <raden> changed my flash rate to make sure program was getting on the chip
[23:05:56] <raden> Casper, http://pastebin.com/pi9Vt34K
[23:06:40] <raden> grounding the PIN does nothing
[23:06:47] <raden> Applying 5 volts to it works
[23:06:57] <raden> is my logic wrong somewhere ?
[23:12:38] <Casper> while grounded do the loop
[23:13:13] <raden> ?
[23:13:40] <raden> When voltage applied it does the loop
[23:21:44] <raden> Casper, Bad postive to AREF
[23:21:48] <raden> working now
[23:22:04] <Casper> sorry about the delay
[23:22:07] <Casper> working on something
[23:22:22] <raden> no problem bro, all the help no matter how long the delay much appreciated
[23:22:59] <raden> now I just need to find a way to make a 10 minute delay
[23:28:07] <raden> Casper, any Idea how I can do a long delay ?
[23:29:20] <raden> I was thinking along the lines of set a variable like 600 and then run a loop with a 1000 ms delay that reduces one from it everytime till 0 and then shutoff
[23:29:28] <raden> or is there a better way
[23:33:51] <Casper> hmmm isn't it taking a very long number anyway?
[23:34:06] <raden> what u mean
[23:34:55] <raden> basically x = 600 then 1000 ms x = x - 1
[23:35:00] <raden> until 0
[23:38:02] <Casper> hmmmm and why not _delay_ms(600000);
[23:38:52] <raden> you think it will be accurate at all ?
[23:39:19] <raden> at 1 minutes im 59'55"
[23:39:45] <ziph> raden: Use timers.
[23:39:50] <raden> ziph, ?
[23:40:00] <raden> ziph, 3rd night working with AVR
[23:40:12] <raden> ziph, could u elaborate a bit sir ?
[23:40:24] <ziph> raden: AVR's have hardware for counting.
[23:40:39] <ziph> raden: You just set up a timer and ever N cycles it gets incremented.
[23:41:15] <raden> is there a example code you could point to ?
[23:41:42] <ziph> raden: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=50106
[23:42:38] <Casper> raden: _delay_ms() over a certain point is not precise
[23:42:45] <Casper> using loop will just make it even worse
[23:43:12] <Casper> the only way to have precise time is to use timer, and even then it depend on your crystal speed. if you can't divide well, you can't have precise time
[23:44:47] <ziph> By that he means the higher your divider is the lower your resolution is, and you may not have the resolution to set the exact value you want.
[23:46:09] <raden> oh wow
[23:46:32] <Casper> this is why watch crystal is 32768
[23:46:43] <Casper> does that sound like a weird speed?
[23:47:34] <raden> yea it always has
[23:47:40] <raden> I have a ton of em here
[23:47:49] <raden> 32.768 mhz
[23:48:12] <Casper> kHz
[23:48:15] <Casper> not mHz
[23:48:18] <Casper> Mhz...
[23:48:39] <ziph> mHz would by milliHz.
[23:48:54] <Casper> ya
[23:49:56] <raden> i have a bunch labeled ECXR 3992
[23:50:01] <raden> 3392