#avr | Logs for 2014-03-20

Back
[02:02:31] <anton02> if i have a bare microchip, would it be possible to wire it up to a PCB and solder a connection point to the PCB which i can then connect an USB mk2 to to program the chip?
[03:43:07] <anton02> how come atmega16's are more expensive than atmega48's? I thought the higher the number, the better.
[03:46:36] <anton02> how do you connect multiple \add-on modules to microchips?
[06:00:41] <Lambda_Aurigae> antto,
[06:00:43] <Lambda_Aurigae> err
[06:00:50] <Lambda_Aurigae> guess anton02 left.
[06:00:51] <Lambda_Aurigae> oh well.
[06:01:18] <Fiesta> comes in, asks question, only sticks around for 10mins then leaves
[06:42:11] <Lambda_Aurigae> Fiesta, yeah, and at odd hours of the early morning(for me anyhow)
[06:42:46] <Fiesta> perhaps they're getting up and typing these question in their sleep
[06:42:49] <Lambda_Aurigae> now, granted, he is from aussieland, but still.
[06:42:59] <Lambda_Aurigae> naaa...asking them in their beer,,,
[06:43:14] <Lambda_Aurigae> while eating vegemite sandwiches.
[06:43:48] <Lambda_Aurigae> his IP is university of queensland, Brisbane....
[06:44:05] <Lambda_Aurigae> so, drunk starving student living on vegemite.
[06:44:17] <Fiesta> that's only 50kms from me
[06:44:18] <Roklobsta> it worked for me
[06:44:43] <Lambda_Aurigae> I never made it to Brisbane when I was down there.
[06:45:01] <Lambda_Aurigae> mostly all over the center of the continent with a couple trips to the coast here and there.
[06:45:19] <Lambda_Aurigae> in through melbourne, out through sydney, and spent a lot of time around alice springs.
[06:45:43] <Fiesta> australians are all on the coast, so you certainly got the lonely route.
[06:45:45] <Lambda_Aurigae> with one trip to the outside steam cleaners...darwin
[06:46:31] <Lambda_Aurigae> couldn't even go swimming at the beach when I was there...major jellyfish infestation at the time.
[06:46:55] <Fiesta> mmm
[06:47:37] <Lambda_Aurigae> http://dangerousprototypes.com/2014/03/20/%C2%B5-wire-usb-on-attiny10-controlling-a-ws2812-led/
[06:47:47] <Lambda_Aurigae> some masochist put vusb on an attiny10.
[06:49:04] <Lambda_Aurigae> so, yous guys find that missing plane down there yet?
[06:49:33] <Fiesta> i think it's gonna be a long search.
[06:49:59] <Lambda_Aurigae> news right now is showing a possible debris field down west-southwest of perth.
[06:50:27] <Fiesta> that just could be a submarine exploding
[06:50:33] <Lambda_Aurigae> could be.
[06:50:45] <Fiesta> they make empretty bad quality down there
[06:50:51] <Fiesta> *make em pretty bad quality
[06:51:26] <Lambda_Aurigae> US navy wanted me to go into nuclear subs....no thank you.
[06:51:44] <Lambda_Aurigae> I went air farce instead.
[06:52:18] <Fiesta> hehe, farce
[06:52:37] <Lambda_Aurigae> yeah..
[06:52:42] <Lambda_Aurigae> they didn't even let me fly a plane!
[06:53:04] <Lambda_Aurigae> I flew on more commercial flights than military flights in the 4 years that I was in.
[06:53:48] <Lambda_Aurigae> ok...have fun, have a VB(green can) or two for me...I gotta go to work.
[06:54:01] <Fiesta> okie, cya
[06:54:31] <julesvernr> anyone good with BLDC motors? in my lab we usually use maxon motors with hall sensors. PLUS 2 channel optical encoders. Is this not redundant?
[06:56:49] <Lambda_Aurigae> brrr..cold...must warm truck before driving.
[06:56:56] <Lambda_Aurigae> julesvernr, might be redundant
[06:57:10] <Lambda_Aurigae> but, sometimes for precision measurements, redundant is good.
[06:57:24] <julesvernr> i can see if you used 3 channel so you cna tell absolute position
[06:58:13] <Lambda_Aurigae> depending on how they are setup, offset and all, you can probably get direction and speed from them.
[06:58:51] <Lambda_Aurigae> the 2 channel opticals likely give you a quadrature encoder like interface which will give you direction and speed both.
[06:59:01] <Lambda_Aurigae> the hall sensor just gives you a speed.
[06:59:17] <Lambda_Aurigae> if it spins too fast the quadrature might be iffy so you fall back on the hall.
[07:00:19] <julesvernr> thanks, that helps, i forgot about direction
[07:00:26] <Lambda_Aurigae> ok...I'm off,,still, again, something like that.
[07:00:33] <julesvernr> also i am aware that there are back emf/sensorless methods
[07:02:31] <julesvernr> oh these are MR, not optical encoders (not that it matters).
[10:17:51] <megal0maniac_afk> RikusW: Look! http://imgur.com/tdbrGYp
[10:18:02] <RikusW> hi megal0maniac_afk
[10:19:43] <RikusW> megal0maniac_afk: did anything with the debug code yet ?
[10:19:44] <RikusW> you don't need the asm, you can invent your own framing and commands too
[10:20:08] <RikusW> won't be compatible with U2S though
[10:20:30] <RikusW> megal0maniac_afk: where did you get those tubes ?!
[10:20:56] <megal0maniac_afk> RikusW: Unfortunately I've been really busy with uni. Lots of tests coming up, and constant assignments :/
[10:21:51] <megal0maniac_afk> They aren't mine, unfortunately. I found them in a cupboard at uni. Nobody seems to know where they're from or who they belong to - probably from one of the old labs. I should be getting a handful of them soon :)
[11:11:52] <antto> i've heard/read something about microcontroler/cpu which has built-in random number source..
[11:12:01] <antto> do atmegas have something similar?
[11:13:00] <megal0maniac_afk> antto: Here you go: https://code.google.com/p/avr-hardware-random-number-generation/wiki/WikiAVRentropy
[11:20:19] <antto> okay, so there's a way but there's no built-in such thing
[11:20:31] <antto> so it must have been about some other cpu then
[16:57:51] <Essobi> Anyone played with JTAGenum?
[17:48:20] <Essobi> sup
[19:22:52] <anton02> why is it easier to use bluetooth to send data from a computer to an RC car than to use an RF radio to do so?
[19:29:52] <Lambda_Aurigae> anton02, probably because bluetooth is a bunch of wrappers around RF radio.
[19:30:17] <Lambda_Aurigae> digital wrapper around an RF system.
[19:30:28] <Lambda_Aurigae> so, in effect, bluetooth IS an RF radio
[19:30:55] <Lambda_Aurigae> it just has other things done for you that you would have to do yourself, reinventing the wheel, if you use a barebones RF transmitter and receiver.
[19:31:31] <anton02> Lambda_Aurigae: okay, thanks
[19:32:13] <Lambda_Aurigae> kinda like, why is it easier to drive a car than to hop on a wheel and go..
[19:34:49] <anton02> lol
[19:45:18] <Lambda_Aurigae> also, with bluetooth, you get two way communications already setup for you...along with error correction and all that nicey stuff.
[19:45:30] <Lambda_Aurigae> so you can do telemetry off the car back to the computer.
[20:01:10] <hotch> Interesting question. My EE chops have gotten much better and I was actually going to ask about building a board with radio capabilities. I saw an Arduino based project called "Flutter" with built in radio, but the project schematics/eagle files etc are not live.
[20:01:17] <hotch> hah Lambda_Aurigae
[20:03:34] <Lambda_Aurigae> I like to use the nordic 2.4ghz chips for digital short range comms.
[20:04:12] <Lambda_Aurigae> got a bunch of them some time back from sparkfun, on the breakout boards with on board antennas...nice little two way units.
[20:04:31] <Lambda_Aurigae> that was before bluetooth came so far down in price though.
[20:04:58] <Roklobsta> i have som elittle cypress boards that are the same but i used them for a 2.4GHz scanner project. http://helix.air.net.au/index.php/diy-2-4ghz-spectrum-scanner/
[20:05:12] <hotch> Awesome thanks guy!
[20:05:22] * hotch reading, absorbing googness
[20:05:45] <Roklobsta> i am going to update it soon for USB use.
[20:06:43] <Lambda_Aurigae> https://www.sparkfun.com/products/691
[20:06:53] <Lambda_Aurigae> that's the new version of what I have.
[20:06:56] <hotch> Nice guys. Lambda_Aurigae: those chips look great, I even see an ATtiny project using one, Roklobsta: reading your project now, nice
[20:07:23] <hotch> Very cool, was downloading the eagle files on that
[20:07:33] <Roklobsta> hotch: it's old. there were quite a few similar scanner projects inspired by it you can find on hackaday.
[20:07:42] <Lambda_Aurigae> mine has a little antenna etched on the board rather than the surface mount antenna.
[20:07:47] <hotch> Will look.
[20:08:18] <Lambda_Aurigae> the one from Roklobsta is a bit more versatile...the nordic chips are a bit more limited and don't do scanner type things.
[20:08:38] <Roklobsta> alas i don't think cypress make those boards any more. maybe someone else does
[20:08:52] <Roklobsta> i have 3 spare in my box of bits which i will hold onto tightly
[20:09:38] <hotch> nice
[20:09:44] <Lambda_Aurigae> I bought 10 of the nordic based boards years back when sparkfun had a clearance.
[20:10:06] <Roklobsta> http://hackaday.com/2010/02/12/spectrum-analyzer-wedged-into-a-cellphone/
[20:12:02] <anton02> Lambda_Aurigae: how is telemetry useful? what does it do?
[20:13:13] <Lambda_Aurigae> umm.
[20:13:33] <Lambda_Aurigae> well, you can send back speed, battery levels, or whatever.
[20:14:18] <anton02> oh, i thought maybe it meant you can get the location of the device with respect to the receiver
[20:14:21] <Lambda_Aurigae> guessing you don't even know what telemetry is?
[20:14:36] <hotch> Is anyone using a boot loader or has used one? I'm working on projects where I would love to just be able to program over serial, any recommendations for an ATmega168?
[20:14:54] <Lambda_Aurigae> have used multiple bootloaders.
[20:14:56] <Roklobsta> arduino
[20:14:58] * Roklobsta ducks
[20:15:07] <Lambda_Aurigae> just never used the atmega168
[20:15:15] <Lambda_Aurigae> google is a great way to find them.
[20:15:59] <Roklobsta> i should publish the little preemtive kernel i got working for the avr
[20:16:22] <Lambda_Aurigae> Roklobsta, the bootloader is about the best thing arduino has put out.
[20:16:24] <hotch> hah, I've used Arduino too, it's what got me into using only straight C now and AVRs - it was a good intro.
[20:16:32] <hotch> hah Lambda_Aurigae
[20:16:41] <Roklobsta> i hated arduino within 10 seconds
[20:16:54] <Roklobsta> wiped it, did my own thing with avrstudio and jtag
[20:16:56] <Lambda_Aurigae> Roklobsta, same here.
[20:19:06] <hotch> I'll argue that non-hardware people looking to "try out" hardware might have not wanted all the initial overhead :)
[20:21:16] <Roklobsta> hah i just improved my wifi signal by rotating my laptop 45degrees
[20:21:25] <Lambda_Aurigae> not surprising.
[20:22:06] <Roklobsta> i sitting going WTF why are pages taking so long then I had a though bubble that looked like "herpa-deeeerp"
[20:22:43] <Lambda_Aurigae> built in antennas in notebooks are good for that.
[20:23:39] <Roklobsta> well my laptop doesn't look so hot on my desk now.
[20:23:49] <Roklobsta> why people just don't put cat5 through their houses I'll never know
[20:24:05] <Lambda_Aurigae> I would were I building new.
[20:24:32] <Roklobsta> i have rented brand new houses with nothing. just a single phone outlet above the kitchen sink(!).
[20:24:41] <Roklobsta> that was fun to get the ADSL working.
[20:24:46] <Lambda_Aurigae> hehe.
[20:24:54] <Lambda_Aurigae> at least we have wifi these days.
[20:25:16] <Lambda_Aurigae> I still have my first ever wireless access point from the 90s.
[20:25:31] <Roklobsta> i used to play with the old 8bit ISA wavelans
[20:25:55] <Lambda_Aurigae> I also have a set of powerline networking devices.
[20:26:06] <Roklobsta> i originally did this http://helix.air.net.au/index.php/d.i.y.-2.4ghz-helical-antenna/ for wavelan cards, pre-802.11
[20:26:07] <Lambda_Aurigae> 1Mb/s!!!
[20:26:14] <Roklobsta> 2MBit
[20:26:46] <Lambda_Aurigae> hehe.
[20:29:24] <Roklobsta> still we got a few km out of the things
[20:29:46] <Roklobsta> some guys used big milo tins with a 1/4 stub in them.
[20:30:13] <Roklobsta> they worked well, easier to make than a helix
[20:30:26] <Roklobsta> cantenna
[20:30:28] <Lambda_Aurigae> I just hung WAP11 units in the focal point of old primestar dish antennas.
[20:31:04] <Roklobsta> yeah i fiddled with the old conifers too. i still see rusty connifer antennas on roofs
[20:31:15] <Roklobsta> from the bad old days of MDS
[20:31:17] <Lambda_Aurigae> same here...
[20:33:10] <Lambda_Aurigae> those things worked when connected straight to wap11 units too.
[21:08:27] <hotch> Night guys -
[21:15:59] <braincracker> hello my friends
[21:16:00] <braincracker> http://hackaday.com/2013/10/09/a-motherboard-for-a-wifi-enabled-sd-card/
[21:16:09] <braincracker> as always :)
[21:16:21] <braincracker> have fun
[21:18:36] <braincracker> wifi transcend coprocessor + wifi fr atmega
[21:27:58] <braincracker> http://hackaday.com/2013/08/12/hacking-transcend-wifi-sd-cards/ http://www.reddit.com/r/netsec/comments/1k4zhz/i_rooted_my_transcend_wifi_sd_card_and_wrote_a/ http://haxit.blogspot.ch/2013/08/hacking-transcend-wifi-sd-cards.html
[22:53:30] <anton02> what do you guys think of wiring up an ISP header to your PCB for re-programming the chip if needed without dismantling the circuit? I found this for the chip i wish to use but he doesn't specify what res or caps he used. https://courses.cs.washington.edu/courses/cse466/09wi/labs/avrisp/index.html
[22:59:20] <anton02> pls respond
[22:59:35] <anton02> atmega16 it is
[22:59:58] <Casper> anton02: be a bit more patient
[23:00:10] <Casper> and avr are MADE to be programmed in circuit
[23:00:19] <Casper> ISP... In System Programming
[23:00:52] <Casper> anbd what cap?
[23:01:10] <anton02> so one is actually expected to implement the ISP pins on a PCB all the time?
[23:01:51] <Casper> your programmer need free access to mosi, miso, sck and reset, depending on your circuit you may have to add a jumper or alike if those pins are used for something else that would cause issue with the programmer
[23:01:53] <anton02> yeah so I guess the resistor and capacitor required must be mentioned on the chips datasheet then shouldnt it?
[23:02:13] <Casper> what caps?
[23:02:24] <anton02> oh it must be a crystal
[23:03:21] <anton02> Casper: that big silver thing next to the microchip https://courses.cs.washington.edu/courses/cse466/09wi/labs/avrisp/wiredheader.jpg
[23:03:41] <anton02> Also, there's a resistor there.
[23:04:15] <Casper> that's a crystal
[23:04:37] <Casper> and the crystal require 2 capacitors, 13-22pF, from pin to ground
[23:04:43] <anton02> are they parts necessary to make the programmer work?
[23:04:50] <Casper> the resistor is probably a pullup on the reset
[23:04:56] <Casper> no and yes
[23:05:20] <Casper> by default, the avr run off an internal clock source
[23:05:32] <Casper> it's called an RC oscillator
[23:05:39] <Casper> RC stand for resistor and capacitor
[23:06:06] <anton02> does the microchip datasheet mention the exact specs of the parts needed to put your own ISP on a PCB?
[23:07:41] <Casper> basically, a small internal capacitor is charged and discharged via a resistor, the values of both is what make the speed (it take time to charge and discharge the cap). The problem is: that way is quite imprecise. And unstable. It is fine for non-timing critical application, but not when you need precise timing. It can be off by 10% or more, vary with the voltage and temperature and from chip to chip and wear and the moon phase and....
[23:08:24] <anton02> So what would the alternative be if you did require it to be more precise?
[23:09:13] <Casper> the can is a crystal, think of it as a bell. The avr send a pulse of power, the crystal resonate and send back a signal. the avr then send more pulse in sync, which cause it to continue to resonate... The resonance depend on the physical shape and size of the small crystal inside the can, and is quite precise
[23:09:25] <Casper> the avr require a valid clock source
[23:09:34] <Casper> no clock, no workie
[23:10:15] <Casper> there is an hardware setting that tell where to look for that clock: internal (and at which speed), external crystal or external clock (i.e. a clock from another device, not a crystal)
[23:10:23] <Casper> by default, that setting is the internal RC
[23:10:45] <Casper> if you however set it to something else, then you need that kind of clock source present on the board
[23:11:03] <Casper> usually people select external crystal (that can)
[23:11:17] <Casper> if you do, then the crystal must be present on the board for it to program and run
[23:11:34] <Casper> crystal can be very precise, watch use them
[23:11:56] <Casper> and they get a few seconds off per year... that's not a big error
[23:12:13] <Casper> talking about crystal
[23:12:21] <anton02> I think i should be able to make do with the internal crystal oscillator. So knowing this, are there no further components that I need to connect to the chip in order to attach my ISP programmer to the chip? (apart from the 6pin header)
[23:14:00] <Casper> you may want to not use some "even" numbers, like a "nice" 16.000MHz or 20.000MHz, but some weirder ones, 14.7456MHz and 18.432MHz are better choices, because if you do serial communication, it divide perfectly in all speed
[23:14:25] <Casper> anton02: yes, by default it work without the crystal
[23:14:49] <Casper> if you make a board, leave space for those components even if you don't plan to use them...
[23:14:51] <anton02> Well, actually I will be using serial communication. Should I be able to use the internal crystal for that? Or will I need an external one?
[23:15:02] <Casper> use a crystal for external
[23:15:05] <Casper> errr
[23:15:09] <Casper> crystal for serial
[23:15:17] <anton02> oh ok
[23:15:25] <Casper> anton02: serial require less than 2% error in speed
[23:15:30] <Casper> ideally less than 1%
[23:15:36] <anton02> I guess that clears that up, cheers.
[23:15:43] <Casper> more than that and you will ends up with error
[23:15:54] <Casper> http://www.wormfood.net/avrbaudcalc.php
[23:16:21] <anton02> im using a bluetooth module for serial communication that connects to the RX and TX
[23:16:29] <Casper> yeah, same thing
[23:19:28] <Casper> anton02: the issue with serial communication is that... there is no clock signal in the serial communication
[23:19:56] <Casper> the data sent is: a start bit, the 8 data bits then a stop bit
[23:20:04] <Casper> the start is always 1, the stop is always 0
[23:21:16] <anton02> oh, i see
[23:21:28] <Casper> both sender and receiver work by dividing the crystal speed by some values, in case of the avr, it first divide the crystal by 16, then divide it by whatever divider you select
[23:21:49] <Casper> that should give 1 bit per (divided) clock
[23:22:10] <Casper> when it receive, it basically sample 16 times each bit and average
[23:23:13] <Casper> so start bit, sample 16 times, is the average 1? yes? then it's a start bit, then it sample 8 bits (16 times each), then another bit (16 times), that last bit must average to 0
[23:23:27] <Casper> if the last bit do not average to 0 then there is a framing error
[23:23:34] <Casper> and the data is invalid
[23:24:02] <Casper> now, if both sides are too off then it will never transmit correctly
[23:24:31] <Casper> which is why a crystal is almost a requirement
[23:24:39] <Casper> there is way around that, but it complicate stuff
[23:28:55] <anton02> Casper: so do you think 14.7456MHz would be a good choice for a serial bluetoothmodules?
[23:29:14] <Casper> is your avr a 16 or 20MHz part?
[23:29:35] <anton02> i will check the atmega16 datasheet
[23:29:37] <Casper> i.e. is it -16 or -20?
[23:30:28] <anton02> Casper: 16MHz
[23:30:56] <Casper> then 14.7456 it is
[23:31:11] <Casper> if it was a 20MHz one then I'ld have suggested the 18.432
[23:31:15] <Casper> btw
[23:31:18] <Casper> for crystal
[23:31:22] <anton02> cool, thanks. But just out of curiousity how did you arrive at that number.
[23:31:37] <Casper> 16MHz, 16.0MHz 16.00MHz and 16.000MHz isn't the same
[23:32:00] <Casper> the number of zero basically tell you the precision
[23:32:24] <Casper> the more zero, the higher the precision
[23:32:39] <Casper> the 14.7456 I just took it in the table
[23:33:20] <anton02> Casper: do you think it would be best to choose the 8Mhz or 16Mhz variant of the atmega16 chip?
[23:34:14] <Casper> get the 16
[23:34:29] <anton02> Casper: but im wondering how does the microchips clock even matter if youre using an external crystal?
[23:34:36] <Casper> unless you plan to do low power stuff that won't excede 8MHz
[23:34:58] <Casper> the MHz rating is the maximum speed that the avr is made to run at
[23:35:22] <Casper> if you get a 8MHz version, then running it at 16 can cause issues, or even damage it (overclocked)
[23:36:15] <anton02> oh, i see
[23:36:19] <Casper> however, the 8MHz version is specced to be able to run at a lower voltage, which cause it to take less power. usefull for a device that need to run for weeks/months on battery
[23:39:08] <anton02> so the clock speed of the chip isn't just a determinant of the crystal speed,but also the manufacturing specs of other aspects of the chip i.e. registers and so forth.
[23:40:23] <Casper> speed of the internal transistors yes, those limit the maximum allowable speed
[23:42:58] <anton02> do microchips ever come with high precission crystals? Such as a 16.000Mhz one?
[23:44:02] <Casper> not internal