#avr | Logs for 2012-07-06

Back
[01:10:30] <vuln> I'm trying to implement a few things in an AVR chip. Could anyone give me a little help?
[01:22:24] <CapnKernel> Maybe, but you'd have to be more specific.
[01:29:10] <vuln> CapnKernel Ok. :)
[01:29:50] <vuln> Thank you for your attention. I need to simulate as if my uC is receiving a random analogic signal in my A/D to do some processing inside the uC
[01:29:58] <vuln> What function do you suggest to emulate this analog signal?
[01:34:51] <CapnKernel> Do you want a purely analog circuit?
[01:36:48] <OndraSter> AM/FM radio
[01:36:54] <OndraSter> old ones
[01:37:04] <OndraSter> oh
[01:37:07] <OndraSter> want, not know
[01:37:10] <OndraSter> anyway
[01:37:12] <OndraSter> I am off again
[01:37:13] <OndraSter> bb
[01:37:59] <CapnKernel> http://www.diystompboxes.com/smfforum/index.php?topic=16571.0
[01:38:11] <vuln> CapnKernel I won't embed it in an AVR chip. I only need to make a code that works
[01:38:28] <CapnKernel> Oh, simulate
[01:38:30] <vuln> Yup
[01:38:35] <CapnKernel> Simulate with what?
[01:39:08] <vuln> CapnKernel Proteus
[01:39:24] <vuln> I will be clearer about what I need to do
[01:39:26] <CapnKernel> vuln: You're not making much sense.
[01:39:41] <CapnKernel> Or that is to say, you're not telling us enough of what you require, in order for us to help you.
[01:39:47] <vuln> There is one Arduino MEGA and two Arduino UNO REV3. ATmega328p and the other ATmega i can't really remeber now
[01:39:52] <CapnKernel> Is this a real AVR, or a simulated AVR?
[01:40:06] <CapnKernel> Can you use a PC to generate the noise signal?
[01:40:07] <vuln> This Arduino MEGA will receive an analog signal and through SPI will send it to both the slaves
[01:40:36] <CapnKernel> Well the slave stuff doesn't concern us, it's just the noise signal to the MEGA, right?
[01:40:38] <vuln> The first slave will send a variable frequency depending on the value of the analog signal and the second slave will send a variable PWM signal according to the analog signal
[01:40:39] <vuln> that's it
[01:41:06] <vuln> CapnKernel for now, I would like to know how can I generate the analog signal and make it pass through the A/D (I think I have this part already done) in the MEGA
[01:41:34] <CapnKernel> That kind of implies that the analog signal will stay constant for some amount of time - if the analog signal is random and constantly changing, no point trying to generate a signal from it.
[01:42:07] <vuln> I need it random but it needs to stay constant for like one second
[01:42:15] <CapnKernel> Ah but you didn't say that.
[01:42:20] <vuln> I'm sorry :(
[01:42:36] <CapnKernel> vuln, no disrespect, but please go have a good think about what it is that you're trying to do, and how you can best express it.
[01:43:07] <vuln> none taken. Maybe I should show you some code of what I already have, right?
[01:43:13] <CapnKernel> And please focus on the requirements, not what you think the solution should be.
[01:43:24] <CapnKernel> You can, but I don't have the time to look at it.
[01:43:31] <vuln> aw :(
[01:43:37] <vuln> I thought you had some spare time to help me.
[01:44:03] <CapnKernel> Thought thought his arse was hanging out of bed, so he jumped out to push it back in.
[01:44:21] <vuln> =o
[01:44:52] <CapnKernel> The folks over in #1800-psychics might be able to help you.
[01:45:06] <CapnKernel> sorry, that's a bit harse
[01:45:22] <vuln> it's ok
[01:45:29] <vuln> Thank you anyway
[01:45:34] <CapnKernel> That's ok
[01:46:06] <CapnKernel> My suggestion to you is to become clearer on what the requirements are, independent of possible solutions, to the point where you can convey it to others.
[01:46:47] <vuln> It requires an analog signal that keeps changing, once each one second per example.
[01:49:21] <CapnKernel> You haven't said *why* you need such a signal. An analog signal that changes once per second sounds like part of a possible solution, not a primary requirement. What is the problem you're trying to solve?
[01:49:24] <CapnKernel> Sorry, I'm done.
[01:50:35] <crazy_imp> vuln: dd if=/dev/urandom bs=1 count=100 of=randomdata
[01:50:42] <crazy_imp> xxd -i randomdata
[01:51:20] <crazy_imp> and then write a small program, to output piece of the data each second an loop around
[01:52:03] <crazy_imp> depening on how much space you've got, you can put more "random" inside your controller
[01:52:32] <vuln> I thought I had been clear CapnKernel. The variable frequency and PWM of the slaves uC vary according to this signal that enters the master
[01:52:38] <vuln> That's why I need the analog signal.
[01:53:37] <crazy_imp> 08:31 < vuln> I need it random but it needs to stay constant for like one second
[01:54:13] <crazy_imp> where's the difference between an analog signal and emulating the values for testing?
[01:54:48] <vuln> crazy_imp well, doing dd if=... is like a workaround
[01:54:54] <vuln> Can't I use a function like rand() in my .c code?
[01:55:06] <crazy_imp> you later just need to exchange the read from the random array with the reading from the adc
[01:55:10] <CapnKernel> You can.
[01:55:14] <CapnKernel> But it's not what you asked for.
[01:55:29] <vuln> CapnKernel where's the difference?
[01:55:33] <CapnKernel> The folks over in #1800-psychics are standing by to take your call!
[01:55:34] <vuln> Can't it simulate an analog signal
[01:55:39] <vuln> ?
[01:58:24] <crazy_imp> inside the atmega, the analog signal will just be the same like the values you can emulate via the random array i've shown. so feel free to use it, guess it'll be more random than same floating adc input pin (without any circuit)
[02:00:40] <crazy_imp> btw, debugging the rest becomes easier, because you can compare the values
[02:03:17] <vuln> But the generating of random valeus must be inside the coed
[02:03:19] <vuln> code
[02:06:22] <vuln> crazy_imp any idea?
[02:07:41] <crazy_imp> for(int couter=0; counter < sizeof(randomdata); counter++){
[02:08:22] <crazy_imp> myRandombyte = randomdata[counter];
[02:08:44] <crazy_imp> //set it to the outputvariables for spi / whatever
[02:08:59] <crazy_imp> _delay_ms(1000);
[02:09:00] <crazy_imp> }
[02:09:15] <crazy_imp> something like that
[02:09:28] <crazy_imp> inside you main-loop
[02:09:36] <CapnKernel> If you seed the PRNG with the same number, it will generate the same sequence each time.
[02:09:49] <CapnKernel> Sometimes this is a good thing, sometimes not.
[02:10:27] <vuln> PRNG?
[03:10:08] <sabesto> hm, anyone know of a place i can read about generating graphics (lines, cicles, arcs) for lcd's?
[03:10:27] <sabesto> writing a lib for these new sharp displays
[05:24:04] <vuln> Does anyone know how can I generate a PWM that varies according to a signal?
[05:27:01] <CapnKernel> vuln: Have you read the datasheet about PWM generation?
[05:28:54] <vuln> I will do it now.
[06:29:54] <theBear> is that like the love generation i heard so much about a few years back ?
[06:30:04] * theBear apologizes in advance
[07:06:15] <Steffanx> theBear apologies will be accepted
[07:37:30] <vuln> What pin should I plug my potentiometer for example, to get it coverted to a digital signal if I have this ADMUX |= _BV(REFS0); ?
[07:37:39] <vuln> pin 6? not sure if I understood the datasheet
[08:11:58] <theBear> hmm...
[08:12:11] * theBear apologizes in the future, just for syntax sake
[08:19:57] <CapnKernel> pre-emptive anti-strike
[08:23:14] <theBear> always good to have a couple in the bank :)
[08:27:26] <Steffanx> Also want some sorry cake theBear ?
[08:27:27] <Steffanx> http://www.naffets.nl/share/sorry-cake-20120706-151622.jpg
[08:29:05] <CapnKernel> I swear, somebody squeezed a constipated smurf...
[08:41:49] <errordeveloper> hey ..
[08:42:11] <errordeveloper> i'm having some issues with arduino ethernet and it's crappy optiboot ...
[08:43:03] <errordeveloper> any ideas what alternative bootloader would work with the 328P and the arduino usb2serial programmer?
[08:44:10] <errordeveloper> i've tried reflashing this goddamn optiboot using my arvisp mkii like 10 times now, and it still fails with `stk500_recv(): programmer not responding' error
[12:47:25] <tcatm> Hey. Could there be any specific reason why V-USB wouldn't work with an attiny44V running at 12 MHz?
[12:50:58] <vuln> Ok, my A/D config is all done. To what pin should I conncect my analog source?
[13:05:39] <vuln> how to choose what channel I want to use?
[13:06:45] <tcatm> Set the right bits? :)
[13:09:42] <vuln> tcatm in what register?
[13:09:56] <tcatm> Check datasheet :)
[13:10:17] <vuln> I've done ADMUX |= _BV(REFS0); and ADCSRA |= _BV(ADEN) | (1<<ADPS1);
[13:10:36] <vuln> Do these registers set the pin?!
[13:17:20] <Corwin> ^ no it doesnot
[13:17:58] <Corwin> input is set by bits 0..4 of ADMUX
[13:19:05] <Corwin> (well... its set by bits in ADMUX, how many bits depends on used AVR)
[13:22:55] <cehteh> slightly off topic: i've build some sensors to measure humidity (resistance rather) in plant-pot's and they need some applifier to get something i can feed to the ADC anyone did that before, any recommendations on how to implement the amp?
[13:23:29] <tcatm> Simple opamp circuit?
[13:24:34] <cehteh> yes, i just tested with a bc547 as darlington (driving a led) ... but i am kindof electronics noob, do you have some concrete example?
[13:24:51] <cehteh> http://i.imgur.com/Xi4Pa.jpg << such a sensor btw :)
[13:25:18] <cehteh> graphite leads
[13:26:45] <tcatm> http://www.radio-electronics.com/info/circuits/opamp_basics/op-amp_basic_inv.gif something like this might work
[13:28:38] <cehteh> opamp as in some generic type and the R's are only to make the signals not floating (1K or such?)
[13:29:18] <tcatm> Well, the Rs set the amplification factor
[13:31:25] <cehteh> R1 is my sensore (which has rather high resistane) and then R2 becomes a poti, i just have to figure out some concrete example
[13:31:43] <cehteh> anyways i am googling
[15:41:19] <SuperMiguel> what has more jobs in US? Comp Eng or Comp Sci?
[15:42:11] <Tom_itx> there are no jobs in the US currently
[15:43:40] <Landon> SuperMiguel: you're going to have to be a bit more specific than that, but go check out the BLS site
[15:44:23] <Landon> (also, I tried hard as hell to get a CmpE job, ended up with a more CS/EE job... your mileage may vary)
[15:44:44] <SuperMiguel> Landon: Tom_itx thing is, I'm almost done with my degree.. If i take 3 class on hardware ill get a CE degree if i take 3 software ill get a CS degree
[15:45:11] <SuperMiguel> can't get both, since ill need to get one 1st and then 30 credits on top of that to get the second one, so i rather get a masters on either
[15:45:31] <Landon> if it's only 3 classes difference, then it doesn't seem like it really matters :P
[15:45:43] <Landon> take the set that's most interesting
[15:47:53] <SuperMiguel> Landon: i know it doesn't matter. at least from my point of view.. But what do employers look more for?
[15:48:06] <SuperMiguel> which one makes more money? which one has more jobs?
[15:48:10] <Tom_itx> experience
[15:48:55] <SuperMiguel> Tom_itx: u an ee right?
[15:49:01] <Tom_itx> no
[15:49:30] <Landon> absolutely experience
[15:49:32] <Tom_itx> i would take Landon's advice and take the one that interests you the most
[15:49:54] <Tom_itx> you won't get the ideal job you want anyway... you're not abcminiuser :D
[15:50:08] <abcminiuser> Heh
[15:50:22] <Landon> fresh graduate CS/CmpE's are pretty interchangeable :P as much as I hate the fact
[15:50:27] <Landon> Ideal Job Quota: 1/1
[15:51:02] <Landon> SuperMiguel: but it also helps if you have some realistic companies in mind. do you know what positions they're looking for? etc
[15:51:32] <SuperMiguel> Landon: haven't really look at employment
[15:51:32] <Landon> not your microsofts and googles, but your Castle Creations and closer to home stuff
[15:51:47] <Tom_itx> you're asking about employment, you'd better look
[15:52:03] <abcminiuser> SuperMiguel, employers look for what you can do, do something and post it
[15:52:10] <abcminiuser> So that they can see it and take notice
[15:52:19] * abcminiuser wishes he had/would do more :(
[15:52:28] <Landon> more than lufa? :P
[15:52:35] <abcminiuser> Landon, much more
[15:52:44] <OndraSter> I got a crazy retro idea
[15:52:57] <abcminiuser> Sucked and sucks up so much time yet still isn't perfect - I wish I had done something else important :S
[15:53:00] <OndraSter> BRAINFUCK-INSTRUCTION-SET PROCESSOR!
[15:53:01] <OndraSter> mwhaha
[15:53:54] <Landon> abcminiuser: and that's why I've been binging on board games the past month or two instead of programming :)
[15:54:02] <abcminiuser> I've been wondering lately if it's possible to stream audio over Near Field....
[15:55:18] <Steffanx> This guy, TitanMDK, in ##stm32 (not there currently) is really into NFC and stuff, maybe he tried something similar abcminiuser
[15:55:41] <OndraSter> isn't NFC too much "near"?
[15:56:23] <abcminiuser> OndraSter, I'm thinking something like literally putting your phone on a dock immediately streams out the audio
[15:56:27] <abcminiuser> No cable, no pairing
[15:56:30] <OndraSter> oh
[15:56:33] <OndraSter> docking
[15:56:42] <OndraSter> well, that is what NFC is for
[15:56:46] <OndraSter> but to exchange BT keys :)
[15:57:01] <OndraSter> and BT MACs
[15:59:57] <abcminiuser> No Bluetooth
[16:00:00] <abcminiuser> Just NFC
[16:07:11] <OndraSter> 424Kbps I see as theoretical transfer maximum rate
[16:07:26] <OndraSter> sounds about enough
[16:09:12] <abcminiuser> Yeah but I'm worried it's burst rate only or something
[16:09:46] <OndraSter> NFC was not made for continuous streams
[16:11:22] <OndraSter> GUYS, anybody familiar with GOOD logic simulator that has more than regular logic gates?
[16:11:26] <abcminiuser> Yes, and the internet was not made for factual material
[16:11:33] <abcminiuser> Doesn't mean we can't re-purpose it tho
[16:11:37] <OndraSter> I thought about some kind of FPGA stuff - those usually have simulators
[16:11:39] <OndraSter> hehe
[16:12:01] <Landon> aren't the internet pioneers proud
[16:12:05] <Landon> to see all the lolcats
[16:27:00] <Martyn> Yes, in fact
[16:52:22] <age> hi. is it true that 8-bit AVR I/O pins may behave randomly on reset? I think I've red that somewhere but was unable to find any confirmation.
[16:56:14] <OndraSter> age, they should be in hi-Z?
[16:56:16] <OndraSter> check datasheet
[17:04:02] <age> OndraSter: you're right, "The I/O ports of the AVR are immediately reset to their initial state when a reset source goes active. This does not require any clock source to be running."; thanks for reminding me about the datasheet.
[17:04:46] <OndraSter> well, initial state is "input"
[17:04:59] <OndraSter> without pullups
[17:05:51] <age> good enough, I'll control a H-bridge with an avr and was worried about short protection