#avr Logs

Apr 21 2017

#avr Calendar

12:08 AM daey_ is now known as daey
01:33 AM JanC is now known as Guest10980
01:33 AM JanC_ is now known as JanC
04:33 AM JanC is now known as Guest18582
04:33 AM JanC_ is now known as JanC
06:25 AM ibanezmatt13: Hi All. I've made a pcb which has two atmega328p's on it. One is at 3.3v, the other at 5v, both external 8 and 16MHz clocks. They're new unprogrammed avrs. My programmer recognises the 3v3 one and reads its present fuses, but it can't get the 5v one to respond
06:25 AM ibanezmatt13: It's getting a good 5v supply drawing expected current and there are no shorts on the ICSP lines
06:26 AM ibanezmatt13: Does anyone have any pointers as to what to try next? :/
06:33 AM LeoNerd: Is the programmer 5V?
06:34 AM ibanezmatt13: hmm, I assumed it would be, it's a usbasp. I'll double check though
06:34 AM LeoNerd: Voltages can sometimes be a bit marginal
06:35 AM Lambda_Aurigae: it's usbasp
06:35 AM Lambda_Aurigae: there's your problem
06:35 AM ibanezmatt13: https://usercontent.irccloud-cdn.com/file/GCOrEsuj/20170421_120505.jpg
06:35 AM ibanezmatt13: yeah it's not the best thing I've seen
06:35 AM Lambda_Aurigae: it's usbasp
06:35 AM Lambda_Aurigae: there's a jumper on there to switch between 5V and 3.3V
06:36 AM Lambda_Aurigae: or, there's writing on there for it anyhow.
06:36 AM LeoNerd: I *believe* that jumper just affects the "VCC" output pin
06:36 AM Lambda_Aurigae: ok.
06:36 AM Lambda_Aurigae: the chip should, technically, be able to handle comms at either voltage, no matter what voltage it is running.
06:37 AM Emil: ibanezmatt13: check the fuses for div by 8
06:37 AM ibanezmatt13: I've tried to read the fuses but it won't respond
06:37 AM Lambda_Aurigae: slow your programming speed way down.
06:37 AM Emil: show your board and schematic
06:37 AM ibanezmatt13: yeah I've gone for -B 25
06:37 AM Emil: but
06:37 AM Emil: why
06:38 AM ibanezmatt13: https://usercontent.irccloud-cdn.com/file/hKIkLVFy/uav.brd https://usercontent.irccloud-cdn.com/file/KiMv5kn9/uav.sch
06:38 AM ibanezmatt13: to make sure it's slow enough for a new atmega at 1MHz
06:38 AM Emil: kicad?
06:38 AM ibanezmatt13: eagle
06:38 AM ibanezmatt13: :P
06:38 AM Lambda_Aurigae: definitely eagle.
06:38 AM Lambda_Aurigae: which I don't have installed anymore.
06:39 AM ibanezmatt13: So the 3.3v atmega on there works, I can read the fuses before setting them from new. However the 5v doesn't respond and the circuits should be identical apart from the different voltages
06:39 AM ibanezmatt13: I suppose it might be worth just trying that jumper in case the usbasp isn't good enough to manage it without that set correvtly
06:39 AM Emil: Is there a schematic viewer somwhere
06:40 AM ibanezmatt13: https://usercontent.irccloud-cdn.com/file/JEbCohi0/irccloudcapture-1536058003.jpg
06:40 AM Lambda_Aurigae: you have either a problem with the circuit design, a problem with the circuit build, a problem with the usbasp being stupid, or a bad chip.
06:41 AM Lambda_Aurigae: have you tried slowing the programmer speed way down?
06:41 AM Lambda_Aurigae: nevermind
06:41 AM Lambda_Aurigae: missed that.
06:41 AM ibanezmatt13: yeah... I'm going to try to change that jumper next I think. The chip at 5v is taking a roughly expected current so I don't think it's that
06:41 AM ibanezmatt13: yeah
06:42 AM Lambda_Aurigae: avr chips are very rugged so that's the last thing I would suspect.
06:42 AM Lambda_Aurigae: but had to throw it in there.
06:42 AM Lambda_Aurigae: go dig in the computer pile and find one with a parallel port...then build an stk200 clone and put linux on said computer and try that.
06:44 AM ibanezmatt13: :p
06:44 AM Lambda_Aurigae: hey
06:44 AM Lambda_Aurigae: my stk200 clone built with a 74ls244 worked the first time, and still works today
06:45 AM Lambda_Aurigae: and I built it in 2001
06:45 AM ibanezmatt13: haha, yeah I wish I knew what I was doing a bit more, near the low end of the learning curve at the mo
06:46 AM Lambda_Aurigae: I was at the bottom on microcontrollers when I made that stk200 clone and started with avr.
06:47 AM Lambda_Aurigae: ardweeny didn't exist and neither did irc channels helping people with AVR chips.
06:47 AM Lambda_Aurigae: at least, I hadn't found said IRC channels.
06:49 AM ibanezmatt13: fair enough :)
07:00 AM Lambda_Aurigae: I still think it's the programmer but I'm biased
07:01 AM ibanezmatt13: Fixed!
07:01 AM ibanezmatt13: It was indeed the jumper for 5v/3.3v selection :P
07:01 AM Lambda_Aurigae: so I was right for once!
07:01 AM Lambda_Aurigae: hehe
07:02 AM ibanezmatt13: haha :)
07:02 AM ibanezmatt13: Thanks for the help!
07:02 AM Lambda_Aurigae: welcome
07:17 AM _ami_: ibanezmatt13: https://hackaday.io/project/21189-fastusbasp-programmer-for-avr - you could checkout this in case you want to build a AVR programmer by yourself.
07:17 AM ibanezmatt13: oh interesting. I'll check it out thanks :)
09:14 AM Lambda_Aurigae: it's an stm32 board based programmer
09:20 AM rue_house: did anyone have problems with how long it took to program an avr before?
09:20 AM rue_house: I find that fast flashing usually is attributed to the write not holding for long (like 2 years)
09:21 AM Lambda_Aurigae: rue_house, never had a problem with it here..
09:22 AM Lambda_Aurigae: the actual flash time won't change...just how fast you can get the data into the sram on the chip.
09:26 AM rue_house: .... flash
09:27 AM rue_house: I suppose it has to be buffered, hmm
09:28 AM Lambda_Aurigae: yup.
09:28 AM Lambda_Aurigae: you fill a block of sram then point a register pair at it and tell the chip to write to a specific area of flash.
09:28 AM rue_house: its never been long enough to even think about for me
09:28 AM Lambda_Aurigae: same here.
09:29 AM * rue_house holds the serial port against the board as straight as he can and gets his buddy to press enter to flash it... GOT IT!
09:29 AM Lambda_Aurigae: even on the 1284p filling it up almost completely, it's always under a minute and I'm always doing something else while it write.
09:29 AM rue_house: ... big software?
09:29 AM Lambda_Aurigae: C interpreter
09:29 AM Lambda_Aurigae: well, C subset
09:29 AM Lambda_Aurigae: based on picoC
09:30 AM rue_house: ....
09:30 AM Lambda_Aurigae: I ended up going to a pic32 for it.
09:30 AM Lambda_Aurigae: got bored with basic interpreter.
09:30 AM Lambda_Aurigae: had to cut it down too far to fit on the 1284p.
09:30 AM rue_house: why not use precompiled?
09:30 AM Lambda_Aurigae: interpreter
09:30 AM Lambda_Aurigae: hehe
09:30 AM Lambda_Aurigae: like, the C64 basic
09:31 AM Lambda_Aurigae: only this is to use C instead of basic
09:31 AM rue_house: but why...
09:31 AM Lambda_Aurigae: for the fun of it.
09:31 AM Lambda_Aurigae: no particular reason.
09:31 AM rue_house: ah
09:31 AM Lambda_Aurigae: funzie project
09:31 AM rue_house: like my BF one
09:31 AM Lambda_Aurigae: yeah.
09:31 AM Lambda_Aurigae: the pic32 I'm using has 64K sram and 256K flash
09:32 AM Lambda_Aurigae: which is allowing me to fit the interpreter onboard plus a text editor for writing programs.
09:33 AM Lambda_Aurigae: and I'm soooo close to being able to load precompiled mini programs into sram too.
09:34 AM Lambda_Aurigae: because the pic32 can execute code from sram or flash.
09:34 AM Lambda_Aurigae: if I ever break down and go with a pic32mz I can add external serial sram and execute from that even.
09:35 AM Lambda_Aurigae: ultimately I want to be able to have the interpreter, editor, and video generator all on one chip..and if I stuck with a limited basic I could do that I think.
09:36 AM Lambda_Aurigae: also to include either ps-2 or usb keyboard interface as well.
09:36 AM Lambda_Aurigae: ps-2 I can do
09:36 AM Lambda_Aurigae: not sure about the usb keyboard...the chip I'm using is usb-otg capable so it can do it but,,
09:36 AM Lambda_Aurigae: that's overloading the heck out of that processor.
09:54 AM Lambda_Aurigae: I have considered rebuilding the inside of an old dead commodore vic-20.
11:10 AM NoHitWonder^: used a dedicated usb chip and take the load of the processor
11:10 AM NoHitWonder^: *use
11:11 AM NoHitWonder^: *use a dedicated usb chip and take the load off from the processor
12:53 PM Lambda_Aurigae: that ruins the single chip setup.
12:54 PM Lambda_Aurigae: if I'm going that route, I would go with a pair of pic32mx270f256b chips..
01:28 PM xentrac: Lambda_Aurigae: I like this idea of interpreter+editor onboard
01:28 PM xentrac: Lambda_Aurigae: what's the advantage of a PIC32 over something like an LPC1110?
01:29 PM xentrac: Lambda_Aurigae: you might be interested in http://www.freudenbergs.de/bert/publications/Ingalls-2014-Smalltalk78.pdf
01:32 PM xentrac: how does your C interpreter respond to things that normally crash C programs?
02:16 PM julius: hi
03:46 PM Lambda_Aurigae: xentrac, I have the pic32, I have the programmer, I don't have an LPC1110.
03:48 PM Lambda_Aurigae: pic32mx270f256b that I'm using has hardware usb and is available in a dip package so I can easily breadboard it.
03:49 PM Lambda_Aurigae: and I like the mips core over arm core.
03:49 PM Lambda_Aurigae: and pic sent me a whole bunch of them for free!
03:49 PM Lambda_Aurigae: microchip did, rather
03:50 PM Lambda_Aurigae: much more flash and sram than the lpc1110 too.
03:50 PM Lambda_Aurigae: smalltalk, while fun, is not C, which is my favorite programming language.
03:51 PM Lambda_Aurigae: picoC has some error handling, mostly a reset feature.
03:51 PM antto: mallStalk
03:52 PM NoHitWonder^: pic32 comes in dip package?
03:52 PM NoHitWonder^: neat
03:52 PM Lambda_Aurigae: yes
03:52 PM Lambda_Aurigae: some of the pic32mx series does.
03:52 PM Lambda_Aurigae: it's a 28pin narrow dip
03:52 PM NoHitWonder^: cool
03:52 PM Lambda_Aurigae: with hardware usb onboard some of them.
03:52 PM NoHitWonder^: nice
03:52 PM Lambda_Aurigae: pic32mx170f256b is non-usb
03:53 PM NoHitWonder^: how much is the programmer?
03:53 PM NoHitWonder^: is it pickit3 or something?
03:53 PM Lambda_Aurigae: ebay has them from 10 dollars up
03:53 PM Lambda_Aurigae: pickit3 is what I use.
03:54 PM NoHitWonder^: ok
03:54 PM Lambda_Aurigae: think I paid 30 for mine direct from microchip on sale some years back.
03:54 PM NoHitWonder^: not bad
03:54 PM Lambda_Aurigae: for pic it is worth having a real from the manufacturer programmer due to the various programming systems on their chips.
03:55 PM Lambda_Aurigae: I have 3 other pic programmers that all go to a point and stop and can't work with newer chips.
03:55 PM NoHitWonder^: ok. i usually go with them anyways
03:56 PM NoHitWonder^: i might need to order some pic32s and a programmer
03:56 PM NoHitWonder^: never used pics
03:56 PM Lambda_Aurigae: kinda got spoiled with avr and my stk200 clone that just worked...until they came out with pdi and tpi and that new single wire bidirectional uart based programming system for the newest hybrid chips.
03:56 PM Lambda_Aurigae: pic32 is a MIPS core.
03:56 PM Lambda_Aurigae: so it's not a real pic...
03:56 PM NoHitWonder^: yep
03:56 PM NoHitWonder^: ok
03:56 PM Lambda_Aurigae: but it has pic peripherals
03:56 PM antto: real pics are..
03:56 PM Lambda_Aurigae: which are really nice and really powerful.
03:56 PM * antto vomits
03:57 PM Lambda_Aurigae: antto, mostly agreed.
03:57 PM Lambda_Aurigae: I do have one pic16 series that I like for quicky simple usb interface thingies.
03:57 PM Lambda_Aurigae: pic16f1454/5/9
03:57 PM Lambda_Aurigae: can do usb interface with no extra components.
03:57 PM antto: i absolutely hate how microchip seems to put the minimum possible amount of RAM on a chip
03:57 PM NoHitWonder^: what about dsPIC ?
03:57 PM Lambda_Aurigae: kinda like using an attiny85 with the pll to do usb with v-usb.
03:57 PM NoHitWonder^: have you used that?
03:58 PM Lambda_Aurigae: NoHitWonder^, they are a 16bit pic core...still a pic core..
03:58 PM NoHitWonder^: okay
03:58 PM antto: and the squash configuration bits tight as f*ck together with ugly "gotchas"
03:58 PM antto: * they
03:59 PM antto: i am using this RTC from microchip, and i read like 3 datasheets for it and i'm still not sure if my code will deal with it properly
03:59 PM antto: and guess what?
04:00 PM antto: i go to their website to look for those datasheets - and i open the link to a given document - the website turns into japanese, and gives me a japanese version of the pdf
04:00 PM antto: i go back to the previous page (thinking i clicked something wrong) and i carefully click the "right" thing - still japanese
04:01 PM antto: i almost quit at that point.. but for some reason i wanted to see the japanese page again, so i clicked on the link again - boom, opens in english now o_O
04:01 PM antto: on the next document - same story, this time it cycled (randomly) between japanese, chinese, and english
04:01 PM antto: dafuq microchip?
04:02 PM antto: they must be trolling me
04:02 PM antto: mcp795w is the RTC i'm talking about
04:06 PM antto: and there are a bunch of 8bit pics with literally a few bytes of RAM
04:07 PM antto: do they find that cute?!
04:09 PM hetii: Hi :)
04:10 PM antto: i really hope they don't apply their "vision" onto avr
04:10 PM hetii: Q: whats are pros/cons to use -std=gnu99 for avr-gcc ?
04:10 PM antto: i use -std=c++11 ;P~
04:11 PM antto: hetii that would be equivalent to c99 but with "gnu" extensions
04:12 PM hetii: ok bu
04:12 PM antto: pros: those extensions might be nifty and help in your specific situation
04:13 PM antto: cons: those extensions probably won't be available if you switch to a non-gnu compiler (even tho it does c99 fine)
04:14 PM hetii: well when I don`t use it then got error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
04:14 PM antto: but on the other hand, if the platform is avr, how many non-gnu compilers are there ;P~
04:14 PM hetii: when use :ATOMIC_BLOCK(ATOMIC_RESTORESTATE){
04:15 PM antto: ATOMIC_BLOCK is a macro, it uses a for loop
04:16 PM antto: maybe the macro needs to be ifdef'ed to deal with this (i assume new) gcc issue
04:16 PM hetii: I see.
04:22 PM Lambda_Aurigae: hmm..I have no problem with datasheets on the microchip website...but I always download them.
04:22 PM antto: so do i
04:22 PM antto: thing is, the URL is the same, but the content of the page comes in 3 languages.. randomly
04:24 PM NoHitWonder^: hetii you cant use for(int i = 0; i < k;i++)
04:24 PM NoHitWonder^: i think thats the problem
04:24 PM polprog: what do you think about atmel studio X ? hit or shit?
04:25 PM antto: it's based on microsoft's IDE, isn't it?
04:25 PM Lambda_Aurigae: antto, hover over the PDF icon on the right side.
04:25 PM NoHitWonder^: you have to declere the "int i" before the for loop
04:25 PM antto: Lambda_Aurigae i know..
04:25 PM Lambda_Aurigae: haven't seen atmel studio X yet.
04:26 PM antto: Lambda_Aurigae i'm telling you, when i click that, the page opens with "en" in the URL, yet the actual language in the content varies
04:26 PM Lambda_Aurigae: odd
04:26 PM Lambda_Aurigae: just did 5 times and it picked the one I picked for me.
04:26 PM Lambda_Aurigae: using firefox.
04:26 PM hetii: NoHitWonder^: thats possible, didn`t check that macro
04:26 PM Lambda_Aurigae: polprog, don't see an atmel studio X
04:27 PM antto: i even opened in two tabs one was chinese the other was in english and i switched between them - the URL was exactly the same
04:27 PM NoHitWonder^: what is atmel studio x?
04:28 PM NoHitWonder^: are they gonna change that to microchip studio
04:28 PM Lambda_Aurigae: latest I see is atmel studio 7 and that is windows only, based on microsoft visual studio
04:28 PM polprog: oh wait. im stupid. i meant mplab.forget what i said
04:28 PM Lambda_Aurigae: mplabX is good for an IDE
04:28 PM antto: hahah
04:28 PM antto: i read about a new version.. cloud based IDE
04:28 PM antto: x_x
04:28 PM NoHitWonder^: "microchip studio" was mentioned in microchips website
04:28 PM polprog: now does atmel studio 6 have some kind of emulator? im reading on some appnote that mentions some debug mode
04:29 PM Lambda_Aurigae: antto, the cloud one is another story entirely.
04:29 PM NoHitWonder^: so they might change that at some point
04:29 PM Lambda_Aurigae: polprog, yes, there is a simulator and emulator capability in atmel studio.
04:29 PM NoHitWonder^: polprog it has simulator
04:29 PM polprog: wow
04:29 PM NoHitWonder^: it good
04:29 PM NoHitWonder^: *it's
04:29 PM polprog: probably a bit more advanced than emacs then... hehe
04:30 PM NoHitWonder^: you can set debug target to simulator, that's really nice feature
04:30 PM NoHitWonder^: and i like the disassembly window as well
04:30 PM antto: real men debug with an output pin! ;P~
04:30 PM polprog: let's see if it kicks in on wine
04:31 PM NoHitWonder^: it should work with wine
04:31 PM NoHitWonder^: iirc
04:31 PM Lambda_Aurigae: polprog, riiiiight.
04:31 PM Lambda_Aurigae: never got atmel studio 6 or 7 to run stable on wine.
04:32 PM Lambda_Aurigae: did get 4 running some years back
04:32 PM Lambda_Aurigae: but nothing in there I need that I can't do on linux with linux native apps, so,
04:32 PM NoHitWonder^: i remember reading from avr freaks that it should run with wine
04:33 PM Lambda_Aurigae: I saw somewhere that it worked with one of the newer versions of crossover office.
04:33 PM polprog: i will give it a try, i have ready makefile "workchain" so no pressure there
04:33 PM Lambda_Aurigae: ok..off to worky some more.
04:33 PM polprog: if it fails, then simavr hacking is next :)
04:35 PM polprog: oh. the first video in google search turns up to be in spanish on manjaro linux. simavr off to a steep learning curve
05:02 PM hetii: GCC implements three different semantics of declaring a function inline. One is available with -std=gnu89 or -fgnu89-inline or when gnu_inline attribute is present on all inline declarations, another when -std=c99, -std=c11, -std=gnu99 or -std=gnu11 (without -fgnu89-inline), and the third is used when compiling C++.
05:02 PM hetii: ...
05:02 PM polprog: backwards compat?
05:02 PM polprog: if you ever wanted to compile stuff older than you
05:07 PM hetii: I also found this article: https://gustedt.wordpress.com/2010/11/29/myth-and-reality-about-inline-in-c99/
05:08 PM hetii: and at the end author suggest to have in one compilation unit extern inline function declaration and definition in .h files.
05:09 PM hetii: and now I wonder how this stand to c11
05:25 PM Lambda_Aurigae: polprog, I think I'm older than C
05:25 PM polprog: you probably yes
05:26 PM Lambda_Aurigae: yup...by 5 years
05:27 PM polprog: i can say im older than Go, and as old as C#
05:33 PM Casper: oh you're old!
05:35 PM polprog: no... im not :)
05:40 PM Casper: if you are older than the Go game, then... there is a slight problem with you :D
05:40 PM Casper: as it is over 3000 years old :D
05:43 PM polprog: hihi
05:51 PM Casper: ... watching paint dry would be less boring than this...
05:51 PM Casper: ... waiting for some data recovery to finish...
05:51 PM Casper: ... I watch numbers goes up and down...
05:51 PM hetii: Q: is that valid for C11 and my function at the end be inlined when possible ?: https://pastebin.com/6XFZFCrU or all other files that include foo.h will make a call ?
06:04 PM NoHitWonder^2: does inline require that external
06:04 PM NoHitWonder^2: or why are you using it
06:07 PM hetii: Well the point is that I want to have inlined methods when possible that are included from single header file.
06:07 PM hetii: but depending how I declare/define them I get different issues
06:08 PM hetii: for eg for C99 model when have in header just inline definition and for unit file(.c) have extern
06:09 PM hetii: I get warning: ‘_delay_us’ is static but used in inline function ‘delay_us’ which is not static
06:25 PM hetii: time to close eyes :) see you tommorow :)