#avr | Logs for 2014-04-04

Back
[02:56:03] <anton02> what do you think of ultrasonic arduino modules as a means of obstacle avoidance for an automated car? Would you prefer an infrared sensor?
[02:59:03] <megal0maniac_afk> anton02: infrared is smaller, more accurate, more expensive and the range isn't as good. But ultrasonics seem to work pretty well from my experience. Just don't know if they'll pick up everything
[03:00:38] <anton02> megal0maniac_afk: what about lighting conditions? do the infrared sensors require certain lighting to work properly?
[03:01:17] <megal0maniac_afk> I don't know, only used ultrasonics
[04:08:24] <whirm> hi, can anyone point me to a guide on how to flash a DFU bootloader into a SparkFun Pro Mini? (atmega32u4) I've been googling and making several attempts with LUFA and flashing it using an arduino as ISP but it doesn't seem to boot (I can flash the Caterina firmware just fine tough)
[04:17:25] <demultiplexer> good morning and/or other time of day
[04:43:34] <tavish_> hi, can anyone familiar with avr asm tell me what wdt_enable is doing? http://paste.ubuntu.com/7202443/ (i need it in interrupt only mode)
[04:47:27] <jacekowski> just by name i can tell you it's enabling the watchdog
[04:48:59] <tavish_> jacekowski: really? Though I meant to ask whether it enables it in interrupt mode or reset mode
[04:54:04] <jacekowski> after checking in the manual i can say, there is no interrupt mode
[04:54:09] <jacekowski> on atmega8
[04:54:14] <jacekowski> i'm not sure about other
[04:54:24] <jacekowski> so it's just going to reset
[04:54:55] <jacekowski> but as far as i know, it's like that on all AVRs, as in, reset only
[04:55:13] <jacekowski> you could use timers for watchdog like thing
[04:55:24] <tavish_> atmega32u4 has wdt interrupt or reset mode
[04:59:04] <demultiplexer> is anybody here who can help me with a bit of a niche LUFA question?
[05:03:48] <jacekowski> tavish_: it's not touching WDIE bits
[05:05:57] <tavish_> jacekowski: is it setting WDE bit?
[05:06:06] <jacekowski> tavish_: basically what happens (other than sreg save/restore) is, _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE)
[05:06:27] <tavish_> oh, ok thanks. so its reset mode
[05:06:42] <jacekowski> and then, _WD_CONTROL_REG= (uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDE) | (value & 0x07)) )
[05:07:15] <jacekowski> so WDE is set to 1
[05:10:20] <tavish_> jacekowski: thanks, i'll just change WDE to WDIE in this code
[05:12:57] <jacekowski> bad idea
[05:13:04] <jacekowski> i wouldn't change anything in libc code
[05:13:07] <tavish_> jacekowski: i mean in a copy
[05:13:17] <jacekowski> ok
[05:13:24] <tavish_> wdt_enable_intonly()
[09:26:18] <megal0maniac_afk> Speaking of gas soldering irons...
[09:26:33] <megal0maniac_afk> I'm going to meet a client at macdonalds to fix a cable for them :P
[09:26:48] <megal0maniac_afk> Because it's the most convenient mid-way point
[09:28:42] <Lambda_Aurigae> fix a cable, harden the arteries...it's all good.
[09:29:29] <megal0maniac_afk> Lambda_Aurigae: Not sure whether they have plug points in the eating area, so I'm taking an inverter with just in case
[09:29:37] <megal0maniac_afk> So might fix it in the parking lot XD
[09:30:18] <Lambda_Aurigae> usually they don't have power in the seating area.
[09:31:01] <megal0maniac_afk> Lambda_Aurigae: This is South Africa, so I'm not sure
[09:31:11] <megal0maniac_afk> Gas would have been nice :P
[09:31:31] <Lambda_Aurigae> aahh.
[09:33:06] <Lambda_Aurigae> for fixing cables, even a battery powered one would be sufficient.
[09:41:00] <megal0maniac_afk> True. But then what happens when I have to solder something slightly bigger? :P
[09:41:44] <Lambda_Aurigae> various tools for various jobs.
[09:46:23] <anton02> What does it mean in this pdf where he says "send a second or so" - 1, test communications Send: AT (returns OK, send a second or so) Return: OK http://topelectronics.com.au/image-eb/mo/JY-MCU-HC-06%20BT_Module.pdf
[09:48:56] <demultiplexer> that does *not* look like a proper datasheet or protocol :P
[09:48:58] <Lambda_Aurigae> what page anton02 ?
[09:49:12] <anton02> top of page 5
[09:50:00] <demultiplexer> probably something lost in translation
[09:50:06] <demultiplexer> no way to know unless you try it I guess
[09:50:09] <Lambda_Aurigae> yeah.
[09:50:14] <Lambda_Aurigae> it looks like a bad translation.
[09:50:28] <Lambda_Aurigae> I would say, send it and wait at least one second, perhaps two seconds.
[09:50:35] <anton02> i see
[09:51:08] <demultiplexer> if this is actually an HC-06, you can use any other hc-06 datasheet
[09:51:21] <demultiplexer> this is pretty poor to work from
[09:51:56] <demultiplexer> e.g. http://makezineblog.files.wordpress.com/2014/03/hc_hc-05-user-instructions-bluetooth.pdf
[09:52:00] <demultiplexer> (first google result)
[09:54:04] <demultiplexer> okay, that is probably not the best example ever as it's also a piss-poor translation, but at least it has at least ten times as much information
[09:57:15] <anton02> for some reason my atmega64 program is stalling at USART_Receive(void). HC-06 mustnt be sending anything back. I wonder if I need to set the data directional register for the serial port to be an input (but isn't this the default?)
[09:58:02] <Lambda_Aurigae> anton02, is that usart_receive waiting for a \n perhaps?
[09:58:16] <megal0maniac_afk> anton02: It is the default, but it's still good practice to set it explicitly
[09:58:29] <Lambda_Aurigae> and from what was said before, I bet it's not sending \n
[10:03:30] <anton02> Lambda_Aurigae: nah, it says in the datasheet that \n isn't required
[10:03:44] <Lambda_Aurigae> anton02, exactly..
[10:04:03] <Lambda_Aurigae> and I'm betting the chip doesn't send a \n at the end of a response.
[10:04:17] <Lambda_Aurigae> and your usart_receive is likely waiting for that \n
[10:05:28] <anton02> Lambda_Aurigae: so what should I do?
[10:05:41] <Lambda_Aurigae> dunno...
[10:05:50] <Lambda_Aurigae> I'm 3/4 wasted on pain killers at the moment.
[10:06:24] <anton02> vico?
[10:06:56] <Lambda_Aurigae> tramadol actually.
[10:07:15] <Lambda_Aurigae> vicodin is like candy.
[10:07:43] <anton02> must be pretty fun
[10:08:59] <Lambda_Aurigae> not really.
[10:09:03] <Lambda_Aurigae> am in lots of pain.
[10:09:23] <Lambda_Aurigae> but, I would use a byte by byte receive from the usart myself.
[10:09:55] <megal0maniac_afk> That reminds me, is theBear still alive?
[10:10:06] <Lambda_Aurigae> haven't seen him in a while.
[10:10:56] <Lambda_Aurigae> I just had a cardiac cath yesterday.
[10:11:00] <theBear> nah man
[10:11:04] <Lambda_Aurigae> so my groin is in pain.
[10:11:10] <Lambda_Aurigae> they went in through my femoral artery.
[10:11:19] <anton02> yikes
[10:11:46] <Lambda_Aurigae> tried to go in through my wrist but couldn't get past my shoulder.
[10:11:52] <theBear> i been a bit quiet and between computers and stuff, but right now i'm only slightly quiet
[10:12:20] <theBear> and i ain't even gonna mention medical stuff right now, serious as it may be, it'd sound trivial right now :)
[10:12:21] <megal0maniac_afk> theBear: Nonsense. You've been very quiet
[10:12:35] <theBear> ok, very quiet, haven't had much to say
[10:12:59] <megal0maniac_afk> Okay! Off to macdonalds
[10:13:07] <Lambda_Aurigae> mmm...mcbarfles!
[10:13:18] <Lambda_Aurigae> although, I prefer hardees.
[10:13:34] <Lambda_Aurigae> at least they didn't find any blockages in my heart..
[10:14:35] <anton02> why did they check you?
[10:14:56] <Lambda_Aurigae> am having breathing problems.
[10:15:03] <Lambda_Aurigae> they thought it was heart related.
[10:15:12] <Lambda_Aurigae> didn't find anything yet.
[10:15:26] <Lambda_Aurigae> a few more tests yet though...this one was the worst I think.
[10:15:41] <anton02> you smoke?
[10:15:48] <Lambda_Aurigae> nope
[10:15:52] <Lambda_Aurigae> don't smoke, don't drink.
[10:15:57] <Lambda_Aurigae> have diabetes though.
[10:24:07] <spybert> uh oh
[11:05:14] <megal0maniac_afk> Success!
[11:05:55] <megal0maniac_afk> The inverter wouldn't work for the soldering iron. Think it makes a square wave. So I prepped the wires in the car and ran into MacDs to finish the job (they do have plugs)
[11:16:13] <Lambda_Aurigae> kewl.
[11:16:40] <megal0maniac_afk> Got some strange looks
[17:29:38] <hotch> Has anyone here worked with the nrf24l01/+ … on a custom PCB? The thing looks ugly, but I haven’t found any schematics for it with AVRs..
[17:36:41] <Lambda_Aurigae> hotch, only used them on the little adapter boards from sparkfun.
[17:37:24] <hotch> Gotcha Lambda_Aurigae - the ‘net is plastered with these “modules” everywhere, but cannot seem to find an eagle schematic or pcb
[17:38:22] <Lambda_Aurigae> http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Wireless/Nordic/nRF24L01-Chip-v13.zip
[17:39:47] <hotch> Awesome, thx Lambda_Aurigae
[17:40:03] <Lambda_Aurigae> https://www.sparkfun.com/products/691
[17:40:08] <Lambda_Aurigae> as I said, sparkfun.
[17:40:55] <hotch> Yeah. I didn’t see the .brd
[17:41:02] <Lambda_Aurigae> it's in the zip file.
[17:41:09] <hotch> I saw, thx man :)
[17:41:41] <Lambda_Aurigae> says right on the page,,,Eagle Files...right under Schematic.
[17:48:02] <hotch> No need to be a dick, I was on the + / external antenna product page on sparkfun, not the wired.
[19:05:59] <anton02> what do you think of using a stepper motor as the drive motor for a car so that you can mount a motor to the rear right and left wheels and not only use them to drive the car forward but also create a delta v between each wheel to corner?
[19:14:34] <Casper> bad idea
[19:14:44] <Casper> stepper can not be overloaded
[19:15:16] <Casper> however DC or AC motors can be a good idea
[19:15:34] <Casper> and actually, they already do so for some electric car
[19:20:34] <clixxIO> morning - anybody here good with AVR assembler ?
[19:21:06] <clixxIO> [rxdelay2] "I" (RXDELAY2) : "r0","r18","r19","r28");
[19:21:41] <clixxIO> I'm getting a compile error: compiler error: uart_tiny.c:92:1: error: r28 cannot be used in asm here
[19:22:34] <anton02> Casper: what do you mean by overloaded? What happens if you do?
[19:24:20] <clixxIO> https://github.com/clixx-io/clixx.io/blob/master/eventframework/core_AVR/uart_tiny.c
[19:24:31] <clixxIO> lines 88, any idea's ?
[19:55:47] <Casper> steppers skip step if you apply too much torque on it
[19:55:52] <Casper> as if the load is too high
[20:07:13] <anton02> Casper: well, assuming you have that one issue under control, are there any other issues?
[20:08:35] <Casper> inneficiency, rought and noisy
[20:09:31] <anton02> noise isn't an issue. Though being rough and inefficient may be. It depends on the severity.
[20:10:27] <Casper> wheel locking in case of controller failure
[20:11:11] <anton02> that's alright
[20:12:05] <anton02> inefficiency is probably the big one. I wonder just how inefficient they are.
[20:13:22] <anton02> My USART program is stalling at usart_receive(). My bluetooth module doesn't send '\n' so i wonder if that's why. Maybe the atmel is waiting for '\n'. If so, i wonder if theres a way to enable bit by bit transmission.
[20:29:35] <clixxIO> anton02: what software are you using?
[20:33:58] <anton02> clixxIO: atmel studio 6.2
[20:34:41] <clixxIO> I meant the code to drive the serial port
[20:34:56] <anton02> clixxIO: you want the code?
[20:35:27] <clixxIO> not necessarily, but just wondering what you are using
[20:35:52] <clixxIO> I'm just modifying my AVR to talk to bluetooth as well
[20:36:02] <anton02> clixxIO: http://codepad.org/9CNK4k0i
[20:36:03] <Casper> anton02: check out the Peter fleury's uart library for avr
[20:39:15] <clixxIO> oh that's nice code
[20:40:15] <anton02> clixxIO: can you link me to it, I can't find it
[20:41:55] <clixxIO> I have lots of links
[20:41:57] <clixxIO> https://github.com/rambo/TinyWire/tree/master/TinyWireS
[20:42:46] <clixxIO> https://code.google.com/p/picoboot/source/browse/#svn%2Ftrunk
[20:47:49] <anton02> Naw
[20:49:22] <clixxIO> https://code.google.com/p/picoboot/source/browse/trunk/SerialUSI.S
[20:49:30] <clixxIO> why Naw?
[20:50:15] <anton02> that is for pico
[20:51:55] <anton02> this is better: http://homepage.hispeed.ch/peterfleury/group__pfleury__uart.html
[20:53:14] <clixxIO> I can't find the exact code for that
[20:59:31] <clixxIO> oh, I found it - http://homepage.hispeed.ch/peterfleury/uartlibrary.zip
[20:59:41] <clixxIO> so that's the best one ?
[21:05:20] <clixxIO> oh well - it did compile easily with no errors
[21:15:18] <clixxIO> but when I change to Attiny85, I get "#error "no UART definition for MCU available"
[21:17:15] <clixxIO> if I change a few things, lots of compile errors like : uart.c:273:12: error: ‘UCSRA’ undeclared (first use in this function)
[21:27:40] <clixxIO> anton02: When I compile that file I get anton02.c:10:14: error: ‘UCSRnA’ undeclared (first use in this function)
[21:27:59] <clixxIO> and many more errors like that
[21:28:39] <clixxIO> I'm doing this : avr-gcc -c -DF_CPU=1000000UL -mmcu=atmega328p anton02.c
[21:34:50] <clixxIO> ok - got that to compile - with avr-gcc -c -DF_CPU=1000000UL -mmcu=atmega328p anton02.c
[21:35:34] <clixxIO> but when it won't compile for Attiny85, anton02.c:10:14: error: ‘UCSR0A’ undeclared (first use in this function)
[21:36:56] <anton02> you named your c file anton02?
[21:37:24] <anton02> it's just a library anyway, don't change anything.
[21:37:36] <anton02> you import that file into your own program
[21:37:44] <anton02> with #include <file.h>
[21:38:09] <anton02> #include <uart.h> to be exact
[21:42:50] <clixxIO> yes the c file was called anton02.c
[21:43:02] <clixxIO> I just located something just now : https://github.com/blalor/avr-softuart
[21:43:23] <clixxIO> when I changed it for attiny85 it compiled fine
[21:45:03] <clixxIO> The first issue was that GCC handles the register definitions slightly differently
[21:45:20] <clixxIO> that's probably why your code didn't work for me first up
[21:45:46] <clixxIO> After I replaced the 'n's with '0's it compiled fine
[21:46:13] <clixxIO> then when I tried to compile for Attiny, that wouldn't work
[21:46:48] <clixxIO> I'm trying to get IoT running on an Attiny85
[21:51:11] <clixxIO> but anton02 thanks for your help