#avr Logs

Aug 14 2017

#avr Calendar

12:19 AM _ami_: enh, my guess is if your .data section is larger than m328p can support.
12:22 AM _ami_: since vtable gets stored in .data so there is a chance that it might get over sram.
12:22 AM day_ is now known as daey
12:22 AM _ami_: enh, you can check this by writing a simple test
12:22 AM _ami_: i have used vtable earlier on avr and it worked. but yeah, it was not big as yours.
12:56 AM _ami_: enh, you don't use git. why hg? :)
01:50 AM day_ is now known as daey
07:21 AM rebecc_ is now known as rebecca
08:13 AM MrFahrenheit: you can check the size of the sections with avr-size
01:29 PM JanC is now known as Guest47969
01:29 PM JanC_ is now known as JanC
01:32 PM bss36504: Anybody besides me play with Eagle at all since Version 8 (the Autodesk era)
01:32 PM bss36504: ?
01:40 PM Emil: bss36504:
01:40 PM Emil: drop it
01:40 PM Emil: Just use KiCAD
01:40 PM Emil: and have all your students use KiCAD
01:40 PM twnqx: i tried kicad
01:40 PM twnqx: it was so painful i switched back to eagle
01:40 PM Emil: lol
01:40 PM Emil: Every EDA software has quirks at first
01:41 PM Emil: but KiCAD is super easy
01:41 PM twnqx: "no, you can't create an empty new library. you have to copy something that already exists first."
01:41 PM twnqx: that is so... terrible
01:41 PM Emil: Eh
01:41 PM twnqx: especially for someone who says "absolutely 0 default parts"
01:41 PM Emil: You don't have to copy anything to a new lib
01:41 PM Emil: also
01:42 PM twnqx: well, i could not create an empty new lib.
01:42 PM Emil: >not using defalt parts
01:42 PM Emil: what are you
01:42 PM Emil: super luddite?
01:42 PM twnqx: someone who likes oversized pads for hand soldering
01:42 PM twnqx: someone who wants to 100% be sure of a consistent font and size for prints
01:42 PM Emil: lol
01:42 PM Emil: Just create a new footprint
01:42 PM Emil: Or edit the one you are currently using
01:43 PM twnqx: i would do that, if i could just import eagle libraries :P
01:58 PM bss36504: Hey hey, not trying to start a fight, though I hated kicad. Either way, the new eagle features are pretty cool
01:59 PM twnqx: i'm stuck on 7 as i don't pay per use
01:59 PM bss36504: They've made some good improvements to the routing. There is actual DRC-driven routing which is quite handy
01:59 PM bss36504: twnqx: It's still free
02:00 PM twnqx: i never noticed the pro version being free
02:00 PM bss36504: The pro version isn't free, the free version is still free.
02:00 PM bss36504: Are you saying you paid for a Eagle 7 pro license?
02:01 PM twnqx: for a 6 and later a 7, yes
02:01 PM bss36504: gotcha
02:02 PM bss36504: Well, maybe give 8.3 a test drive then
02:02 PM bss36504: The routing is just really nice now.
02:02 PM bss36504: They definitely borrowed features from Kicad or Altium and others
02:03 PM bss36504: I think Cadsoft was just stagnating/too small to bring in new features and keep up
02:03 PM bss36504: I would like it if the UI matched the other Autodesk products a little better, still feels like eagle is just off on it's own
02:05 PM twnqx: not saying eagle's the best of the crowd, and definitely far away with the new price/value tradeoff
02:06 PM bss36504: Did the original license transfer between major releases?
02:06 PM bss36504: I thought it didn't
02:06 PM twnqx: no, but there were years in between
02:07 PM bss36504: ok, so I guess I don't have a problem with the subscription format
02:07 PM bss36504: It's relatively affordable, you can cancel whenever, and you get tons of updates (at least if they continue as they have been)
02:08 PM bss36504: I know some people really make a big stink about subscription software though, I just don't understand it in most cases
02:10 PM twnqx: so what do you do if you need to make a minor change like adding a resistor in a year
02:10 PM twnqx: pay another subscription fee?
02:10 PM twnqx: i'm a hobbyist who uses the software twice or thrice a year
02:11 PM bss36504: Well then I guess it isn't for you, and you should survive on the free version or use something like kicad that's completely free
02:11 PM twnqx: i don't mind a 1k every three-four years
02:11 PM twnqx: like it was before
02:12 PM twnqx: oh well, i'm off to do some shopping
02:12 PM twnqx: bbl
02:12 PM bss36504: I mean, I guess I see your point. I wouldnt drop 1k on software if I didn't use it more than twice or thrice a year
02:13 PM bss36504: I use eagle monthly at least, and even still I wouldn't pay for a license unless I could monetize it somehow haha
02:14 PM Emil: We should do a comparison video
02:15 PM Emil: "Here are specs and parts you must use. Design and route it."
02:15 PM Emil: And video comparison with some specs about the skill levels of those "competing"
02:16 PM Emil: Time wouldn't be the deciding factor really
02:46 PM Emil: More about workflow and ease of use
03:04 PM enh: https://www.youtube.com/watch?v=nd_ZXgObNNg
03:05 PM enh: https://www.youtube.com/watch?v=rLyc4xp75Zk
03:09 PM renn0xtk9: The ATMEGA328 as a serial controller (a USART) but you can not directly plug a usb cable out of the computer on it can you ? you not some componentns inbetween to "translate" the signal? or can you do without?
03:11 PM LeoNerd: You'd need a USB-CDC bridge
03:12 PM LeoNerd: Such as the FT232, CP2102, CH340,.. or the other one I never remember
03:15 PM Lambda_Aurigae: there are ttl level usb-serial adapters available on ebay and such for under 4 dollars.
03:16 PM Lambda_Aurigae: renn0xtk9, usb is not the same as USART...they are totally different technologies, even though they both say S for serial.
03:16 PM Lambda_Aurigae: and Universal Serial Bus,,,ISN'T!
03:17 PM Lambda_Aurigae: it is a serial bus but it is not necessarily serial.
03:17 PM Lambda_Aurigae: err.
03:18 PM Lambda_Aurigae: not necessarily universal.
03:18 PM Lambda_Aurigae: doing too many things at once here..hehe
03:18 PM LoRez: it's a serial bus that's not necessarily RS232
03:18 PM Lambda_Aurigae: yes
03:18 PM Lambda_Aurigae: the "universal" part is somewhat misleading.
03:19 PM LeoNerd: USB also isn't a bus
03:19 PM Lambda_Aurigae: renn0xtk9, there is a software called v-usb that will allow an atmega328 to talk directly on USB but it does require some additional hardware to make work and working with v-usb is not for newbies.
03:19 PM LeoNerd: Each link is a peer-to-peer connection between a device and the upstream controller or hub
03:20 PM Lambda_Aurigae: star topology!
03:20 PM renn0xtk9: Lambda_Aurigae yeah I tried All the week-end V-USB. it is very limited..
03:20 PM Lambda_Aurigae: v-usb is a major hack that ignores some things and almost breaks others to make it work, kindasorta.
03:20 PM LeoNerd: You don't want to play with V-USB. It's terrible
03:20 PM Lambda_Aurigae: you are better to use a cp2102 or similar to make your usb connection...
03:21 PM Lambda_Aurigae: or get an avr with built in usb hardware...but that's a whole other can of squirrels.
03:22 PM NoHitWonder__: or stm32
03:22 PM Lambda_Aurigae: you would need the LUFA library or something else similar...a usb hardware/software stack.
03:22 PM Lambda_Aurigae: I use pic16f1454 chips as usb-cdc adapters myself...but,,
03:23 PM renn0xtk9: The other thinf is I would need it as non SMD..:S
03:23 PM LeoNerd: Yeah, outside of XMEGA chips, there aren't very many ATmega chips that talk USB
03:23 PM Lambda_Aurigae: LeoNerd, there are a few...4 or 5
03:23 PM LeoNerd: If you want to use it on DIP, just get someone to mount one of the decent chips on a breakout board
03:23 PM Lambda_Aurigae: renn0xtk9, hence my use of pic16f1454.
03:23 PM LeoNerd: Hell, I'll do it for you if you really want
03:23 PM LeoNerd: There's plenty of actual companies around who do it also
03:24 PM LeoNerd: Or use e.g. a 32U4 breakout board, or an Arduino Micro
03:24 PM bss36504: LeoNerd: Well if you want to get pedantic, the Endpoints are existing on a virtual bus of sorts
03:24 PM bss36504: Which I believe is the intent of the "Bus" in USB
03:24 PM LeoNerd: bss36504: The endpoints are all point-to-point also
03:24 PM bss36504: Devices are indeed in a star topology
03:24 PM LeoNerd: None of them are shared
03:24 PM bss36504: right but the endpoints share the backplane.
03:25 PM bss36504: I2C is a bus, but also point to point between master and slave
03:25 PM bss36504: I agree that it is more of a hybrid network than strictly a bus or star though
03:25 PM LeoNerd: I²C is actually a bus; every device sees the same conditions on the bus and just ignores messages that aren't to it
03:26 PM LeoNerd: On USB, every electrical connection is point to point between just the two devices at either end of it
03:26 PM LeoNerd: Hubs forward messages on towards devices
03:26 PM LeoNerd: Each end device only sees signals on the cable that relate to it
03:26 PM Lambda_Aurigae: USB Hubs should be more correctly called USB Switches...if you follow the Hub/Switch naming from ethernet anyhow..hehe
03:27 PM LeoNerd: Mmhm
03:27 PM bss36504: Yes, I know that. I think they were talking more in terms of the sort of "virtual" bus that exists between host endpoints and device endpoints. Or at least that was my interpretation
03:27 PM Lambda_Aurigae: "USB" was chosen because it rolls off the tongue more than anything else I bet.
03:27 PM bss36504: Also, the Bus in USB might have been because "Universal Serial Star Network" doesn't roll off the tongue quite as nicely
03:27 PM bss36504: ah beat me to it Lambda_Aurigae
03:28 PM bss36504: Or maybe, those jabronis at Intel just wanted a bunch of nerds to argue about their new tech :P
03:29 PM Lambda_Aurigae: also, v-usb is not 100% compatible with all usb ports...I am finding currently about 1 in 10 does not work with any of the 3 v-usb hardware configurations....also about 1 in 5 will not work with one of the 3.
03:30 PM bss36504: vusb is so silly to me, especially when USB enabled controllers are everywhere.
03:30 PM bss36504: but I value function over cost in most cases anyway, and in most v-usb cases it seems people just have a bunch of attinys hanging around that they want to use
03:30 PM Lambda_Aurigae: it's a fun hack.
03:30 PM bss36504: I agree with that
03:30 PM Lambda_Aurigae: for production, I would never use it.
03:31 PM bss36504: Yeah
03:31 PM Lambda_Aurigae: unfortunately the usbasp has pushed it out there very widely.
03:31 PM bss36504: Well, guess we have to rely on embedded engineers at companies knowing better than to use it
03:31 PM bss36504: (for real products that is)
03:31 PM Lambda_Aurigae: hehe.
03:32 PM Lambda_Aurigae: I should finish up my pic16f1545 two part avr programmer.
03:32 PM Lambda_Aurigae: need to add pdi and tpi for it.
03:33 PM renn0xtk9: vusb is a mess if you have to use timers are USR for doing the rest of the job
03:33 PM renn0xtk9: It kept conflicting in my case
03:33 PM Lambda_Aurigae: yup.
03:33 PM Lambda_Aurigae: in your case, use 2 chips.
03:33 PM Lambda_Aurigae: one as a usb interface and one to do the work..and communicate between them with usart/usi/spi/twi or something.
03:35 PM renn0xtk9: hmm well that is an interesting idea ^^
03:35 PM renn0xtk9: evn more since i can't find a converter as PDIP package
03:35 PM Lambda_Aurigae: I thought I suggested that yesterday.
03:35 PM renn0xtk9: is it possible fot two microcontroller to share the same quartz for the oscillation ?
03:36 PM Lambda_Aurigae: or just get a ttl-serial/usb adapter from ebay.
03:36 PM Lambda_Aurigae: the same crystal, no.
03:36 PM Lambda_Aurigae: however
03:36 PM Lambda_Aurigae: one can send its clock out a pin and that can be used to run the other
03:36 PM Lambda_Aurigae: or
03:36 PM Lambda_Aurigae: you can get a crystal oscillator and drive multiple chips from that.
03:37 PM Lambda_Aurigae: look at the octapentaveega from Jartza on how that works...he drives 3 attiny85 chips from a single crystal oscillator can.
03:37 PM Lambda_Aurigae: I have one of his boards and two I made myself and it works great.
03:39 PM Lambda_Aurigae: some AVR chips have the ability to feed their main clock signal out of a pin...so you can drive one with a crystal and use the clock output to drive another chip or three.
03:39 PM Lambda_Aurigae: I've done that in the past.
03:39 PM renn0xtk9: you mean things like this http://www.ebay.de/itm/D-TECH-USB-auf-RS232-Seriell-9-pin-Adapter-Konverter-RS-232-Kabel-Com-Port/121834379636?hash=item1c5de51974%3Ag%3AWCEAAOSwxN5WZTOE ?
03:39 PM Lambda_Aurigae: like that but not.
03:39 PM renn0xtk9: i am thinking about it but from an esthetic point of view I find it a bit ugly ^^
03:39 PM Lambda_Aurigae: that is an rs232 level usb-serial adapter.
03:39 PM Lambda_Aurigae: you would need another chip to convert voltage levels for that.
03:40 PM renn0xtk9: RS232 is not 5 votls ?
03:40 PM Lambda_Aurigae: http://www.ebay.de/itm/D-TECH-USB-auf-RS232-Seriell-9-pin-Adapter-Konverter-RS-232-Kabel-Com-Port/121834379636?hash=item1c5de51974%3Ag%3AWCEAAOSwxN5WZTOE
03:40 PM Lambda_Aurigae: no, it is not.
03:40 PM Lambda_Aurigae: rs232 is +/- 12 volts.
03:40 PM Lambda_Aurigae: you need a max232 or max233 or similar chip between the 9 pin serial port and an avr for it to communicate.
03:41 PM renn0xtk9: okay
03:41 PM renn0xtk9: you send the same link
03:41 PM Lambda_Aurigae: max232 is cheap but needs some capacitors..max233 has them built in but is much more expensive.
03:41 PM Lambda_Aurigae: oops.
03:41 PM Lambda_Aurigae: let me repost..
03:41 PM Lambda_Aurigae: https://www.ebay.com/i/122301396854?chn=ps&dispItem=1
03:41 PM Lambda_Aurigae: there
03:41 PM Lambda_Aurigae: sorry
03:41 PM renn0xtk9: actually the solution with two AVR is quite interesting , since my puropose is to leanr, to will force me to go through pretty much interesting things
03:42 PM Lambda_Aurigae: you can set them up with master/slave spi or twi.
03:42 PM Lambda_Aurigae: twi=i2c
03:42 PM Lambda_Aurigae: or communicate via usarts
03:42 PM Lambda_Aurigae: and use the hardware on the chips to do the comms..
03:43 PM renn0xtk9: i2c is a bus , kind like a CAN ?
03:43 PM Lambda_Aurigae: not like can
03:43 PM Lambda_Aurigae: but, yes.
03:43 PM Lambda_Aurigae: you can attach multiple chips to an i2c bus.
03:44 PM Lambda_Aurigae: usually 1 master and 1 or more slaves.
03:45 PM renn0xtk9: okay I think that will be an interesting and challeging project to do this with two AVRs
03:45 PM renn0xtk9: :p
03:45 PM Tachaway: i2c can have up to 127 slaves and 1 master as it has 7 bit addressing for some reason... (though in practise most devices only let you choose between a couple of addresses if that)
03:45 PM Lambda_Aurigae: start with making two AVRs talk...buttons or switches on one, LEDs on another..and use the different systems to communicate between them.
03:46 PM Lambda_Aurigae: Tachaway, most devices have a base address and 2 to 8 sub addresses....wrong nomenclature,,,but
03:46 PM Lambda_Aurigae: usually 3 address selection lines giving you up to 8 of a device on the bus
03:47 PM Lambda_Aurigae: some devices even have different models with different base addresses
03:47 PM Lambda_Aurigae: like the pcf8574 and pcf8574a chips.
03:47 PM Tachaway: ah, yeah, ICs usually have that, but LCD modules I've had and so on typically have a 2 position link and that's your lot
03:47 PM Lambda_Aurigae: with those you can put up to 16 on a single i2c bus total..8 of each.
03:47 PM Lambda_Aurigae: that's a limitation of the module from the module maker.
03:48 PM Tachaway: oddly enough the MCP23018 has a single pin for 8 addresses which you have to feed an analogue voltage as a proportion of the supply voltage and two NC pins, no idea why they did it that way since the 23016 and 23017 had the usual 3 pins
03:48 PM Lambda_Aurigae: I use pcf8574 to drive 16x2 lcd displays so can get 8,,or 16,,on a single bus if I need to.
03:49 PM Lambda_Aurigae: somewhere there is a general list of common base addresses for i2c devices...I saw it once some years back.
03:49 PM Lambda_Aurigae: I'm sure it's waaay outdated though.
03:49 PM Lambda_Aurigae: and there are many devices that interfere with each other...hence being able to select up to 8 different addresses from the base.
03:49 PM Tachaway: I usually use the i2c scanning demo code in the arduino software when buying things from china as the address is often missing/wrong, lol
03:49 PM Tachaway: aye
03:50 PM Lambda_Aurigae: wrote my own scanner from peter fleury's i2c library.
03:50 PM Lambda_Aurigae: also I have a buspirate that has such a scanner built in.
03:50 PM Tachaway: is that a logic analyser?
03:51 PM Lambda_Aurigae: kindasortanotreally
03:51 PM Lambda_Aurigae: it's a bus interface thingie.
03:51 PM Emil: Lambda_Aurigae: the funny thing about usb
03:51 PM Emil: is that
03:51 PM Tachaway: ah, not heard of it, was just guessing from the name but I'll google it
03:51 PM Emil: It's not even a bus
03:51 PM Emil: it's point to point links :D
03:52 PM Tachaway: oh, I see, it's a serial interface for multiple other protocols to make life easier
03:52 PM Tachaway: and something I should have by the looks of it
03:53 PM Lambda_Aurigae: logic pirate is another fun toy.
03:53 PM Lambda_Aurigae: which, if you have stuff to work with pic microcontrollers, you can built your own.
03:53 PM renn0xtk9: any risk I have a sort of conflict between V-USB and the fact that I use i2c interface?
03:53 PM Lambda_Aurigae: everything for the bus pirate or logic pirate is available in through hole.
03:54 PM Lambda_Aurigae: renn0xtk9, possibly...if you go a full interrupt driven i2c then yeah, it could interfere.
03:54 PM Lambda_Aurigae: one of those things you run into with v-usb.
03:54 PM Lambda_Aurigae: http://homepage.hispeed.ch/peterfleury/avr-software.html
03:54 PM Lambda_Aurigae: try the i2c library from here.
03:56 PM Lambda_Aurigae: aaand, time to fly.
03:56 PM Lambda_Aurigae: laters.
03:56 PM renn0xtk9: BTW yesterday I was playing with it, when trying to init a timer in the middle of the programm by running this https://pastebin.com/uNVzgN7v
03:56 PM renn0xtk9: and it turns out when I did, it activated the clockout pin on port b0
03:57 PM renn0xtk9: i though for it to work, i would have to enable the fuse on the first place which was not the case :S
03:57 PM Emil: Wat
03:58 PM Tachaway: yeah, I have pics and so on but I'm limited to veroboard for construction as I have neither the experience nor the equipment to etch my own boards...
03:58 PM Emil: No you didn't
03:59 PM Emil: You _have_to_ change the fuse to enable clko
04:00 PM renn0xtk9: Emil well I did not enable that fuse. I have a red led on that pin, as long i did not run the function it was not lighted up. Then the function run, i see it lighting up very slightly, I look at the oscilloscope, and it seemed like a clock signal
04:00 PM renn0xtk9: which I interpret as activation of the clockout
04:00 PM Emil: yeah no
04:01 PM renn0xtk9: okay so it was kind of a signal due to the timer or stuff?
04:04 PM renn0xtk9: okay, I got to go to sleep anyway
04:05 PM Emil: Good night
06:54 PM enh: hi
07:31 PM enh: but if you do not know the video it is probably a hoax
07:32 PM Lambda_Aurigae: wouldn't surprise me.
07:34 PM _ami_: enh: which video?
07:34 PM enh: hi _ami_
07:34 PM Tom_itx is now known as Guest24493
07:34 PM `z is now known as Guest23877
07:34 PM enh: Sorry for yesterday. I slept before you answered. But I've seen your answer today
07:35 PM enh: This video: https://www.youtube.com/watch?v=nd_ZXgObNNg
07:35 PM enh: The second one has a concrete information, which may be important if proved right: https://www.youtube.com/watch?v=rLyc4xp75Zk
07:38 PM _ami_: enh: np. :)
08:56 PM enh: So... The video is a complete voyage to the nonsense world?
08:56 PM enh: _ami_: I removed all virtual stuff from the code.
08:58 PM enh: _ami_: Thank you for the very helpful hints
09:48 PM enh: Does anybody here know the command line that reports the amount o memory that will be used by an AVR code? Arduino reports that upon program upload.
09:49 PM Casper: memory as ram or flash?
09:49 PM enh: ram
09:50 PM Casper: there is no way to know the amount of ram that your program use. If arduino claim anything it is a lie
09:50 PM enh: avrdude reports flash occupation.
09:51 PM Casper: you can see what is allocated by the main and global, but can not see what the program will use of total peak ram
09:51 PM enh: I'm almost sure it reports when you upload
09:51 PM Casper: it will report the flash usage
09:51 PM enh: ok. Do you know how does it get the allocated memory size?
09:51 PM Casper: ram is dynamic
09:52 PM Casper: it get very hard to calculate that
09:53 PM enh: I removed arduino from here.
09:53 PM enh: Or I could confirm this info
09:54 PM enh: This problem with vtables is very annoying. It is a pity AVR does not support virtual functions.
10:12 PM enh: Casper: Check this link: https://learn.adafruit.com/adafruit-feather-32u4-basic-proto/using-with-arduino-ide
10:12 PM enh: Picture number 9
10:12 PM enh: It says: Global variables use 525 bytes of dynamic memory
10:12 PM enh: I'd like to know where Arduino grabs that info
10:13 PM Casper: that is not true ram
10:14 PM Casper: there is a way to get that info... hmmm
10:14 PM Casper: I tought my makefile did it
10:15 PM enh: It is a useful hint of ram usage, though
10:15 PM Casper: ah avrsize
10:15 PM Casper: avr-size
10:16 PM enh: Thanks for that, Casper
10:16 PM enh: ENH-MBP:firmware enhering$ avr-size bin/COMModule.hex
10:16 PM enh: text data bss dec hex filename
10:16 PM enh: 0 13658 0 13658 355a bin/COMModule.hex
10:16 PM enh: ENH-MBP:firmware enhering$
10:17 PM enh: I wonder what does it mean
10:24 PM vegii: Hi. I think it's time to move from arduino to avr-gcc for an attiny13a project, since I don't like the core available. How do I blink? I'm on linux mint and got an usbasp ready...
10:25 PM vegii: hmm... seems ladyada has a nice tut