#avr Logs

Nov 06 2018

#avr Calendar

05:19 AM gruetzko- is now known as gruetzkopf
05:30 AM kakimir: in what header I can find signal names?
05:40 AM Emil: kakimir: consider joining #avrs
05:43 AM kakimir: ?
05:48 AM kakimir: I tried EMPTY_INTERRUPT(ADC_vect);
05:48 AM kakimir: it says "appears to be a misspelled signal handler"
08:20 AM rue_bed: kakimir, there is a webpage
08:22 AM rue_bed: https://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
08:32 AM rue_bed: --
09:01 AM kakimir: rue_bed: io.h
09:01 AM kakimir: all is there
09:01 AM kakimir: i mean iotn20.h*
09:12 AM rue_mohr: https://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
09:12 AM rue_mohr: its also all described in there
09:38 AM JanC_ is now known as JanC
09:43 AM kakimir: how would you guise do one point calibration in production for internal thermometer?
09:43 AM kakimir: yes - store something in eeprom
09:43 AM kakimir: but the process
09:46 AM skz81: kakimir, wut ?
09:46 AM kakimir: infernal thermometer
09:46 AM kakimir: it has quite a lot of offset
09:46 AM skz81: what are you asking actually ?
09:47 AM skz81: Get it out of hell it will cool down :P
09:47 AM kakimir: how to calibrate it in production
09:47 AM skz81: (infernal / internal :P)
09:47 AM skz81: <kakimir> how to calibrate it in production >> You was thinking about EEPROM ?
09:47 AM kakimir: yes
09:47 AM kakimir: store offset in eeprom
09:48 AM cehteh: kakimir: note that the running circuit generates some heat the internal temperature sensor isnt much useful
09:48 AM kakimir: it is just what I need
09:48 AM kakimir: I need internal temperature
09:48 AM cehteh: ok
09:49 AM kakimir: it's sole job is to feed somewhat accurate temperature information to interpolate_bandgap_x1000 function
09:49 AM cehteh: then run it at some defined temperature (oven at 50°C or whatever) and calibrate it by that, or when you have a soldering iron which can be regulated pretty well down there use that as heat source
09:49 AM kakimir: in production*
09:49 AM cehteh: the internal sensor is pretty coarse
09:50 AM cehteh: you always need some reference, up to you how to do that
09:50 AM kakimir: can I do like.. function to code that is called by programmer somehow
09:51 AM cehteh: i dont get your question
09:51 AM skz81: yup, i don't see how you can "calibrate" in production where you don't master the environment... AFA1IK calibration DO REQUIRE a controlled environment...
09:51 AM cehteh: is it about implementation or hardware?
09:51 AM skz81: DOES*, even...
09:52 AM cehteh: not controlled envirnonment, reference is enugh, when you can put a thermometer along the chip and read that for reference
09:52 AM cehteh: but then you wont need the internal sensor :D
09:53 AM skz81: That was I thinked :)
09:53 AM skz81: inFernal sensor :p
09:53 AM kakimir: skz81: I'm fine with +-10C
09:53 AM cehteh: you could put a ds18b20 close to the chip and at bootup you measure 'ambient' and pretend that your chip has the same temperature, if thats good enough for you
09:53 AM cehteh: for +/- 10°C you dont need much calibration
09:53 AM kakimir: no space for ds18b20
09:54 AM cehteh: at least not in production
09:54 AM kakimir: this thing will be a size of dime
09:54 AM cehteh: start the system once uncalibrated in some controlled environment and store the calibration data in eeprom and done
09:54 AM kakimir: or 1eur coin
09:55 AM cehteh: you may even do 2 point calibration then
09:55 AM kakimir: hey.. programmer could write current temperature at the time of programming to eeprom
09:55 AM kakimir: then first boot
09:55 AM kakimir: right after it
09:56 AM cehteh: on some other circuit i use the reset pin to enter calibration mode and count how often the user pressed reset
09:56 AM cehteh: (for different calibrations)
09:56 AM kakimir: interesting
09:57 AM cehteh: you dont even need to disable the reset pin functionality
09:57 AM kakimir: how would that work?
09:57 AM kakimir: certainly there needs to be timing
09:57 AM cehteh: there is a register whcih stores the reset/boot up reason (brownout, reset, powerup etc)
09:58 AM cehteh: its pretty simple
09:58 AM kakimir: counter in eeprom?
09:58 AM cehteh: nah
09:58 AM cehteh: sram
09:58 AM cehteh: https://git.pipapo.org/?p=battswitch.git;a=blob;f=src/battswitch.c dig that code
09:59 AM kakimir: hmm
09:59 AM cehteh: resets dont clear the ram, its the clib which does
09:59 AM kakimir: good call
09:59 AM HighInBC: love those state machines
09:59 AM cehteh: but you can put variables in the noinit section then its preserved
10:00 AM kakimir: so you need counter and flag?
10:01 AM polprog: state machines are the best
10:02 AM kakimir: I have a confession
10:02 AM kakimir: I have never used EEPROM
10:05 AM HighInBC: eeproms are not the difficult to use, especially if you use a library. Just remember they have a limited number of writes
10:05 AM kakimir: hmm I could do 2point calibration but i maybe wouldn't work with my manuf
10:06 AM HighInBC: not that difficult
10:06 AM kakimir: HighInBC: I have seen devices crippled by extensive writing to eeprom
10:06 AM HighInBC: from memory it is in the order of 10,000 writes
10:06 AM HighInBC: which if you put a write into your main loop you will hit in seconds
10:06 AM HighInBC: a common error
10:07 AM HighInBC: I typically use it for settings and the user initiates the save
10:07 AM HighInBC: few people chance the settings 10k times
10:07 AM HighInBC: change
10:07 AM kakimir: yes
10:08 AM kakimir: take those counters you press with thumb and number increments
10:08 AM kakimir: you don't just press it 10k times
10:08 AM kakimir: if you do it takes a while
10:10 AM kakimir: how about rotating address?
10:13 AM kakimir: running number, data, write confirm flag
10:13 AM kakimir: constant lenght data
10:14 AM kakimir: search function to find the tail of it
10:15 AM cehteh: kakimir: generally i hate 'delay()' and related functions, but its a good practice to add a loooong delay() right after(or before) you programmed the eeprom at least for debug builds
10:15 AM cehteh: then a) you become aware that you must not program eeprom in time critical parts
10:15 AM cehteh: and b) you cant wear out the eeprom in no go
10:17 AM cehteh: once your program works and goes into production you can reduce or remove this delay
10:17 AM kakimir: it would not be in mainloop
10:17 AM kakimir: just in init
10:17 AM kakimir: but: noted
10:18 AM cehteh: init can be bad enoughm because with some error (like division by zero) your may stuck in a boot loop
10:19 AM cehteh: you may also toggle some leds when states change/ boot is complete / eeprom is erased or something like that, helps debugging
10:29 AM kakimir: good point
10:30 AM kakimir: add bootup delay
11:10 AM kakimir: can I call interrupt from thread?
11:11 AM kakimir: I have 2 interrupts that could be used directly to initialize state
11:21 AM McDonaldsWiFi: MISO horny
11:21 AM LeoNerd: thread?
11:21 AM kakimir: whatever I did it already
11:21 AM kakimir: :I
11:22 AM kakimir: nice interference pattern of timer interrupts on pulse view
11:22 AM kakimir: lcsoft mini board
11:22 AM kakimir: SPI debug bytes
11:31 AM kakimir: atmel studio
11:32 AM kakimir: what is your opinion?
01:48 PM gruetzkopf is now known as gruetze
01:48 PM gruetze is now known as gruetzko-
01:48 PM gruetzko- is now known as gruetzkopf
05:07 PM [1]MrMobius is now known as MrMobius
05:13 PM devinmcelheran: Hi, I was wondering if anyone knows of any tutorials for AVR that are more generic rather than fixating on a particular chip. I have some ATTiny45s and some Arduino boards that I'd like to learn to use in a more bare-metal way, but it seems the jump from Arduino to raw mCU is pretty rough. Most of the documentation I can find (books and other thorough pieces) are for specific chips and/or older stuff.
05:14 PM Emil: devinmcelheran: consider joining #avrs
05:14 PM wondiws: Emil, what is this rivalry?
05:15 PM nohit: its not rivalry
05:15 PM wondiws: devinmcelheran, I was taught on Atmega32, but I also use Atmega328p, atmega8, atmega32u4 and a few others
05:15 PM wondiws: so it's not very difficult to adapt from one chip to another
05:16 PM wondiws: ok then, why are there two channels now?
05:17 PM nohit: some people are fed up with rue. but you can be on both channels, you dont have to choose. #avrs is way more active than this
05:18 PM nohit: and we have a bot that spits out avr datasheets
05:19 PM wondiws: nohit, this looks rather silly to me though
05:31 PM devinmcelheran: wondiws, the issue is that I don't have these other parts to follow the part specific guides.
05:41 PM wondiws: devinmcelheran, then you just use the part you do have
05:54 PM devinmcelheran: So, (forgive my ignorance) I can let the C macros do the heavy lifting with respect to the differences between the parts?
05:54 PM LeoNerd: I usually do a combination of that, and a HAL
06:28 PM rue_mohr: any questions left?
06:32 PM LeoNerd: Left?
06:44 PM rue_mohr: right!
08:03 PM eadthem: hey
08:20 PM kline: hi
08:25 PM rue_mohr: hmm
08:26 PM rue_mohr: who can spot a properly rotated unity matrix by eye?
08:42 PM eadthem: whats a unity matrix
08:42 PM eadthem: maybe i can
08:46 PM rue_mohr: hahah
08:47 PM rue_mohr: thats like asking a blind man to spot the alien
09:01 PM rue_mohr: huh, there is a problem somewhere
09:08 PM eadthem: well theres your problem
09:12 PM rue_mohr: ok, basic manipulations of a point work if I dont multiply the matricies
09:13 PM rue_mohr: ok, operation stacking
09:13 PM rue_mohr: now I ahve to think
09:14 PM rue_mohr: we want to do a scale, translate, and rotate
09:15 PM rue_mohr: 1,0
09:15 PM rue_mohr: translate 0,1
09:15 PM rue_mohr: scale 2,2
09:15 PM rue_mohr: rotate 90
09:15 PM rue_mohr: SHOULD be -2,2
09:15 PM eadthem: and this math is in arduino?
09:15 PM eadthem: err AVR
09:15 PM rue_mohr: haha I'm int eh wrong channel
09:15 PM eadthem: lol
09:15 PM rue_mohr: wtf???
09:16 PM rue_mohr: rue! race you back to #robotics!
09:16 PM eadthem: well the channel hasnt been dead for a while because of it
09:17 PM rue_mohr: (it came out wright not using the matrix multiply
09:34 PM rue_mohr: the 3x3 * 3x3 matrix multiply was backwards
09:34 PM rue_mohr: it was B*A instead of A*B
09:34 PM rue_mohr: so, fixed
09:34 PM rue_mohr: 2 hrs for a matrix library, hmm
09:36 PM * rue_mohr zooms out
09:36 PM rue_mohr: hmm
09:37 PM rue_mohr: I did that becasue I want to compile a transform set and apply it to a list of arbitrary objects
09:41 PM eadthem: hey on the AVR side, If multiple interups hit at once on AVR,
09:41 PM eadthem: do the ones not serviced first get saved and end up serviced right after
09:41 PM eadthem: or are they just lost
09:56 PM rue_mohr: as long as the flag it set
09:56 PM rue_mohr: it'll call the interrupt
09:56 PM rue_mohr: for example
09:56 PM rue_mohr: if you have a timer overflow interrupt while the mask bit for it is not set
09:57 PM eadthem: so each interupt has its own flag
09:57 PM eadthem: and it keeps calling handlers till there all cleared
09:57 PM rue_mohr: then as soon as you set the mask bit to allow the intterupt it'll happen immediatly
09:57 PM rue_mohr: yes
09:57 PM eadthem: awsome
09:57 PM rue_mohr: there is a priority tho
09:57 PM eadthem: yep i know that part
09:57 PM rue_mohr: so if one flag wont give up, the rest wont see their day in the sun
09:58 PM rue_mohr: but to my knowledge an interrupt wont interrupt an interrupt
09:58 PM rue_mohr: unless you try
09:58 PM rue_mohr: (by playing with sie()?
09:58 PM rue_mohr: sei()
09:58 PM rue_mohr: whatever
10:00 PM eadthem: im not sure yet, but i prob will write this in asm
10:00 PM eadthem: temp controller for my JBC wand and tips
10:01 PM rue_mohr: hm
10:01 PM rue_mohr: I have a temp controller project on the shelf
10:01 PM eadthem: this is a bit interesting
10:01 PM rue_mohr: I want to use RC curves to predict platough temps for a given power level
10:02 PM eadthem: using photoelectric VOM1271's to control mosfets for controlling AC power
10:02 PM eadthem: there are 2 tips to run
10:02 PM rue_mohr: oh , are those... the
10:03 PM eadthem: low power 2.44 ohms and high power 6.66 ohms and the rated current is about say 5-6 maybe 6.5 amps max
10:03 PM eadthem: so low power has to be drivinen with 16-20 volts and high power with 40 to 44 volts
10:03 PM eadthem: and they fit in the same wand, so it has to autodetect and choose the right winding tap or else
10:04 PM rue_mohr: aha H11F1
10:04 PM eadthem: h1f1?
10:05 PM rue_mohr: H11F1
10:05 PM rue_mohr: http://www.synthdiy.com/show/?id=4111
10:05 PM eadthem: same idea
10:05 PM rue_mohr: cool
10:05 PM eadthem: the drive current on these is insanely small 700uA
10:05 PM rue_mohr: your using the fets in switching mode, tho, right?
10:05 PM eadthem: but it gets the fets on fast enough
10:06 PM eadthem: o ya, SOA and probably going to try to mantain zero crossing switching
10:06 PM rue_mohr: or are yours the voltage generating ones?
10:06 PM eadthem: yes
10:06 PM eadthem: they gen about 9V
10:06 PM rue_mohr: oh I didn't get any of those
10:06 PM rue_mohr: I saw them tho
10:06 PM eadthem: BSC190N15NS3 mosfets
10:06 PM rue_mohr: mhm
10:06 PM rue_mohr: 190V 15A?
10:06 PM eadthem: marco reps on youtube lead me on to them
10:07 PM eadthem: no 19mOhm 150V
10:07 PM rue_mohr: hehehe
10:07 PM rue_mohr: ok
10:07 PM eadthem: i could go lower voltage but i would be very very close on SOA if the wrong tip power was choosen by the controller
10:07 PM eadthem: or there was a momentary short when hotswapping tips
10:07 PM rue_mohr: nothing like staring at a pcb trying to guess the date of it by the date codes
10:07 PM eadthem: :p
10:08 PM eadthem: there also 50Amp again thats so i stay within SOA
10:08 PM rue_mohr: 1204 like 2012 or 2004? :)
10:08 PM eadthem: 2012 week 4 normaly
10:08 PM rue_mohr: normally
10:08 PM eadthem: for that situ i check several
10:09 PM eadthem: odds are the week will show itself
10:09 PM rue_mohr: yea, it can be hard casue a lot of them letter their years
10:09 PM eadthem: the board is a easy one normaly
10:09 PM eadthem: there datecoded as well
10:09 PM rue_mohr: and telling that apart of obscure part numbers
10:09 PM eadthem: or at work we have them datecode the board rails, no room in the circut
10:09 PM eadthem: o datecodes on boards are easy
10:09 PM eadthem: there normaly 7 seg style
10:10 PM rue_mohr: well, geez, I wrote the matrix library and now I feel done for the night
10:10 PM rue_mohr: I dont even know why, I just told myself I'd need it
10:11 PM rue_mohr: my libraries are gaining mass tho
10:11 PM rue_mohr: that matrix library needs the 2d library that needs the 'stuff' library
10:11 PM rue_mohr: stuff is things like rads2degs()
10:12 PM eadthem: marco made this weard TC amp design
10:12 PM eadthem: its like the output is a votlage divider
10:12 PM eadthem: it works, but im trying my hand at maybe a better one
10:12 PM rue_mohr: no tc amp chips around, w/cj compensation?
10:12 PM eadthem: naw
10:13 PM eadthem: its a soldering iron
10:13 PM eadthem: +-5 C is ok
10:13 PM rue_mohr: hmm
10:13 PM eadthem: besides with 250W of power, i can run it at 260C for 217 temp lead free and solder just fine
10:13 PM eadthem: thats why JBC is awsome
10:14 PM rue_mohr: it was a long time before I learned about tip mass
10:15 PM rue_mohr: the 20lb soldering iron thats 800w and cant melt solder
10:15 PM eadthem: google C470-013
10:15 PM eadthem: and C245-944
10:15 PM eadthem: might need to add JBC to the end
10:15 PM rue_mohr: lowest price, garunteed!
10:15 PM eadthem: generaly there 30-50$ each tip/cartrage
10:15 PM rue_mohr: ah there, yea ok
10:16 PM eadthem: although there are special ones, say the solder pot cartrage that are more expensive
10:16 PM rue_mohr: mhm, hakko, 963 :)
10:16 PM rue_mohr: 963?
10:16 PM rue_mohr: anyhow, I think they were liquidating
10:16 PM rue_mohr: I have 5 pens what were like $5 ea
10:16 PM eadthem: i had a xytronic but it died, essentaly a hakko type handpece with a diffrent power unit
10:17 PM rue_mohr: I bought the controller and make the power unit
10:17 PM eadthem: same for JBC
10:17 PM eadthem: wand was like 110$
10:17 PM rue_mohr: no way I'm having a 15lb transfomer shipped from china
10:17 PM eadthem: oh i got a place for you
10:17 PM eadthem: http://www.antekinc.com/as-3220-300va-20v-transformer/
10:17 PM rue_mohr: I had a really good toroid from some medical equip
10:17 PM rue_mohr: I get stuff from the hospital
10:18 PM eadthem: https://www.jbctools.com/c245-cartridges-product-19-category-4-menu-4.html
10:18 PM rue_mohr: intersting, mines larger than that
10:19 PM eadthem: for the xformer, they make many power levels and in 2V increments
10:19 PM eadthem: and at what i say is a fair price
10:19 PM rue_mohr: yea, free, I'm ok
10:20 PM rue_mohr: "uh, guys... are you getting rid of those 25 hospital beds outside with the actautors???"
10:21 PM rue_mohr: ":D ok then! let me help with that!"
10:22 PM rue_mohr: its the 6th, if I'm gonan order anything before 11.11 I better work out what I want
10:22 PM rue_mohr: (to beat the shipping rush)
10:22 PM eadthem: ya hard to beat free
10:22 PM eadthem: but still i was looking at alot of hand winding before i found that company
10:22 PM eadthem: or a month shipping
10:25 PM rue_mohr: http://paste.debian.net/1050707/
10:25 PM rue_mohr: getting to be quite the set of libraries
10:27 PM eadthem: btw is there a decent AVR studio for linux?
10:27 PM eadthem: simulation is nice, but ile settle for just asm and AVR ISP II upload
10:27 PM rue_mohr: yes, nedit and make
10:28 PM rue_mohr: avrsimul
10:28 PM rue_mohr: tho I dont simulate
10:28 PM eadthem: its been a while
10:28 PM rue_mohr: if you simulate, you end up with things that work only on simulators
10:28 PM eadthem: im debating on this
10:28 PM eadthem: i mean 20Mhz or 16Mhz vs 120 Hz
10:28 PM rue_mohr: ask, I can give you great makesfiles
10:28 PM rue_mohr: for most of the common chips
10:28 PM rue_mohr: make; make install
10:29 PM eadthem: i shuld have no issue doing zero crossing temperature mesurements and swtiching
10:29 PM eadthem: even if i use c++
10:29 PM eadthem: mega16 / 164?
10:29 PM rue_mohr: no, c++ will melt your project
10:30 PM eadthem: worked wonderfuly last time i did it
10:30 PM eadthem: but i just used static objects,
10:30 PM eadthem: no stdlib
10:30 PM rue_mohr: c++ is not efficient on anyting
10:31 PM rue_mohr: mmm the magic hat library, that was a nice one
10:31 PM rue_mohr: I made an ascii graph library!?
10:32 PM eadthem: for asm and c++
10:32 PM eadthem: yes
10:33 PM rue_mohr: hmm I'll want to mod my dxf libary to do colour
10:33 PM rue_mohr: that'll be fun, there are about 80 things that can define the colour of an entity
10:33 PM eadthem: mmm one sec aparently i made .c .cpp .h are blocked on my web server
10:34 PM * rue_mohr grumbles "c++ is stupid"
10:37 PM eadthem: mmm graph
10:37 PM eadthem: ya missed that part
10:37 PM eadthem: this is char lcd's only
10:38 PM eadthem: http://www.ossmmorpg.com/public/LCDtest/lcdlib/lcdlib.h
10:38 PM eadthem: feel free to cd .. that
10:38 PM eadthem: but i bet everyones got a char lcd lib this one is c++
10:38 PM eadthem: barely
10:46 PM eadthem: for asm http://www.ossmmorpg.com/public/lcdp/
10:46 PM eadthem: alot older
10:59 PM rue_mohr: oh hell no, everyone has written a 447880 library
10:59 PM rue_mohr: I use someone elsese, it works fine
10:59 PM rue_mohr: I modded it a bit so I can put the display on a '595
10:59 PM rue_mohr: or even a 74165 164?
11:00 PM rue_mohr: I'm really glad people dont come in asking how to write an lcd library anymore
11:00 PM rue_mohr: I suppose tht went away with arduino
11:00 PM rue_mohr: just thing, arduino isn using one of the horrid libraries soemone wrote
11:01 PM rue_mohr: -rwxr-xr-x 1 dan dan 20 Nov 19 1998 /files/Installs/Dos/hello.com
11:02 PM rue_mohr: back in the dos days, people would NOT beleive me when I said that hello world could be done in 20 bytes
11:02 PM rue_mohr: its the same reason I lothe c++
11:02 PM rue_mohr: it makes everything larger and slower than it needs to be
11:03 PM rue_mohr: IT DOES
11:03 PM rue_mohr: thats why os' aren't written in c++
11:03 PM Thrashbarg: you'd cause a massive argument in ##electronics with some of the people there :P
11:03 PM rue_mohr: hell, windows had to use the pascall calling convention
11:04 PM Thrashbarg: I thought Mac OS was Pascal
11:04 PM Thrashbarg: 1 through 6
11:04 PM rue_mohr: widnows uses the pascall method for calling functions
11:04 PM rue_mohr: casue the c one isnt' good enough
11:04 PM Thrashbarg: yup
11:50 PM day__ is now known as day