#avr | Logs for 2014-10-28

Back
[01:17:11] <anton02> repeatedly setting an ocr value to the same value will result in different pwm behaviour than if you set it just once every 10 seconds or so
[01:42:55] <anton02> why do you think that'd be
[05:55:03] <megal0maniac> Quick question, I need an #ifdef depending on which uC is used. How can I do this?
[05:56:19] <megal0maniac> Not sure what is defined. I know there was something
[05:58:17] <megal0maniac> Ah, I've found __AVR_ATmega8__
[05:59:01] <megal0maniac> http://www.nongnu.org/avr-libc/user-manual/using_tools.html
[06:06:45] <Lambda_Aurigae> anton02, you are setting it while it's doing its thing and causing something in the timer to reset when you are setting it maybe?
[06:35:17] <Lambda_Aurigae> http://dangerousprototypes.com/2014/10/28/dirty-tuesday-a-bumpy-road-to-streamlined-service/
[09:42:13] <LeoNerd> Hah! I think I have fiiiiiiinally found an SPI-capable (justabout) shift register. It's not a 74-series, it's a 4021.
[09:43:44] <LeoNerd> In parallel load mode it's asynchronously constantly using the parallel inputs to set the D latches; when you switch it to serial out mode, it effectively captures the state on that edge, letting you clock it out. Only thing about it is a lack of hi-Z on the output; but that's fixable
[09:46:05] <Thrashbarg> LeoNerd: I made a similar shift register out of a 74HC374. Wired successive outputs to inputs and used the tristate pin to load bits
[09:48:32] <Thrashbarg> might not be as easy to implement as the 4021 because you need to tri-state the pins and send a clock pulse
[09:48:54] <LeoNerd> Yah
[09:49:05] <LeoNerd> Plus the data input would collide with the previous stage outputs surely
[09:49:51] <Thrashbarg> use a 74HC244 lol
[09:50:31] <Thrashbarg> depends on what you're trying to do... the 4021 looks pretty good though
[09:50:48] <Thrashbarg> there's probably a 74HC4021 about
[09:54:16] <LeoNerd> I just find it slightly odd that compared to the ease of putting a 75'595 on SPI as an output, there just doesn't seem any suitable inputs
[15:52:21] * LeoNerd hunts surface mount caps, ponders viability of SMT-based AVR HVSP board
[15:52:25] <LeoNerd> Mmm it's acronyms all the way
[16:05:38] <Tom_itx> go for it
[16:05:59] <Tom_itx> what sort of caps do you need?
[16:07:59] <LeoNerd> Nothing fancy... 220nF for the charge pump, and something non-too-specific for decoupling.. they have 4.7µF on the diagram
[16:08:11] <LeoNerd> Guessing the latter at least won't be an 0603.. something bigger
[16:08:55] <Tom_itx> i've got some 10µf in ceramic
[16:09:13] <Tom_itx> i'm sure you can find some
[16:11:10] <LeoNerd> Well, larger is better
[16:11:51] <Tom_itx> what voltage?
[16:13:16] <Tom_itx> http://www.digikey.com/product-detail/en/C1608X5R0J106M080AB/445-4112-1-ND/1975462
[16:13:38] <LeoNerd> 5 and 12 at most
[16:13:44] <LeoNerd> Well.. maybe a little over. probably 16
[16:13:52] <Tom_itx> those are 6.3
[16:14:12] <LeoNerd> Oh; yeah one of these will be on the 12V output line, so I'm guessing 16V at least
[16:14:13] <Tom_itx> 16 may be a little harder to find
[16:14:34] <LeoNerd> Mmm.. I mean; I do have TTH caps if that's necessary
[16:14:45] <Tom_itx> keep looking...
[16:14:51] <Tom_itx> you may find em
[16:15:50] <LeoNerd> http://www.ebay.co.uk/itm/50pcs-A-Type-Surface-Mount-4-7uF-16V-SMT-SMD-Chip-Tantalum-Capacitors-/291169190231?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item43cb094157
[16:15:55] <LeoNerd> Ugh URLs
[16:16:32] <LeoNerd> Those seem fine for decoupling
[16:16:37] <LeoNerd> And charge store
[16:17:17] <Tom_itx> don't use tantalum
[16:17:39] <LeoNerd> Oh?
[16:17:49] <Tom_itx> for decoupling?
[16:17:54] <Tom_itx> use ceramic
[16:18:05] <LeoNerd> Hmm
[16:18:22] <Tom_itx> http://www.digikey.com/product-detail/en/CL21A106KOQNNNE/1276-1096-1-ND/3889182
[16:18:39] <Tom_itx> those are 0805 though
[16:18:46] <LeoNerd> That's fine
[16:19:26] <Tom_itx> kinda dictated by the size and voltage
[16:19:44] <LeoNerd> Yah
[16:20:35] <Tom_itx> test the board before you run a whole batch with smt
[16:21:25] <LeoNerd> Well, again I'm not mass-producing this. I want /one/
[16:27:00] <megal0maniac> Guise.
[16:27:04] <megal0maniac> My clock won't tick
[16:28:05] <megal0maniac> SPI clock. I've tried everything. It's set as output, SPI is enabled and master. It works exactly as it should and I can program it fine, but it won't drive the sck line
[16:28:32] <megal0maniac> It's still shifting out data, so the clock must be there internally. Can't figure out why I can't see it on the pin
[16:32:03] <grafi__> Is it possible to use ADC0 as GPIO?
[16:32:28] <Tom_itx> grafi__ yes
[16:32:28] <xorm> on all the avr uCs i've used, yes
[16:32:37] <megal0maniac> When I program the chip, I can see the clock line do its thing. And it is set as output
[16:32:39] <xorm> what does the pin assignment say?
[16:32:40] <Tom_itx> grafi__ it is GPIO by default
[16:32:40] <megal0maniac> Any ideas?
[16:32:52] <Tom_itx> megal0maniac change the pacemaker battery?
[16:33:03] <xorm> i think there are some chips that have dedicated ADC pins, esp with higher pincount
[16:33:10] <xorm> not sure if that's true for AVR line uCs
[16:33:16] <megal0maniac> Tom_itx: Tried that. What's next?
[16:33:28] <Tom_itx> i'm not real sure...
[16:34:04] <megal0maniac> It's puzzling. SPI has always been easy, I've never had this
[16:34:15] <Tom_itx> yeah
[16:34:28] <Tom_itx> did you try a different chip?
[16:34:35] <Tom_itx> it could be faulty...
[16:34:59] <megal0maniac> That's my next move. Want to rule out everything else first
[16:36:40] <megal0maniac> It is a $5 board from China...
[16:37:11] <Tom_itx> :(
[16:38:14] <megal0maniac> ?
[16:38:16] <grafi__> Tom_itx: ok, good, thanks. I have three switches, one that are connected to a GPIO/INT5 that works, and the other two connected to ADC0 and ADC1 that for some reason wont work
[16:38:57] <Tom_itx> check to make sure they're not dedicated but i think all adc are GPIO until enabled
[16:39:51] <LeoNerd> Ah - found one! CAP, CERAMIC, 4.7UF, 16V, X5R, 0603
[16:39:59] <LeoNerd> What's X5R mean?
[16:42:04] <LeoNerd> Hmm.. "dielectric characteristic" apparently
[16:45:29] <Tom_itx> yeah
[16:46:15] <Tom_itx> http://wiki.xtronics.com/index.php/Capacitor_Codes
[16:50:28] <megal0maniac> Works with the Teensy
[16:50:53] <megal0maniac> No changes to software/pinout where possible. Must be dud silicone
[16:51:38] <Tom_itx> no
[16:51:44] <Tom_itx> just chinese silicone
[17:05:46] <megal0maniac> Do such things exist?
[17:05:50] <megal0maniac> For AVRs
[17:06:33] <Tom_itx> if it's exhists it's been duplicated by china
[17:57:06] <N1njaneer> LeoNerd: http://en.wikipedia.org/wiki/Ceramic_capacitor see section under Class 2 Ceramic Capacitors
[17:57:22] <Tom_itx> nasa rocket just exploded on launch...
[17:57:30] <Tom_itx> ~15 min ago
[17:58:34] <LeoNerd> Ooh :(
[17:58:58] <N1njaneer> Did it explode on the pad, or did the range officer destroy it
[17:58:59] <N1njaneer> ?
[17:59:09] <Tom_itx> on launch
[17:59:19] <Tom_itx> it lifted off
[17:59:50] <N1njaneer> Ahh okay, didn't even get high enough to use self-destruct.
[17:59:57] <N1njaneer> Well, at least no loss of life.
[18:00:03] <LeoNerd> Yah,. unmanned
[18:00:12] <LeoNerd> So not as bad as Challenger, etc..
[18:00:44] <N1njaneer> Just a big insurance claim
[18:01:00] <N1njaneer> ISS needs to wait for more astronaut ice-cream
[18:05:28] <N1njaneer> Ooh, announcing that there's classified crypto in the debris. :)
[18:13:20] <Jartza> yeah... https://www.youtube.com/watch?v=NCWunnJXdm0
[18:41:06] <alex20032> hi
[18:48:58] <N1njaneer> Perhaps the Antares rocket had a counterfit FTDI chip onboard :D
[18:58:17] <antto> ouch
[19:02:08] <antto> well, it kinda.. blew up a bit ;P~
[19:32:45] <alex20032> I was wondering... at my school, they teach me PIC
[19:32:52] <alex20032> But im not really studying in electrical... more in computer engineering
[19:32:59] <alex20032> And to me, it look like the PIC is more geared to electrical engineering than computer engineering (it look to me i need to know my electronic when i use a PIC... the ADC is complex, lot of comparator, when im using I2C, SPI & other, have to set slew rate... have to set the sample speed...)
[19:33:04] <alex20032> When i look at an AVR, it look like the opposite, a more digital oriented mcu, we play less with those analog parameter
[19:33:22] <N1njaneer> Sometimes that's just differences in the API and libraries
[19:33:27] <alex20032> What other architecture, like the AVR, could i use without an electrical background? Where i could read an ADC easily?
[19:33:57] <N1njaneer> Do you need more horsepower?
[19:34:01] <alex20032> I mean, if i want the simplicity of AVR architecture, but more beefy, like 16 bits or 32 bits
[19:34:20] <N1njaneer> I would go with Atmel's ARM processors - SAM series.
[19:34:26] <alex20032> (*im not talking about arduino thing, but real mcu programming, but a simple, powerful architecture*)
[19:34:33] <N1njaneer> I've recently done designs on SAMD21 and SAM4E16 and they're quite nice.
[19:34:37] <N1njaneer> They I would go for ARM
[19:34:47] <N1njaneer> Atmel SAMD21 starter kits are cheap-to-free :)
[19:34:55] <N1njaneer> +Then
[19:34:58] <alex20032> I just want to put a bit in a register to start an ADC conversion, then, when conversion done, check result
[19:35:23] <alex20032> Today, for a school project, had to configure an ADC for a pic24fj64gb004... what a headache
[19:35:40] <N1njaneer> The AVR ADC still have some setup to get going.
[19:35:41] <alex20032> I dont want to become an expert in ADC
[19:35:53] <N1njaneer> Unfortunatly it's not always avoidable.
[19:36:02] <N1njaneer> These things are inherently a bit complex
[19:36:25] <N1njaneer> There's a slight gap between the idea of an ADC in concept, and real-world.
[19:36:28] <alex20032> Something no more difficult than configuring ADC in AVR/PIC(** 8 bits, not pic 16 bits**)
[19:38:50] <alex20032> What about the msp430? Does it require a strong understanding of electronic to configure the ADC & other periphiral?
[19:39:14] <N1njaneer> MSP430 is... somewhat painful.
[19:39:42] <N1njaneer> I would push you toward general ARM stuff. Atmel's ARM SoC offering is very good and tools are inexpensive and robust.
[19:40:19] <alex20032> But dosent arm peripheral are even more complex? So i would need even a stronger understanding of the ADC ??
[19:40:44] <N1njaneer> You need to understand any device you are going to use. There's no way around that.
[19:41:21] <alex20032> But my point is pic (16 bits) require a stronger understanding of electrical than avr and pic (8 bits)
[19:41:54] <alex20032> I just want to do mostly simple ADC read (no need of high speed or high accurate read) and digital stuff, im not an electrical engineer
[19:42:10] <N1njaneer> I would look at Arduino stuff, then, honestly.
[19:42:45] <N1njaneer> You HAVE to learn the complexities of the devices if you want to be able to effectively use them. But you work through it all once, and then you have an idea of what's going on.
[19:43:00] <alex20032> i dont want to loose access to interrupt, dma & other
[19:43:08] <alex20032> so arduino is not an option
[19:43:18] <N1njaneer> Then why not just use AVR?
[19:43:22] <N1njaneer> Do it directly.
[19:43:41] <alex20032> im just a software guy wanting to do some embedded system without having to do too much hardcore electronic & analog
[19:43:46] <N1njaneer> If you need more horsepower, clock at 16-20Mhz. If you need more than that, then go to ARM.
[19:44:06] <N1njaneer> Unfortunatly the latter goes along with the embedded aspect to some extent.
[19:44:33] <N1njaneer> If you don't want to do the low level stuff, find a working board design that is already proven and working, and has a robust set of libraries written for it.
[19:45:30] <N1njaneer> Not sure what to suggest beyond that.
[19:46:33] <alex20032> What about lpc? I heard they got simple peripheral set... and those are arm...
[19:47:04] <alex20032> would their peripheral would be as simple as avr/pic? maybe you have some experience with them
[19:47:16] <N1njaneer> I do not. I do AVR, ARM, and FPGAs: )
[19:47:45] <N1njaneer> But full PCB layouts designed from scratch for each chip.
[19:51:02] <N1njaneer> I actually moved more in to CompE/EE stuff from CompSci because I fell in love with the embedded aspects.
[19:51:24] <N1njaneer> I still do a lot of high-level software engineering, but it's generally for running on or talking to low-level hardware
[19:52:20] <alex20032> Im like comp sci wanting to make fun with embedded
[19:52:44] <alex20032> I just want a simple set of peripheral & some computing power... like a 80 mhz avr...
[19:52:53] <N1njaneer> Go ARM
[19:53:14] <alex20032> But well, i looked up to sam21d's ADC... easier to use than the pic24fj64gb004's ADC
[19:53:15] <N1njaneer> It's becomming pretty much the most ubiquitous platform out there now.
[19:53:40] <N1njaneer> VERY good skill to have, and transferrable to working with literally thousands of different devices. Just the peripherals change.
[19:54:51] <alex20032> im so accustometed to arm with datasheet over 2k page...
[19:54:58] <alex20032> but sam21d look verry nice
[19:55:21] <alex20032> and as like the avr, atmel did a nice job on simple peripheral and nice datasheet
[19:55:31] <N1njaneer> Get one of the AVR-XPLAINED kits as a starter
[19:55:36] <alex20032> i alway liked more atmel datasheet than microchip one
[19:55:54] <N1njaneer> Inexpensive, built-in USB JTAG debugging, tons of code examples and documentation under AVR Studio
[19:56:25] <alex20032> with arduino zero using sam21d, i will get a nice development board (running bare metal, not arduino of course)
[19:56:37] <N1njaneer> Yep.
[19:56:45] <alex20032> N1njaneer: why AVR-XPLAINED?
[19:56:47] <N1njaneer> Just use Atmel Studio
[19:56:52] <alex20032> we where talking about arm
[19:57:32] <N1njaneer> The XPLAINED series has both AVR and SAM parts
[19:58:12] <alex20032> i alway tough of ARM as beefy processor and complex peripheral... but then again, atmel made arm simple with that sam21 :)
[19:58:16] <N1njaneer> hold on, maybe they don't have a SAMD21
[19:58:26] <N1njaneer> ATSAMD21-XPRO
[19:58:33] <N1njaneer> "XPLAINED PRO"
[20:00:14] <alex20032> so you said that msp430 has some problem?
[20:00:34] <N1njaneer> The toolchain is kind of ugh
[20:00:44] <alex20032> for now, i keep in mind sam21d and cheap lpc (since i heard that they are easy to use)
[20:00:49] <N1njaneer> I have had bad experiences with them, as well as our clients.
[20:01:04] <alex20032> gcc-msp430... now come even with code composer studio 6
[20:01:22] <N1njaneer> MSP430 is also not ARM - it's proprietary, so a less transferrable set of skills
[20:02:51] <alex20032> we cant really learn ARM (except the asm)... we learn the peripheral
[20:03:03] <N1njaneer> Anyone want to see the new toys I picked up from the surplus place today? :D
[20:03:04] <alex20032> so learning atmel arm wont help me using another manufacturer arm
[20:03:27] <N1njaneer> Sure it will. The code and concepts are all transferrable.
[20:03:36] <N1njaneer> As well as usually the toolchains, too.
[20:03:46] <N1njaneer> Peripherals will always be different.
[20:03:47] <alex20032> Why sam21?
[20:03:51] <alex20032> why not another sam?
[20:04:06] <alex20032> is the sam21 the most simple to use? The most powerful? The most flexible?
[20:04:07] <N1njaneer> Because it's avaliable for cheap and dev boards are inexpensive.
[20:04:37] <N1njaneer> I use SAM4E16 on designs I need 10/100 Ethernet on. Also 120 Mhz vs SAMD21 which tops at 48Mhz.
[20:04:44] <alex20032> when an arm is more simple than a pic...
[20:04:48] <N1njaneer> If you need more, SAM5D series goes to 500Mhz, etc
[20:04:58] <alex20032> is sam4e16 more complex to use than sam21?
[20:05:16] <N1njaneer> About the same, the difference again lies in the peripherals.
[20:05:30] <alex20032> i mean in peripheral
[20:05:44] <N1njaneer> Look at them on atmel.com and compare the offered peripherals.
[20:05:49] <alex20032> does for example, ADC, spi, i2c & other usual peripheral harder to use?
[20:06:04] <N1njaneer> SAM4E has USB, Ethernet, etc etc whereas SAM21 does not.
[20:07:38] <alex20032> well, im not talking in the extra peripheral, but on usual peripheral... would using a sam4e on a project that dont require usb/ethernet/can/other would be more complex than using a sam21?
[20:07:48] <alex20032> For example, on a general purpose development board
[20:07:49] <N1njaneer> Probably, yes.
[20:07:57] <N1njaneer> And the dev board is more expensive.
[20:12:29] <alex20032> i feel even the arduino due's arm is maybe too much complex to start with
[20:13:27] <N1njaneer> Then start simpler and build confidence
[20:14:08] <alex20032> yep, sam21d look perfect to start up... just need to wait for aruino zero (i want to get a development board with female header)
[22:46:19] <jimmyhoughjr> evening all
[22:46:47] <jimmyhoughjr> what is a good solution for avr development on a mac?
[22:47:10] <jimmyhoughjr> that is not virtualizing windows and using AVRStudio
[22:48:40] <Tom_itx> http://www.obdev.at/products/crosspack/download.html
[22:48:53] <Tom_itx> avrdude
[22:49:03] <Tom_itx> gcc and your favorite editor