#avr | Logs for 2015-03-20

Back
[03:43:23] <pepijndevos> SLEEP_MODE_ADC messes up my readings :(
[03:44:08] <pepijndevos> It seems my power source is very unstable, so after any sleep mode I need to add a delay for things to stabalise.
[03:44:47] <pepijndevos> But I'm just using vcc for the aref, so maybe I need to fix that.
[03:54:54] <malinus> pepijndevos: if you read the datasheet, you would know all that. It tells you all that, with the (somehow) precise settle times, and number of samples to throw away.
[04:01:02] <pepijndevos> malinus, but if the ADC is running, and goes to sleep while waiting for results, throwing away that one result makes no sense.
[07:47:03] <skroon> what is a word size on AVR ? 16 bits ?
[07:51:58] <malinus> yes
[08:37:25] <uskerine> Hi, I have an Arduino Pro http://www.elecfreaks.com/store/images/product_images/arduino/Arduino_MB_Por_07.jpg and a USB FTDI board (http://i00.i.aliimg.com/wsphoto/v0/1338810316_1/Arduino-Adapter-FT232-module-USB-to-serial-UART-3-3V-5V-dual-power-UART-Arduino-pro.jpg)
[08:37:49] <uskerine> Should I configure an external tool like in the case of the Arduino Mini? If so, how? thanks
[08:38:30] <LeoNerd> "an external tool" ?
[08:38:33] <LeoNerd> I'm not sure I understand the question
[08:40:22] <uskerine> It is actually not very well formulated. For programming the Arduino Mini (which has already a USB conenctor), I choosed "External Tools..." under the "Tools" menu of Atmel Studio.
[08:40:36] <uskerine> In that window I setup an external command to launch avrdude
[08:40:44] <LeoNerd> Oh.. Studio. I don't know that. I just run avrdude
[08:41:04] <uskerine> Do you use avrdude for Arduino Pro?
[08:41:35] <LeoNerd> Yah
[08:41:41] <uskerine> ok, then I guess it will be exactly the same
[08:41:43] <uskerine> I will give it a try
[08:41:53] <LeoNerd> Well.. *usually* I stick the ISP6 header on it and use my real burner :)
[08:42:33] <LeoNerd> I use the Arduino Pro boards because they're convenient and cheap, but usually I'll end up wiping the bootloader and doing straight ISP onto it
[08:42:37] <LeoNerd> For a finished product anyway
[08:44:41] * RattusRattus has never used the bootloader, always been bare metal AVR
[08:44:57] <LeoNerd> The loader can be useful on the USB-attached devices
[08:45:04] <LeoNerd> (e.g. the Nano)
[08:45:17] <RattusRattus> true
[08:45:37] <uskerine> Yeah, I find Arduino Pro boards as a very cheap tool to troubleshoot. I have manually wired the FTDI board to the Arduino Pro, should I connect RXD to RXD and TXD to TXS, or should I cross RXD and TXD?
[08:45:54] <uskerine> troubleshoot=prototype
[08:45:57] <LeoNerd> I can never remember. Plus people often mislabel them
[08:46:01] <LeoNerd> Just try either way until it works ;)
[08:46:52] <RattusRattus> mislable is interesting - all depends if you want the MCU to be the host or client device (ie DTE/DCE)
[08:48:06] <uskerine> it is actually crossing
[08:48:24] <twnqx> RattusRattus: for the u16/u32 series the usb bootloader is neat
[08:48:27] <uskerine> which makes sense
[08:48:42] <LeoNerd> Ohyes.. I keep meaning to get me a 32U4 board
[08:48:42] <uskerine> so far so good
[08:48:55] <RattusRattus> twnqx: I quite agree
[08:49:01] <twnqx> LeoNerd do NOT get an arduino for that
[08:49:09] <twnqx> they are so bloody misdesigned
[08:49:15] <LeoNerd> I'm wanting to attach an nRF radio to PC over USB; I feel that nRF -- AVR -- FTDI -- USB is somewhat silly
[08:49:25] <LeoNerd> A USB-CDC-talking AVR chip would cut out the FTDI middleman
[08:49:27] <twnqx> alone the fact that they broke up complete 8bit IO ports by "7 pins to IO, 8th to LED"
[08:49:32] <LeoNerd> *headdesk*
[08:49:34] <LeoNerd> Yeah; that's silly
[08:49:35] <twnqx> makes me want to shoot the maker
[08:49:36] <LeoNerd> Any suggestions?
[08:50:02] <twnqx> i could bring up a friend's shop :P
[08:50:12] <twnqx> but yeah, i am stuck with arduino for now
[08:50:14] <RattusRattus> of cause the RNF is also available with an MCU in the same package (IIRC some 8051 flavor)
[08:50:19] <twnqx> next will be own boards :P
[08:50:28] <uskerine> so If I want to debug -set up break points and do single-step-, what do I need? I just realized that the FTDI USB-to-serial is not enough
[08:50:42] <twnqx> JTAG
[08:50:53] <RattusRattus> FTDI USB to JTAG could be though
[08:50:54] <twnqx> like avr jtagice mk1-3
[08:50:57] <LeoNerd> I don't fancy hand-soldering a 32U4
[08:51:00] <LeoNerd> Anyway, I only need one of it
[08:51:21] <twnqx> RattusRattus true, but that 2232 and up territory, no?
[08:51:34] <uskerine> that's expensive twnqx
[08:51:52] <uskerine> is there anything less expensive?
[08:51:58] <twnqx> LeoNerd: https://www.ehajo.de/en/kits/tht-kits/atmega32u4-breakout-board.html
[08:52:00] <twnqx> :>
[08:52:17] <LeoNerd> Ugh. .that's huuuuge
[08:52:19] <twnqx> well, a stupid old olimex jtag mk1 clone could do ofc
[08:52:26] <LeoNerd> Looking cute for dev work though
[08:53:04] <uskerine> and can you attach the JTAG to the arduino pro?
[08:54:07] <LeoNerd> Hm? Which one? The pro mini uses a 328, which doesn't do JTAG
[08:54:20] <RattusRattus> twnqx: yes
[08:54:49] <twnqx> uskerine: LeoNerd is right, not all avrs support jtag
[08:55:10] <twnqx> and in fact i haven't seen an arduino with jtag support so far (i don't really follow them, on the other hand)
[08:55:21] <twnqx> just bought one in china to test siome leds.
[08:55:34] <LeoNerd> I mostly work on ATtiny anyway... no JTAG for me
[08:55:39] <LeoNerd> (Though maybe debugWire one day ;) )
[08:56:55] <uskerine> LeoNerd so I can't do single step in the 328P?
[08:57:38] <LeoNerd> You can't on JTAG, no.
[08:57:40] <LeoNerd> You can on dW
[08:57:53] <LeoNerd> I don't know of a current-production AVR chip that doesn't do dW
[08:58:46] <uskerine> could you please explain me what is dW?
[08:58:57] <LeoNerd> debugWire
[08:59:59] <LeoNerd> twnqx: http://www.banggood.com/Teensy-2_0-USB-AVR-Development-Board-For-Arduino-ISP-ATMEGA32U4-p-970648.html?currency=GBP&refreshTmp=1&utm_source=google&utm_medium=shopping&utm_content=saul&utm_campaign=Electronic-xie-uk&gclid=CjwKEAjwiq-oBRC9gvHCsvDdn2cSJACV3DFRM6H28-AZehHzQTYYGOGXDqG-qLE6CKf71KZa7QZQYRoCTOLw_wcB
[09:00:03] <LeoNerd> Ugh.. long URL is long
[09:00:31] <LeoNerd> Stupid-as-all-fuck pin arrangement, but it looks nicely small anyway
[09:01:07] <twnqx> for dev stuff iÄd want something larger, for final use i'd use own PCBs...
[09:01:14] <twnqx> but whatever suits you :)
[09:01:37] <uskerine> LeoNerd and what would I need in terms of HW to use debugWire? I am really looking for break points and single-step
[09:02:04] <twnqx> probably a jtagice mk3 :P
[09:02:11] <LeoNerd> uskerine: Hah.. in terms of *using* it I have no idea... I don't have such.
[09:02:18] * LeoNerd is plannign to build a little thing sometime though
[09:04:07] <uskerine> I am a bit overwhelmed by the so many different options. Which would be the less expensive one allowing to use single-step and seting up breakpoints, ideally using Arduino Pro boards? (I would be fine in buying larger development boards such as http://www.ebay.es/itm/ATmega128-MP3-AVR-Development-Board-with-SD-Card-LCD-ISP-and-JTAG-Interface-/251486589431?pt=LH_DefaultDomain_0&hash=item3a8dc4d1f7)
[09:10:35] <uskerine> I am quite surprised you do not use in-system debug :)
[09:11:36] <LeoNerd> That's because so far I don't have any dW hardware or software
[09:11:45] <LeoNerd> twnqx: https://www.adafruit.com/products/296 funnily enough, Adafruit's one looks quite nice
[09:12:34] <LeoNerd> I also mostly debug things by observing on logic probes
[09:12:41] <LeoNerd> I've never really taken to single-step even on PC programming
[09:21:55] * RattusRattus does use single step, but most the bugs i am tracking down are time / sequence critical and single step just doesn't help there
[09:23:42] <RattusRattus> don't get me wrong - there is a place for it and I reach for step a lot of the time, but I find that it is no help at all with time critical events (and as I tend to use MCUs for control not general purpose processing then that is the normal bug I am trying to squash)
[10:44:25] <uskerine> LeoNerd single-step is quite useful sometimes
[10:47:07] <skroon> is it possible to make 1 .elf file which contains bootloader and app code ?
[10:52:04] <N1njaneer> Yes, you can just concatenate the files.
[10:53:22] <skroon> concat two .elf files really?
[10:54:09] <skroon> cat boot.elf app.elf > firmware.elf
[10:54:12] <skroon> ?
[10:54:12] <uskerine> RattusRattus I recently followed an online embbeded course, they describe a simple technique I was never aware of it, it just stores in an array the values that you want to watch at given points for your real time code. Then at a "safer" or "further" or "less critical" you can breakpoint or dump the whole array. Is it expected to be one of the least intrusive techniques for debugging real time
[10:54:54] <RattusRattus> uskerine: sounds very similar to a technique I have used a lot.
[10:55:51] <N1njaneer> skroon: No, there should be some command line utilities that will allow you to do this. I normally just do it using .hex files when we run larger production that needs a bootloader :)
[10:56:18] <RattusRattus> if you have a free running PWM output (i.e. spare CTC block) then just update the pwm value at 'checkpoints in your code.... very easy to see where code is at any given point in time by looking at duty cycle on a 'scope
[10:57:37] <uskerine> quite clever technique indeed
[11:00:32] <skroon> make delete my intermediate file (the .elf file) how can I stop it from doing that?
[11:01:33] <RattusRattus> uskerine: I tend to put an LED on the pin. if I see it dimming and then get brighter I know everything is fin. when it sits at the same brightness I know I have 'lcoked up'
[11:01:42] <RattusRattus> and then go take a closer look
[11:05:52] * uskerine still thinks that breakpoints, single-steps and watchs do not hurt :-)
[11:06:46] <RattusRattus> indeed, they help a lot. there are however cases where they don't help at all
[11:06:56] <mark4> where would i find the actual source code to go along with the avr1307 app note?
[11:07:06] <uskerine> I will live without them for now, but I guess it would be nice to have at least a couple of development boards (JTAG seems to be the less expensive for AVR)
[11:07:09] <RattusRattus> but they should be amungst your FIRST debugging steps
[11:07:52] <N1njaneer> uskerine: Get an ATMEL-ICE -- $40 USD for the raw board, will do ISP/DW/SWD/JTAG for both AVR and all Atmel ARM devices with full debugging support.
[11:09:05] <N1njaneer> mark4: http://www.atmel.com/Images/AVR1307.zip
[11:09:10] <mark4> the app note talks about 4 source files but they do not come packaged with the app note and theres NO links in the app note to where to get them
[11:09:11] <RattusRattus> if / when Tekkkz re-appears can I please ask someone point him at http://koipond.org.uk/~andy/AVR_timer/ it is the answer to his rant / questions yesterday....
[11:09:13] <mark4> ty!
[11:09:46] <mark4> N1njaneer, how did you find that link btw? i googled for it lol
[11:11:08] <mark4> of course, now i have to reverse engineer these source files because im not going anywhere near the android source libraries
[11:11:09] <mark4> puh puh bad taste
[11:11:22] <N1njaneer> mark4: Just search Atmel.com directly using their search window.
[11:11:34] <mark4> !
[11:11:35] <mark4> duh
[11:11:35] <mark4> lol
[11:11:49] <N1njaneer> They do have very comprehensive support.
[11:12:09] <mark4> im so used to sites like theirs that have badly broken searches that i never think to use them any more
[11:12:53] <N1njaneer> Yeah I know that feeling :)
[11:15:06] <mark4> i hate thinks like ASF, being able to do uart_open(); uart_send() uart_receive() is just drag and drop cut and paste coding. i want to know how :)
[11:20:04] <uskerine> N1njaneer what about this combo? http://www.ebay.es/itm/ATMEL-ATMega128-M128-AVR-Minimum-Core-Development-system-board-Module-ISP-JTAG/200926916680?_trksid=p2045573.c100033.m2042&_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D20140423084956%26meid%3D08e89ab07b1943efba7c03b174a7304d%26pid%3D100033%26rk%3D1%26rkt%3D4%26sd%3D200926916680 and http://www.ebay.es/itm/AVR-JTAG-AVR-USB-
[11:20:04] <uskerine> Emulator-Simulator-Debugger-Programmer-JTAG-ICE-for-Atmel-M20-/291015241814?pt=LH_DefaultDomain_0&hash=item43c1dc3056
[11:23:16] <skroon> what is the best place to look for memory address of something like: UCSR0A
[11:24:21] <LeoNerd> The summary in the data sheet?
[11:28:55] <twnqx> the include files?
[11:29:07] <twnqx> the preprocessor output?
[11:30:02] <twnqx> i think some #include + gcc -E might be as fast ctrl+f in adobe reader
[11:38:25] <N1njaneer> uskerine: The ATMEGA128 board looks good, though I'd still reccomend using Atmel's official ATMEL-ICE, at least if you are planning on developing under Atmel Studio.
[11:39:07] <N1njaneer> mark4: The ASF is useful for some quick working examples of how to use peripherals and at least get them to do some basic functionality which is handy for hardware bring-up, but a lot of times you have to dig deeper.
[11:40:06] <N1njaneer> I use ASF reference a lot for Atmel's ARM stuff. For instance it let me get the SPI bus going quickly to test some stuff out a board, but I ultimately used it as a test template and then rewrote the SPI support in order to optimize it and move over to using DMA transactions, etc.
[11:40:07] <uskerine> N1njaneer http://es.farnell.com/atmel/atatmel-ice-basic/debugger-atmel-arm-avr-basic-kit/dp/2407172?ost=2407172&mckv=CkkWKZf5|pcrid|productlistings&CMP=KNC-GES-FES-GEN-GSC-LISTINGS&gross_price=true
[11:40:17] <uskerine> that one?
[11:40:57] <N1njaneer> uskerine: Yep, that's it! It's nice to get the total package, but if you are tight on budget you CAN buy just the raw PCB without cables and housing. But I think it's nice to just get it all.
[11:41:22] <Tekkkz> Hey, RattusRattus : did you solved it?
[11:41:33] <uskerine> you mean this one: http://es.farnell.com/atmel/atatmel-ice-pcba/debugger-atmel-arm-avr-pcba-kit/dp/2407171?MER=i-9b10-00001460
[11:41:49] <N1njaneer> Yep, that's the lower-priced alternative.
[11:41:55] <uskerine> ok thanks N1njaneer
[11:41:55] <skroon> LeoNerd: yeah i'm hoping actually to read it in the datasheet, i'm now in the "AVR Memories" chapter, that might be the wrong place to look?
[11:42:05] <uskerine> I will seriously consider purchasing it
[11:42:21] <N1njaneer> skroon: Look at the end of the datasheet - there is a table that lists all of the register addresses
[11:42:59] <skroon> N1njaneer: indeed I see "Register Summary" now... for example: UCSR0A is 0xC0 for me
[11:43:14] <N1njaneer> Yep, that's it :)
[11:44:01] <skroon> N1njaneer: so i'm trying to use GDB to look at the memory and understand things a bit more. However it's a bit unclear to me now where I need to look for 0xC0, is this in RAM and is this then offset of: 0x800000 + 0xC0 ?
[11:44:12] <skroon> hope you know what I mean :)
[11:47:06] <N1njaneer> No, just at 0xC0
[11:48:32] <N1njaneer> I'm not sure how to use GDB directly on doing that, as I do everything under an IDE that just lets you look at things directly. In Atmel Studio they have a full break-down for all registers that you can just view and set interactively on screen, which is very handy.
[11:50:17] <RattusRattus> Tekkkz: yes. take a look at http://koipond.org.uk/~andy/AVR_timer/
[11:50:43] <skroon> N1njaneer: cool
[11:51:12] <skroon> N1njaneer: you mean you can just say something like, show me: UCSR0A
[11:51:15] <RattusRattus> Tekkkz: busy right now will talk in 10-15min?
[11:51:24] <Tekkkz> ok RattusRattus
[11:51:47] <N1njaneer> skroon: Yes, you literally just open the tree and look at the register - shows the raw value as well as bits, you can click on the bits to toggle them, etc.
[11:56:07] <skroon> N1njaneer: I would like to see that in AVR Studio now actually, firing up my Virtual Machine :)
[11:56:21] <N1njaneer> It's very convenient for sure.
[11:56:22] <skroon> N1njaneer: but how can I start the "debugger" without source code written?
[11:56:25] <Tekkkz> RattusRattus: just wrinte when you are ready
[11:56:36] <skroon> N1njaneer: I mean, I just want to check and see the registers, and memory
[11:56:58] <N1njaneer> skroon: Just start a blank example project for your project and debug on that.
[11:57:23] <skroon> N1njaneer: right, gonna try it out right away... btw this happens on the target right? or in some kind of simulation?
[11:58:27] <N1njaneer> skroon: Unfortunatly I'm unaware of a way with Atmel's tools to run interactive debug (sourceless) without the source code. I've asked them about this several times, as I once had an issue where I was trying to see what was happening on an old bootloader I'd compiled 10 years prior on a non-gcc compiler. Unfortunatly no luck. I just ended up recompiling it. :)
[11:58:49] <N1njaneer> skroon: At least on the ARM side of things you can do full memory dumps and interactive debugging with or without the source using Segger's utilities.
[11:58:52] <uskerine> I see that there are 5V and 3.3V Arduino Pro Mini
[11:58:55] <skroon> N1njaneer: ah crap :)
[11:59:00] <uskerine> are the AVR actually 5v or 3.3v?
[11:59:17] <skroon> N1njaneer: i'm on 8bit avr microcontroller: 1284p to be more exact
[11:59:19] <N1njaneer> skroon: Yes, you manipulate the direct registers when looking at that - not simulation. Useful to wiggle IO lines and such.
[11:59:49] <N1njaneer> uskerine: AVR can generally go from 1.8V to 5V but there are restrictions on the maximum clock speed at lower voltages
[12:01:40] <uskerine> I see
[12:01:42] * N1njaneer watches goats at home via the Internet
[12:01:48] <uskerine> so 16MHz needs 5V
[12:01:48] <N1njaneer> I love modern technology!
[12:02:06] <N1njaneer> uskerine: Generally, yes. Or at least to meet Atmel's guaranteed specs
[12:02:09] <skroon> N1njaneer: I bought a couple of debuggers, because some didnt' work in OSX, while other did... I got: Atmel-ICE and JTAGICE3
[12:02:18] <skroon> N1njaneer: I also have a AVRmkII for ISP programming
[12:02:23] <Tom_itx> N1njaneer what server are you using?
[12:02:33] <skroon> N1njaneer: I did see the jegger stuff, are those the ones called JLINK ?
[12:02:55] <uskerine> N1njaneer could I use some fuse or something to safely decrease the speed of the AVR? I am feeding my 5V Arduino Mini Pros with 3.3V
[12:03:02] <Tom_itx> mine was working for a while but quit
[12:03:03] <N1njaneer> I've used the AVRMKII ISPs for years - they're great but Atmel has discontinued them since the ATMEL-ICE replaces all the functionality for the same cost.
[12:04:33] <skroon> N1njaneer: yeah which really sucks they discontinued them, because the ATMEL-ICE does not work on OSX :(
[12:04:34] <N1njaneer> skroon: Segger makes the JLink, which is then rebranded by countless other vendors but locked to their parts. For instance, the SAM ICE from Atmel is a rebranded JLink that is restricted to work only with Atmel ARM parts. I have a JLink here which is an ARM platform device which will talk to any ARM via JTAG or SWD but it's $700 USD since it covers the whole platform.
[12:05:02] <N1njaneer> skroon: At least with the Atmel ISP there are many fine clones out there, such as TomITX's which I've heard only good things about :)
[12:05:19] <skroon> N1njaneer: cool, I really want to learn all about these debugging tools :-)
[12:05:25] <N1njaneer> skroon: I imagine better support will come for the ATMEL-ICE in the future especially because of hoe they implemented it.
[12:05:51] <skroon> N1njaneer: you mean, they implemented it in a way to support most boards via firmware updates later?
[12:06:27] <skroon> N1njaneer: the problem I was facing was, "avrdude" not being supported on OSX when using the ATMEL-ICE, it had something todo with OSX not implemented usb via libusb, but some newer protocol... cant' remember the specifics
[12:06:31] <N1njaneer> skroon: If you have anything which is Segger-based, you can download the suite of tools from Segger and generally use all of them. There's a memory dump/view tool that's very handy, because with ARM everything is memory mapped, so in many cases you can just attach straight to the device, dump the memory, then diddle some bits directly and see GPIO's wiggle and such to confirm the device is working.
[12:06:46] <skroon> N1njaneer: segger also works on OSX?
[12:08:00] <N1njaneer> skroon: Yes, Segger is Windows / OSX / Linux
[12:08:04] <skroon> N1njaneer: awesome! :)
[12:08:05] <N1njaneer> https://www.segger.com/jlink-debug-probes.html
[12:08:25] <skroon> N1njaneer: so this should work with my ATMEL-ICE then right?
[12:08:32] <N1njaneer> The Atmel ICE will do all Atmel ARM devices and is very inexpensive. The JTAGICE3 *may* be a segger core as well.
[12:08:38] <skroon> w00t :-)
[12:08:52] <skroon> kick ass... gonna try it out right away
[12:09:38] <N1njaneer> skroon: Let me see if the ATMEL-ICE shows up as a Segger or not. It may not work for AVR, though, which is kind of it's own thing. Honestly, though, if you are just getting in to this stuff you may want to look at some of the ARM solutions Atmel has. Less expensive than many AVR devices and a magnitude or more power easily.
[12:10:30] <skroon> N1njaneer: yeah indeed, i'm currently in that position... first I didn't want to move to ARM yet, because I was scared about that it might be complexer, with the tool chain support and all in OSX
[12:10:31] <RattusRattus> Tekkkz: ok back
[12:10:49] <RattusRattus> want to keep this in here or move out of the way to PM?
[12:11:00] <N1njaneer> Yeah, ATMEL-ICE does not show up as a SEGGER device - I think Atmel did their own thing, which is possibly why it's so inexpensive: no licensing fees.
[12:11:12] <Tekkkz> RattusRattus: okaay, nice, i did everything like at the source you send, still dont work
[12:11:14] <Tekkkz> okay
[12:11:25] <Tekkkz> move to pm
[12:12:09] <skroon> N1njaneer: ah bummer
[12:12:27] <skroon> N1njaneer: that's too bad
[12:12:41] <N1njaneer> skroon: Toolchain support is always tricky. I have run the gamut of them and have done ARM under probably four toolchains now. Atmel Studio is honestly hands-down something that will spoil you, as it's completely free. Your closest alternatives would be IAR Workbench which is about $5K and sucks a LOT, or Keil (very good!) for about $700/year for Atmel, $3K perpetual, or 32K-limited free version.
[12:12:43] <Tom_itx> anybody using FLIP under win7?
[12:12:55] <Tom_itx> some of the dll's aren't found..
[12:13:25] <N1njaneer> Tom_itx: Re cameras -- directly connecting to them, all Foscam stuff. AMAZING quality for the cost -- sub $100 for pan-tilt 720p with all sorts of built-in management and features.
[12:13:35] <N1njaneer> Tom_itx: I haven't had any problems with FLIP under Win7
[12:13:49] <Tom_itx> 64 or 32 bit?
[12:13:55] <Tom_itx> i'm running 32bit
[12:13:55] <N1njaneer> Tox: All 64x
[12:13:56] <skroon> N1njaneer: Ideally, but maybe I shoudl give up on this, I want to keep developing onder Linux/OSX with GCC and my favorite editor VIM :)
[12:14:09] <Tom_itx> studio worked ok
[12:15:07] <N1njaneer> skroon: Atmel Studio wraps gcc on the front end and adds a huge amount of convenience being a rich and well-established editor, plus all of the project and ASF support. It's not to be underestimated how useful it is. It also makes getting started with ARM extremely painless, compared to having to do all of it manually under gcc without the overlay.
[12:15:57] <uskerine> so I have used the clock prescaler (CLKPR) to divide system clock (external 16MHz clock) by 2, so I effectively get 8MHz
[12:16:04] <N1njaneer> skroon: I *have* run Eclipse on top of gcc as well. It's a decent editor and arguable a bit better than IAR Workbench, but.... I really hate Eclipse for a whole list of reasons. It's also slow as balls for a lot of large compiles, and will just decide to do completely random stuff and stop working for no reason.
[12:16:14] <uskerine> does that mean that the AVR is working within spec limits for 3.4V?
[12:16:17] <uskerine> 3.3V
[12:16:42] <Tom_itx> atlibusbdfu.dll not found
[12:16:57] <skroon> N1njaneer: hmmm right, I was afraid I would end up in this situation :) thinking more and more about AVR Studio
[12:17:05] <uskerine> (ATmega328P datasheet says: 0 - 4MHz@1.8 - 5.5V, 0 - 10MHz@2.7 - 5.5.V, 0 - 20MHz @ 4.5 - 5.5V
[12:17:27] <skroon> N1njaneer: however, when I start a project with AVR Studio, does it generate a makefile so I would still be able to compile on other platforms, like OSX and Linux?
[12:17:43] <N1njaneer> Honestly the convenience of AVR Studio (especially if on a budget!) is absolutely worth "suffering" Windows for, for those of the non-Windows persuasion.
[12:18:17] <N1njaneer> skroon: Yep, but it does all of that behind the scenes for you. But all the code is 100% portable since it's all just the gcc cross-compiler.
[12:18:27] <skroon> N1njaneer: well, the worst thing is missing "vim"... I'm a 15+ year vim user, so it's hard to work inside another text editor
[12:18:58] <N1njaneer> skroon: Yes, but code-sensitive contexts and being able to project arrange and things is well worth ditching vim purity for.
[12:18:59] <skroon> N1njaneer: but I mean, I can just clone my project repository on my Mac for exmaple and run "make" from the project root?
[12:19:18] <skroon> N1njaneer: yeah you might be right indeed
[12:19:21] <N1njaneer> skroon: In theory yes, it may need some tweaking and management.
[12:19:37] <skroon> N1njaneer: also indeed this ASF, i've heard good stuff about it
[12:19:54] <skroon> N1njaneer: for example, I wanted interrupt driven UART... afaik this is already available in ASF right?
[12:20:12] <N1njaneer> skroon: vim and pure text-editors are fine for projects that are a couple files. When you get in to projects with hundreds and hundreds of files, the ability to organize virtual folder structures and similar it's a godsend for productivity.
[12:20:43] <skroon> N1njaneer: i'm wondering if I can do some "hybrid" approach, if you know what I mean... where i'm able to work most of the time in vim and osx... and switch to AVR Studio when needed
[12:21:16] <N1njaneer> skroon: ASF is progressing nicely, and in theory yes -- most times you can yank in the serial port with the ASF Wizard and just use a couple commands to set things up for the serial port, provided it offers the functionality you need. If it DOES, great, use it and move on. If it DOESN'T, at least you have an excellent leg-up since all the source code is there.
[12:22:12] <N1njaneer> skroon: For instance, right now I have new hardware we design that has an SDCard and USB on a SAM4E16. It was absolutely trivial to get FAT32 support for reading and writing the SDCard from the ARM, as well as mounting the SDCard as a mass storage device via USB.
[12:22:42] <skroon> N1njaneer: right, I see
[12:22:53] <skroon> N1njaneer: btw, do you use an RTOS on such projects?
[12:23:21] <N1njaneer> skroon: The rub is that something is preventing me from getting more than about 1MB/sec transfers on the card, and it's a software thing somewhere in the ASF. I have Atmel looking in to this for me before I spend/waste a bunch of time tracking down where the problem is. But again, the thing works 100% but is just slower than it should be, so it's a great starting point regardless.
[12:23:56] <skroon> N1njaneer: how do you get Atmel to look into such a thing ? :)
[12:23:56] <N1njaneer> skroon: Depends on the complexity of the project. I have never used an RTOS on an AVR, but I have on occasion used it wth ARM.
[12:24:31] <N1njaneer> skroon: I fire off an email to my local Atmel FAE and he fires it up the chain. I generally get a response within a day or so from the Norway office depending on how busy they are.
[12:24:32] <skroon> N1njaneer: I thought on ARM you always needed a RTOS, which ofcourse is non-sense :-) but never worked with ARM so it always felt like it was "too far away" for my current knowledge
[12:24:52] <N1njaneer> skroon: Or if it's easier issues my FAE is familiar with he just answers directly.
[12:25:02] <N1njaneer> (FAE = Field Applications Engineer)
[12:25:06] <skroon> N1njaneer: and you have like special contract with your local Atmel FAE, or it's standard practice?
[12:25:18] <N1njaneer> Nope, FAE support is completely free from Atmel.
[12:25:36] <skroon> N1njaneer: cool, never heard of Atmel FAE's in my country before
[12:25:39] <N1njaneer> It helps if you are a company, but they will absolutely support individual users very well if your requests are reasonable :)
[12:25:59] <skroon> N1njaneer: company here, so that should be fine then
[12:26:06] <skroon> gc
[12:26:13] <N1njaneer> skroon: Look on the atmel.com website and see who the Atmel representative is for your region, then make friends.
[12:26:22] <skroon> good point :)
[12:27:15] <N1njaneer> skroon: In the US they are very easy to find. I started basically as more a hobbiest but then as things moved in to the current situation with us as a company, the support has only grown. But Atmel is really great in that they give you world class support even if you're a very small company. Not many placed will do that.
[12:27:30] <N1njaneer> +places
[12:27:51] <N1njaneer> Atmel will even do failure analysis on silicon for you no charge
[12:28:20] <skroon> N1njaneer: sounds like a made a godo choice sticking with Atmel :)
[12:28:45] <N1njaneer> We've had a few parts over the years which have gone belly-up and have done weird things that are not related to a bad design, where swapping the part out fixed the problem. They're always interested to look at those instances.
[12:29:13] <N1njaneer> skroon: I've been using Atmel for nearly 15 years now and I have zero want to go with anyone else's parts in the same class. :)
[12:29:29] <skroon> N1njaneer: good to hear :-)
[12:29:46] <N1njaneer> skroon: You will simply not find a better official toolchain and better support, especially if you don't have $5K to blow on Keil or similar.
[12:30:51] <N1njaneer> Believe me, I've looked, and I've had the (mis)pleasure of suffering things like IAR Workbench on clients' dimes because that's what they wanted us to develop on. I am REALLY glad I didn't drop money on IAR Workbench else I'd be screaming bloody murder right now. :)
[12:31:32] <N1njaneer> Dean (who wrote LUFA) probably put it best when he said "I wisj I could pay a licensing fee to never have to use IAR Workbench again."
[12:32:43] <N1njaneer> Aww damn, I should have brought the laptop in today - could have streamed from the microscope while putting this new board together :)
[12:36:01] <twnqx> i agree, nothings beats emacs + git :)
[12:36:34] <twnqx> the last commercial IDE i liked... was borland on DOS :X
[12:37:09] <N1njaneer> LOL I have that on 3.5"s still
[12:37:53] <N1njaneer> I still use Borland (now Embarcadero) on Windows for quick application development. It has a LOT of strength, but unfortunatly a lot of pitfalls as well. But it's still very useful.
[12:38:13] <twnqx> i tried delphi once
[12:38:26] <N1njaneer> Delphi needs to die already.
[12:38:27] <twnqx> it's what made me hate OOP with burning passion
[12:38:37] <twnqx> i have neer recovered from that
[12:38:43] <N1njaneer> Delphi's OOP is a complete joke.
[12:45:04] <uskerine> If I am using the FTDI USB to Serial converter to program the ATMega328P in the Arduino Mini Pro using the Arduino bootloader, can I have a serial port available for communicating with the PC?
[12:47:54] <zerowidth> when you're not using it for programming, yes
[12:49:08] <uskerine> so I just write code to control the serial port normally?
[12:49:22] <uskerine> how does the uC knows what it is being programmed?
[12:49:26] <uskerine> that*
[12:50:25] <zerowidth> either you pushed the reset button or the serial port itself triggers a reset on the atmega so the bootloader knows that "hey, time to be programmed" versus normal serial comms
[12:52:00] <uskerine> via the DTR pin?
[12:53:11] <uskerine> that's the only "special" pin from the FTDI USB to serial board
[12:53:17] <zerowidth> far as i know, yeah
[12:53:33] <uskerine> is there any recommended library or utils to program the UART?
[12:57:32] <zerowidth> uskerine: beyond http://arduino.cc/en/Reference/Serial ?
[12:58:20] <uskerine> well I am using Atmel Studio, not Arduino -just the hardware-
[12:58:35] <uskerine> as far as I have learnt the ATmega328P has just one USART
[12:58:58] <zerowidth> oh, you're just using the bootloader, not the libs?
[12:59:02] <uskerine> right
[12:59:08] <N1njaneer> uskerine: Yes, zerowidth is correct on all that above. Was getting food :)
[12:59:31] <zerowidth> gotcha. yeah, serial stuff you're kinda on your own... google and try stuff out, i don't think there's a canonical library
[12:59:54] <uskerine> ok thanks, I will try something like this then: http://jamesgregson.blogspot.com.es/2012/07/sample-code-for-atmega328p-serial.html plus the datasheet
[12:59:57] <N1njaneer> uskerine: Honestly the UART is so simple on the AVR you can pretty much just do it directly with the registers. Takes about 3 lines to get it up.
[13:00:39] <uskerine> I'll do that way, I just was happy to find util/delay.h and thought there might be other simple stuff outthere
[13:00:49] <N1njaneer> uskerine: The rest is more like convenience functions for dumping out strings, bytes, reading data, etc. I've written ISR-driven FIFO wrappers for the TX/RX stages in the past which is nice if you can't block your application for transactions.
[13:00:49] <uskerine> it is a pitty that the 328P has only one UART :(
[13:01:15] <LeoNerd> Yah; it's something of a shame
[13:01:20] <LeoNerd> I've occasoinally wanted two
[13:01:41] <N1njaneer> The 164 series (and several others) have dual UARTs. ATMEGA2560 and friends have four.
[13:01:46] <LeoNerd> The 2560 of cours... what he said
[13:02:22] <N1njaneer> The ARM devices are nice because you can actually steer peripherals to different sets of pins in the routing fabric.
[13:02:23] <uskerine> in terms of included peripherals I start to think that c8051 is slightly better than AVR
[13:02:39] <N1njaneer> Nordic's CORTEX implementation is really fantastic in that ANY peripheral is routable to ANY pin on the device.
[13:03:24] <LeoNerd> Yah
[13:03:25] <N1njaneer> uskerine: There's several dozen families of AVR devices - find the one that has the peripherals you need.
[13:03:30] <uskerine> I am following an online course with ARM (from TI), they are quite nice, but for this 8bit should be enough
[13:03:33] <LeoNerd> Just like the ARMs and the PIC 18s and... just about everything that isn't AVR
[13:08:20] <N1njaneer> Mmm, about 150 parts per board on these I have to assemble today. Not too bad. :D
[13:08:32] <N1njaneer> It's a good day for a mindless task!
[15:04:29] <linus__> hi!
[15:05:18] <linus__> I've been trying to send a PWM signal from digital pin 3 for a while now, and can't get it to work.
[15:05:51] <linus__> I've succeded in sending from other pins. I can't find the correct channel to use. I'm using Arduino Due
[15:06:37] <specing> ardweenies are over at #arduino
[15:07:04] <linus__> I was just told to go here, I'm using ASF ^^
[15:07:22] <specing> I don't think anyone here uses ASF
[15:08:43] <linus__> oh
[15:08:45] <specing> isn't the due ARM?
[15:09:42] <linus__> yes
[15:10:16] <specing> does it hardfault?
[15:10:25] <specing> did you enable periph clocks?
[15:11:41] <linus__> yep, I've managed to make it work on the other pins
[15:11:57] <linus__> the only problem is that I can't find which channel that should be activated for that pin (D3)
[15:12:20] <specing> datasheet doesen't tell you?
[15:13:03] <linus__> not really. It tells me the channels for most of the pins. But not pin 3 or 11. Which I need to use for my shield
[15:14:43] <specing> maybe it doesen't support that?
[15:15:38] <linus__> I'm starting to suspect it.. Been trying to get it to work for 10 hours. Which is a problem since I need to use both the shield and ARduino Due for this school project
[15:29:47] <uskerine> http://www.atmel.com/images/doc0941.pdf
[15:30:03] <uskerine> An option for a second UART in a ATmega328P
[15:30:46] <LeoNerd> Eh.. I'd only really consider software-serial for output
[15:30:57] <LeoNerd> Kindof OK as a last-ditch effort if you just want to write a debugging monologue
[15:31:49] <uskerine> why not for input?
[15:32:31] <uskerine> because is half duplex you mean?
[15:38:23] <Fleck> uskerine: USART or RS-232?
[15:38:47] <Fleck> there are some SPI USART chips... like MAX3110E but it's RS-232 signal level converter also
[15:38:57] <Fleck> maybe there are even more like that
[15:41:05] <LeoNerd> I might be tempted to use softserial for input in cases where I would write something decent, that accounted for timing shifts and so on
[15:41:22] <LeoNerd> But generally it's a lot of effort as compared eg. just using an SPI-attached one
[16:59:57] <Lambda_Aurigae> http://imgur.com/Ni57MkU
[17:00:04] <Lambda_Aurigae> xerox meets heathkit!
[17:00:08] <Tekkkz> Hey Lambda_Aurigae :D
[17:00:42] <Lambda_Aurigae> http://imgur.com/plIySWE Here's your problem. It was unplugged!
[17:00:44] <Tekkkz> btw, didnt solved my problem with bootloader yet -> its not my bootloader, its my firmware, but dont find the mistake
[17:01:05] <Tekkkz> hshshs
[17:01:09] <Tekkkz> *hahaha
[17:02:21] <Lambda_Aurigae> those are from my office. workmate doing a total refurb of a xerox 7225 copier.
[17:02:57] <Lambda_Aurigae> tear down to the frame, clean, and rebuild.
[17:03:02] <Tekkkz> lol
[17:04:19] <Tekkkz> Lambda_Aurigae: you remember my problem with the isr?
[17:04:57] <Lambda_Aurigae> vaguely.
[17:05:05] <Lambda_Aurigae> I am in no condition to work on anything right now though.
[17:05:14] <Tekkkz> okay thats not good ;(
[17:05:15] <Lambda_Aurigae> just got done with 8 hours of work and have a sinus headache.
[17:05:23] <Tekkkz> haha
[17:05:27] <Tekkkz> so you can work ;)
[17:05:36] <Lambda_Aurigae> yup...usually 5 to 7 days a week.
[17:05:56] <Lambda_Aurigae> wednesday you happened to catch me at home sick...I should have stayed home yesterday and today but I had stuff to do.
[17:06:20] <Tekkkz> ok, thats my code: http://forums.adafruit.com/download/file.php?id=23990 => the problem is, that my timer isnt working correctly, it ignores the OCR0A value and counts up to 0xff, all the time, you know what i did wrong? its jsut 10 lines of code
[17:07:16] <Lambda_Aurigae> I do not know. I would have to dig through the datasheet and read the timer stuff.
[17:07:23] <Lambda_Aurigae> and I can barely focus on the computer screen.
[17:07:54] <Tekkkz> can you help me tomorow?
[19:50:16] <Tom_itx> having trouble with FLIP, so i downloaded 3.4.7 which is 7/8 compatible. installed it and get the same error... ATLibUSBDFU.dll not found but it's in the program files///FLIP/Bin directory
[19:53:27] <Tom_itx> no errors appear in device manager
[20:18:56] <Tom_itx> atmel's site indicated it works under 7/8 however the readme indicates differently
[20:51:58] <Tom_itx> abcminiuser
[20:52:06] <Tom_itx> just the guy i'm looking for...
[20:52:42] <Tom_itx> i just installed win7 and installed FLIP. getting an error.. unable to find ATLibUSBDFU.dll
[20:52:48] <Tom_itx> but it's in the bin directory...
[20:53:00] <Tom_itx> downloaded the latest flip.. says it's compatible with 7
[20:53:34] <Tom_itx> any ideas?
[20:53:52] <Flipp_> tom_itx: sounds like an architecture mismatch
[20:54:01] <Flipp_> that could be a 32 bit dll and you're on 64
[20:54:03] <Flipp_> or vice-versa
[20:54:08] <Tom_itx> i'm on 32
[20:54:20] <Tom_itx> the installer should know that
[20:54:32] <Flipp_> could also try throwing it in /windows/system32
[20:54:39] <Tom_itx> been there done that
[20:55:51] <Tom_itx> i can use flip on my old pc but it would be nice to be able to use it on newer hardware
[20:59:04] <Tom_itx> the studio drivers work fine
[20:59:46] * Xark has used flip on Win7-64 without trouble... 10 to 1 it is a Java "issue".
[21:00:10] <Tom_itx> i won't deny anything at this point
[21:00:43] <Tom_itx> i had 64 installed and had to revert to 32 because none of my programs would install
[21:00:55] <Tom_itx> i got some pretty old crap...
[21:55:39] * Casper wonders
[21:55:52] <Casper> Tom_itx: have you tried to run the program as administrator?
[21:58:47] <Tom_itx> and how do i do that?
[21:58:57] <Tom_itx> there is one user set up and it is admin
[21:59:21] <Casper> right click, run as administrator
[21:59:31] <Tom_itx> i'll try it
[22:00:52] <Tom_itx> same error
[22:01:05] <Casper> :(
[22:01:11] <Tom_itx> atlibusbdfu.dll not found
[22:01:16] <Tom_itx> it _is_ there
[22:01:40] <Tom_itx> also: could not load dynamic library
[22:01:46] <Tom_itx> same thing ...
[22:01:51] <Casper> you know that UAC prompt? a software need to trigger it... some don't do it automagically... like some Dell bios upgrader...
[22:02:01] <Tom_itx> no
[22:02:15] <Casper> like when you install a program...
[22:02:17] <Tom_itx> explain
[22:03:10] <Casper> there is a prompt that ask you if you want to increase the privileges... but you may not have realised that it is one...
[22:04:20] <Casper> but since it do not work, it's not that
[22:08:18] <Tom_itx> another thing i noticed is 'documents and settings' is locked
[22:09:36] <Casper> it's normal, and do not really exists
[22:09:41] <Tom_itx> won't let me change permissions eitehr
[22:09:42] <Casper> the new one is Users
[22:10:43] <Tom_itx> well it won't let me look at some of that either
[22:10:58] <Tom_itx> to see if there is an entry for FLIP there i should get rid of
[22:28:13] <Tom_itx> well if you think of anything to try...
[22:29:02] <Casper> what is flip?
[22:29:19] <Tom_itx> same as DFU
[22:29:26] <Tom_itx> downloader for bootloader chips
[22:29:54] <Tom_itx> like atmega32U2 etc
[22:30:36] <Casper> ok
[22:32:29] <Casper> when you connected the avr, a new hardware found prompt appeared right?
[22:33:00] <Tom_itx> yeah but it installed the driver for studio (jungo)
[22:33:09] <Tom_itx> oh that gives me an idea...
[22:33:18] <Casper> this post say to use the driver in flip
[22:33:22] <Casper> then it should work
[22:33:34] <Tom_itx> i know
[22:33:42] <Tom_itx> i'm aware about the 2 different drivers
[22:34:03] <Tom_itx> i can't test it just yet.. installing studio
[22:34:11] <Tom_itx> once it's done i'll try something
[23:32:49] <Tom_itx> it doesn't seem to like any of the libusb drivers
[23:35:38] <Casper> :(
[23:39:56] <Tom_itx> studio 6 latest usb drivers don't work either
[23:39:59] <Tom_itx> 4 worked fine
[23:40:18] <Casper> hmm
[23:40:37] <Casper> what I wonder is... maybe your windows is set up to require signed drivers?
[23:41:12] <Tom_itx> i told it to trust jungo
[23:43:36] <Tom_itx> gawd, even on this quad core studio 6 takes forever to load
[23:45:31] <Tom_itx> nope even after a reboot it doesn't work