#avr | Logs for 2015-11-14

Back
[00:11:04] <rue_shop3> no I meant how is it defined
[00:12:51] <Xark> http://www.atmel.com/webdoc/AVRLibcReferenceManual/group__avr__sfr_1gaaf6857fa882da35f8685e2001e5c3bbe.html
[00:13:15] <Xark> ... or http://www.nongnu.org/avr-libc/user-manual/group__avr__sfr.html
[00:43:38] -kornbluth.freenode.net:#avr- [freenode-info] help freenode weed out clonebots -- please register your IRC nick and auto-identify: http://freenode.net/faq.shtml#nicksetup
[07:33:22] <anonnumberanon> Is the wire library good for I2C?
[07:33:47] <anonnumberanon> The Arduino library?
[08:15:45] <DKordic> anonnumberanon: Should I care? Datasheet is very good.
[08:19:23] <Lambda_Aurigae> anonnumberanon, wire library is good for massive bloat.
[08:20:10] <LeoNerd> I2C isn't hard to write in a lot smaller code than the Arduino library for the same.
[08:20:15] <LeoNerd> ... but then you can say that about most things Arduino ;)
[08:24:28] <Lambda_Aurigae> just setting a pin with the wire library is like 30 times the size.
[08:29:05] <cehteh> hehe ... as with most arduino libs
[11:49:39] <averowsky> my usbasp few minutes ago stop working, little smoke was visible, so its dead. Does arduino uno can work as a programmer ?
[11:52:08] <Tom_itx> probably
[12:00:52] <cehteh> .. but you better figure out what caused the magic smoke first, else you uno may go up in it as well
[12:16:33] <Tom_itx> no big loss there
[12:17:45] <averowsky> This was connection problem. Im trying to use arduino to upload my program to atmega
[12:19:01] <averowsky> I changed -c flag in avrdude to arduino and -P flag /dev/ttyACM0
[12:19:27] <averowsky> without success..
[12:19:42] <averowsky> it uploads but on atmega on UNO board
[12:20:03] <averowsky> any ideas ?
[12:32:21] <sebus> 18:25:22 <averowsky> first check why you have burned your programmer / buffer in it
[12:32:39] <sebus> has it 74HC125 buffer?
[12:34:58] <averowsky> sebus I dont think so. There is AMS117
[12:35:18] <sebus> = LM1117 3,3V
[12:35:25] <sebus> probaby
[12:35:37] <sebus> my usbasp has a buffer
[12:36:21] <Casper> what kind of connection issue?
[12:38:06] <averowsky> Casper: I think it was not properly connected in usb port
[12:39:07] <averowsky> I dont have any other idea
[12:39:25] <averowsky> but is there any way to use arduino uno as programmer
[12:39:27] <averowsky> ?
[12:53:03] <averowsky> I have also ftdi usb to serial adapter
[12:53:13] <averowsky> maybe something can be done with taht
[12:57:03] <Casper> averowsky: there is some prog that you can flash that can do it
[12:58:03] <averowsky> Casper: can you tell me something more ?
[12:58:11] <averowsky> what program ?
[13:10:37] <DKordic> averowsky: https://www.arduino.cc/en/Tutorial/ArduinoISP
[13:12:59] <averowsky> DKordic: this only explain how to burn bootloader
[13:13:21] <averowsky> I dont have option to select hex
[13:14:25] <averowsky> I know already how to upload my program when atmega is in arduino uno board
[13:14:43] <averowsky> but I would like to do this without putting it inside arduino
[13:15:01] <averowsky> with just connecting cables from arduino to my board
[13:20:08] <cehteh> there are plenty of way how to flash an atmel chip, and once you have a bootloader on it there are some more :D
[13:20:39] <cehteh> usbasb is just a atmega too, basically
[13:21:02] <cehteh> http://www.fischl.de/usbasp/bilder/usbasp_circuit.png
[13:21:32] <cehteh> https://github.com/micronucleus/micronucleus .. should be ported to megas as well :)
[13:25:43] <averowsky> cehteh: but I would have to build programmer
[13:26:59] <cehteh> eh?
[13:27:24] <cehteh> what do you exactly want?
[13:29:48] <averowsky> cehteh: I lost my usbasp and I wanted to use arduino uno as programmer
[13:29:56] <averowsky> nothing more
[13:30:04] <DKordic> averowsky: What it the problem? You have an Arduino to be used as ISP. AVR to be programmed is on breadboard, right?
[13:30:13] <cehteh> what DKordic posted above work then
[13:30:27] <averowsky> DKordic: Yes
[13:30:59] <averowsky> and as far as I understand I need to run avrdude with -c arduino -P /dev/ttyACM0
[13:31:01] <averowsky> ?
[13:31:02] <cehteh> there are plents such examples on the net
[13:32:05] <averowsky> DKordic: but this link shows how to burn bootloader
[13:32:33] <DKordic> averowsky: At which step, of given 8, are You stuck? I guess You haven't burned ``ArduinoISP'' to make it ISP.
[13:32:35] <averowsky> I want to just upload my hex on avr chip via arduino
[13:32:50] <cehteh> then just do that
[13:33:17] <averowsky> Ok So I have arduino Uno with atmega indside, Im opening arduinoISP sketch and upload it
[13:33:58] <averowsky> done. Now Im connectiing MOSI MISO SCK to pins 11,12,13
[13:34:06] <averowsky> and reset to 10
[13:35:13] <|DM|> averowsky, put the arduinoisp program into the arduino
[13:35:19] <|DM|> that program is available in the arduino IDE
[13:35:23] <cehteh> now you should be able to flash your mega with any program you want, bootloader or not .. prolly needs -c usbisp or something like that, you have to read the docs for that
[13:35:26] <averowsky> I did this
[13:35:33] <|DM|> its -c avrisp to use it with avrdude
[13:35:53] <cehteh> i never did that just know that this method exists :)
[13:36:21] <|DM|> I've also had issues with baudrate while programming, you'll want to refrence http://wormfood.net/avrbaudcalc.php
[13:36:33] <|DM|> or just use something like -B 19200
[13:37:20] <|DM|> The port depends on your computer, its either that or /dev/ttyUSB0 (usually)
[13:38:04] <|DM|> You'll also have to change permissions on the port. You can look online on how to do so permanently , but sudo chmod 666 /dev/ttyACM0 (or whatever the port name is) will work but must be done each time you plug the programmer in
[13:38:30] <averowsky> I did everything like you said
[13:38:38] <averowsky> beside adding -B 19200
[13:38:45] <|DM|> did it work?
[13:38:45] <averowsky> and before this didnt work
[13:38:47] <Lambda_Aurigae> and what is the error?
[13:38:52] <|DM|> Okay
[13:38:55] <averowsky> I will add -B 19200
[13:39:02] <|DM|> in the arduino board you need to have an actualy arduino
[13:39:14] <averowsky> avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe0
[13:39:22] <|DM|> the atmega you want to program is sitting on a breadboard or something, with miso mosi sck reset connected
[13:39:31] <averowsky> |DM|: yes yes
[13:39:37] <|DM|> did you forget to connect the reset pin ?
[13:39:45] <|DM|> and the avr needs to be powered.
[13:39:50] <averowsky> On arduino uno chip with arduino botloader and arduinoisp loaded
[13:39:57] <averowsky> uploaded*
[13:40:03] <|DM|> alright
[13:40:05] <averowsky> its connected
[13:40:11] <|DM|> and which avr chip do you want to program ?
[13:40:14] <averowsky> to pin 10 on arduino and to reset on atmega
[13:40:15] <cehteh> double check
[13:40:25] <|DM|> Ill walk you through it. I am using a uno as a programmer as well.
[13:40:35] <averowsky> |DM|: thanks
[13:40:45] <|DM|> which avr chip ?
[13:40:50] <averowsky> 328p
[13:41:33] <|DM|> alright, downloading the datasheet to check the pins
[13:41:40] <|DM|> but try it with the -B switch
[13:41:52] <averowsky> Ive tried, the same...
[13:42:03] <|DM|> pass -v to avrdude
[13:42:06] <averowsky> avrdude command
[13:42:07] <averowsky> avrdude -p atmega328p -P /dev/ttyACM0 -c avrisp -U flash:w:output.hex.hex -B 19200
[13:42:18] <|DM|> avrdude -v -P $(PORT) -p $(TARGET) -c $(PROGRAMMER) -b $(RATE) -U flash:w:$*.hex
[13:42:20] <|DM|> is my command
[13:42:34] <cehteh> output.hex.hex ?
[13:42:36] <averowsky> it works !
[13:42:42] <|DM|> !
[13:42:57] <|DM|> cehteh, hexchat expanded part of the macro :D
[13:43:16] <|DM|> its actually flash:w:$.hex
[13:43:27] <|DM|> with a * after the $ symbold
[13:44:00] <|DM|> lets see if it expands it again .$*.testing
[13:44:03] <|DM|> weird.
[13:45:07] <|DM|> oh wait. That wasnt my line! I'm retarded :D
[13:45:08] <averowsky> thanks..
[13:45:09] <averowsky> :)
[13:45:13] <|DM|> NP :)
[13:45:31] <|DM|> Id suggest adding -v to your build order so that you can see exactly where stuff goes wrong
[13:45:44] <|DM|> is avrdude reaching the programmer, is it failing a handshake, a signature check, or what
[13:45:56] <averowsky> Ok
[13:46:22] <averowsky> currently Im working on project with stepper motors
[13:46:37] <averowsky> and after 5 minuts they are really hot
[13:46:42] <averowsky> is it normal
[13:46:43] <averowsky> ?
[13:46:48] <averowsky> for steppers ?
[13:47:40] <|DM|> no clue, kinda new to the embedded world myself
[13:48:10] <averowsky> like me !
[13:48:11] <averowsky> :)
[13:48:20] <|DM|> :)
[13:48:26] <averowsky> I have a lot of ideas
[13:48:38] <|DM|> I'm slowly working through a list :)
[13:48:43] <averowsky> but electronics is not my stron side
[13:48:52] <|DM|> nor mine, but its a fun hobby
[13:49:00] <|DM|> and uC are just too good to skip
[13:50:53] <averowsky> which consume not small amount of money :)
[13:54:57] <|DM|> I dunno, buying a bag of avrs from aliexpress /alibaba costs like 1~ dollar a chip. Or less
[13:55:07] <|DM|> And I got my uno for 3.8~ euros
[13:55:14] <|DM|> well, uno clone I guess.
[13:59:25] <averowsky> alibaba has really god price
[13:59:30] <averowsky> good*
[13:59:39] <averowsky> have you ordered from them ?
[14:02:57] <|DM|> I havent ordered uC from them, but I've ordered other stuff
[14:02:58] <Lambda_Aurigae> steppers can get hot...be careful with overvoltage.
[14:03:14] <Lambda_Aurigae> make sure your power source and driver chip have the current capacity to drive them properly too.
[14:03:15] <|DM|> cooper wire, a battery, LED bags
[14:03:53] <averowsky> |DM|: really chip. how long you had to wait ?
[14:04:14] <|DM|> yeah, really really cheap. I go for free shipping so its between 20-40 days
[14:04:30] <|DM|> I'm guessing youre in east europe too, so expect about the same.
[14:04:32] <averowsky> Lambda_Aurigae: I have 2 drv8825 drivers. I set limit to 1A on each
[14:04:48] <averowsky> Lambda_Aurigae: my power source has 19V ands can give 4A
[14:05:13] <averowsky> this one http://www.eminebea.com/en/product/rotary/steppingmotor/hybrid/standard/17pm-k.shtml
[14:05:16] <|DM|> anyways, time for me to port this LCD code to a library and fix the absurd unoptimized assembly gcc puts out
[14:05:58] <Lambda_Aurigae> averowsky, that page shows multiple steppers.
[14:06:06] <Lambda_Aurigae> but none of them over 1.4A
[14:08:01] <averowsky> Lambda_Aurigae: I have 17PM-k310
[14:08:15] <averowsky> is not there, and I cannot find it anywhere
[14:09:22] <averowsky> So I took bipolar with 17PM-k3*
[14:09:54] <Lambda_Aurigae> which could be as much as 1.4A
[14:10:01] <Lambda_Aurigae> but, still, yes, they get hot.
[14:10:12] <Lambda_Aurigae> some in copiers even have heatsinks.
[14:10:43] <averowsky> so I should worry that I will do smoething bad with that ?
[14:10:49] <averowsky> them*
[14:10:58] <averowsky> because of this temp
[14:10:59] <Lambda_Aurigae> depends on how hot they are getting.
[14:11:33] <Lambda_Aurigae> too hot to touch? might be a problem.....hot enough to burn you on a quick touch? definitely a problem.
[14:11:56] <averowsky> i can hold finger few seconds
[14:15:06] <averowsky> Ok, So its hard to hold it for two seconds
[14:15:14] <averowsky> I just tried
[14:17:29] <cehteh> you prolly feed too much power into them
[14:18:58] <Lambda_Aurigae> I find that steppers are happier if they have at least a little load on them too.
[14:20:00] <Lambda_Aurigae> if you limit the current to them then they tends to act flaky as well. If it is rated at 0.9A then it wants that available at the rated voltage.
[14:20:54] <Lambda_Aurigae> you are only running them at 19V so they might not give you full torque or speed
[14:21:57] <Lambda_Aurigae> as they are rated at 24V.
[14:23:55] <averowsky> I limited them to 0.5A
[14:24:05] <averowsky> if they will get hot
[14:24:07] <|DM|> dont motors have lower resistance when they dont have a load attached ?
[14:24:23] <|DM|> the same way generators have more mechanical resistance when you shortcircuit the outputs
[14:24:27] <Lambda_Aurigae> lower inductance if they free wheel as I recall.
[14:24:40] <Lambda_Aurigae> which is effective resistance kindasorta.
[14:24:43] <Yoduza> fpga <=> atmega. Pinout https://embeddedmicro.com/media/wysiwyg/mojo/v2-sch.pdf
[14:25:31] <Lambda_Aurigae> Yoduza, yeah...
[14:25:52] <Lambda_Aurigae> somewhere around here I have an FPLISC which is an AVR and FPGA on one chip.
[14:25:57] <Lambda_Aurigae> don't think they are made anymore.
[14:26:06] <|DM|> damn. That sounds like a great learning/dev board
[14:26:23] <Yoduza> :D
[14:27:21] <Lambda_Aurigae> ok...time to go make sawdust...
[14:27:49] <Lambda_Aurigae> turning pallets into shingles today.
[14:30:11] <Yoduza> |DM|, https://www.joelw.id.au/FPGA/CheapFPGADevelopmentBoards
[14:30:53] <|DM|> I meant one that had both fpga and a uC together :)
[14:31:03] <|DM|> I think I'll stick to just uC for now, way way cheaper
[14:31:08] <Xark> A similar FPGA+AVR is http://store.gadgetfactory.net/papilio-duo/
[14:31:27] <Xark> (it can also accept Arduino shields and Papilio FPGA "wings").
[14:32:38] <|DM|> I'll be bookmarking that for later
[14:32:56] <|DM|> And I just realized, cant I use a 2 dollar avr as a mediocre mixed signal scope ?
[14:33:29] <Yoduza> avr only for config fpga
[14:33:49] <Xark> Yoduza: I don't think that is correct.
[14:34:19] <Yoduza> config via spi,usart
[14:34:33] <Xark> Yoduza: On Papilio Duo AVR and FPGA are connected and can work together. On Mojo typically AVR does config, but also EEPROM, ADC and UART.
[14:34:59] <Xark> Yoduza: You can program AVR with Arduino (or other avr-gcc).
[14:35:46] * Xark notes he has (and has used) both boards https://i.imgur.com/HXp2ixj.jpg
[14:35:48] <Yoduza> i have nano3.0,m3 but i dont know specification for use fpga from mcu
[14:37:30] <Xark> Hmm, kind of overloaded terms there. Arduino Nano? DE0-Nano? MaxIII? Cortex-M3?
[14:38:27] <Yoduza> 3x ArduinoNano3.0, 1x MapleMini Cortex-m3
[14:38:52] <Xark> Yoduza: I see. So you want to use one of them with an FPGA?
[14:39:01] <Yoduza> indeed !
[14:40:03] <Xark> Yoduza: Well, depending on what you want I suspect any of them can interface to FPGA. One issue may be 3.3v vs 5v (so level converter).
[14:40:26] <Xark> (Cortex may already be 3.3v...)
[14:40:31] <Yoduza> yes
[14:40:51] <Xark> Yoduza: Do you already have an FPGA (or one in mind)?
[14:41:20] <Yoduza> i have $15 for single LX150
[14:41:56] <Xark> So a Spartan6 board or just a part?
[14:42:07] <Yoduza> single chip only
[14:44:29] <Xark> I see. Well, designing a BGA (I presume) board is non trivial. One other issue is I believe LX150 is "too big" to be supported in free ISE WebPack (only goes to LX75).
[14:45:34] <Yoduza> ok, LX75 . Single chip.
[14:46:39] <Xark> Unless you know you need a large chip, you might consider something like http://www.ebay.com/itm/like/231092874536
[14:48:24] <Yoduza> there is lx9
[14:48:45] <Yoduza> without memory
[14:49:05] <Xark> It has ~64KB internal BRAM.
[14:49:41] <Xark> And lx9 can take a pretty big design (easily a 32-bit soft-core, cache, video etc.)
[14:50:17] <Xark> If you want a board with memory etc. of course plenty available. If you want to make a board, sounds like a "project". :)
[14:51:17] <Yoduza> just what to know specification " usart for fpga <=> atmega
[14:51:42] <Xark> Yoduza: There isn't any specific one I am aware of.
[14:51:58] <Xark> Yoduza: Feel free to copy Mojo or Duo.
[14:52:43] <Xark> Yoduza: Mojo AVR code is open even.
[14:53:23] <Xark> Yoduza: Mojo design does require FPGA support at boot tmie (minor PITA and not like that on most other boards).
[14:53:54] <Xark> IOW, you need to start with "Mojo Base Project" (only in Verilog) and then add on your design.
[15:00:33] <Yoduza> i dont know Verilog, I know asm,c only
[15:03:10] <Xark> Yoduza: Well, FPGA will not be much fun until you learn VHDL or Verilog. However, you can use other designs and something like Papilio DesignLab to add schematic to design http://gadgetfactory.net/learn/2015/05/03/designlab-make-a-simple-fpga-circuit-2/
[15:04:13] <Xark> Yoduza: I taught myself VHDL over the last few years. It is challenging but very doable (kind of like a bizarre assembly language - where you can do "as much as you want" every cycle). :)
[15:05:41] * Xark links nice intro video for DesignLab (and Spartan6+AVR) https://www.youtube.com/watch?v=CkYw03lwhE0
[17:36:28] <orzel> Hello. The documentation about my Atmel stk600 says there's a "crystal socket" "next to the program button". I might be dumb, but i can't see anything like a socket/plug next to this button. Google image doesn't help neither. Does anyone know ????
[17:46:40] <Casper> orzel: what I see on this diagram is not a socket, but solder pad
[17:47:33] <Casper> actually
[17:47:36] <Casper> I do see a socket
[17:47:55] <Casper> https://engineering.purdue.edu/ece477/Archive/2012/Fall/F12-Grp05/images/STK600LEDs.jpg
[17:50:50] <orzel> Casper: the two metal circles with a plastic circle in-between, just on the right of "PROGRAM" ?
[17:51:10] <orzel> There's a component there on my board. So i guess it was delivered with a crystal ..???
[17:52:28] <orzel> Dang, nope. It's an empty connector, but with some piece of metal all around. Some kind of protection i assume
[17:53:11] <orzel> i can remove it with a plier
[17:53:27] <orzel> 'pliers', even
[17:55:14] <orzel> Casper: thanks, anyway !
[19:42:48] <|DM|> So, why is the compiler not recognizing that PIN is external and letting the linker handle it?
[19:42:49] <|DM|> http://pastebin.com/Wde9hWCp
[19:42:53] <|DM|> I've already tried the .extern directive.
[20:22:12] <Casper> |DM|: and PIN would be defined where?
[20:23:16] <anonnumberanon> <Lambda_Aurigae> anonnumberanon, wire library is good for massive bloat.
[20:25:29] <anonnumberanon> I know most Arduino libraries are bloat but I watched a video of this guy who did some optimization of code and showed how not to use the Arduino library in his quadcopter, yet, he kept using wire.h, so I'm thinking the wire library is not very slow if he uses it. Now maybe you were talking about code size which is very different from code execution speed.
[20:30:13] <fruxo> what are the differences between implementing SPI communication using USART in MSPI mode, vs using the USI for the same purpose? the tiny1634 has both USART and USI
[20:39:26] <|DM|> Casper, in another object file that would get linked with this one
[23:05:21] <|DM|> arent "ldi r24 0xFF ; out 0x11 r24" and "sbr 0x11 0xFF" equivalent?