#avr | Logs for 2016-02-09

Back
[02:33:49] <hetii> Hi :)
[02:37:04] <Xark> Hello.
[03:04:34] <Jartza> allo
[03:05:51] <cehteh> 'lo
[03:32:02] * Xark plays with his newest toy -> http://www.saanlima.com/pepino/index.php?title=Welcome_to_Pepino
[03:50:28] <Jartza> oh, I've been thinking to start learning fpga
[03:50:37] <Jartza> "Saanlima Electronics"
[03:50:48] <Jartza> saanlima in finnish translates freely to "I get mucus"
[03:51:38] <Xark> I am guessing the own is not from there. :)
[03:51:41] <Xark> owner*
[03:51:55] <Jartza> https://translate.google.fi/#fi/en/saan%20lima
[05:01:09] <Lambda_Aurigae> anonnumberanon, in that link you posted originally, no, you can't use an atmega328 in place without changes to both software and hardware. The attiny45 uses the onboard pll to sync up to the usb clock. The atmega328 does not have that capability. You would need an external crystal or clock and to also change the software to match.
[05:07:04] <cehteh> Jartza: isnt "Saanlima" the name of one of the zillion mosquito ponds in finnland? .. i mean for every finnish word there is a lake named alike or?
[05:08:56] <Jartza> no, most of them are called pyhäjärvi
[05:08:57] <Jartza> ;)
[05:09:23] <Jartza> https://en.wikipedia.org/wiki/Pyh%C3%A4j%C3%A4rvi_(disambiguation)
[05:10:12] <Jartza> but the most common name for small ponds is "mustalampi"
[05:10:17] <Jartza> which translates to "black pond"
[05:10:23] <Jartza> there are 391 mustalampis in finland
[05:10:46] <cehteh> hehe k
[05:10:51] <Jartza> http://www.jarviwiki.fi/wiki/Mustalampi
[05:11:53] <Lambda_Aurigae> and not one single mosquito?
[05:12:00] <Lambda_Aurigae> they are all married with large families.
[05:12:01] <Jartza> ahvenlampi (perch pond) 335, haukilampi (pike pond) 265, saarijärvi (island lake) 198....
[05:12:52] <Jartza> someone ran out of imagination while naming those
[05:13:54] <Jartza> wtf. there are 106 lakes called "paskolampi"
[05:14:02] <Jartza> translates freely to "shitty pond"
[05:14:03] <Jartza> :D
[05:15:53] <Lambda_Aurigae> we have those here...called sewage lagoons..
[05:16:41] <Jartza> yea, I was thinking that maybe those were the ponds they threw all the sewage water before they invented sewers
[05:17:31] <Lambda_Aurigae> in rural areas where the ground is too hard for septic tanks and leach fields they just dump the sewage into open ponds and let it fester and break down in the open air.
[05:32:31] <Jartza> illegal in finland :)
[05:33:11] <Jartza> we use ripping sewage pumps, they even pump uphill
[05:33:42] <Jartza> here where I live we only have pressurised sewage
[05:33:55] <Jartza> each household has their own pump
[05:34:07] <Jartza> it's sort of like a huge blender with a pump :D
[05:44:53] <Lambda_Aurigae> those exist here too, specially for basement bathrooms and such below the level of the sewers.
[05:45:36] <Lambda_Aurigae> there is an apartment complex in kansas city that is built deep down in a salt mine that has those too. I worked construction on it for a few months way back when.
[05:45:48] <Lambda_Aurigae> no windows, air pumped in.
[05:45:53] <Lambda_Aurigae> shit pumped out.
[05:45:56] <Jartza> :)
[05:45:59] <Jartza> sounds fun
[05:45:59] <Lambda_Aurigae> underground parking and everything.
[05:46:06] <Lambda_Aurigae> I would have loved to live there.
[05:46:12] <Lambda_Aurigae> air is super dry though.
[05:46:18] <Jartza> I bet
[05:46:37] <Lambda_Aurigae> they even put in a mcdonalds underground.
[05:46:42] <Gerritjan> when i do not add #include <Arduino.h> i get all the DDRA and Pin undeclared but when i add it i get the following errors chip.h no such file or Directory and conflicting types for 'utoa' what do i need to do
[05:46:52] <Lambda_Aurigae> and a gas station just outside the entrance.
[05:47:28] <Lambda_Aurigae> Gerritjan, if you are going to use arduino, just use the arduino stuff all the way...otherwise don't bother.
[05:47:49] <Lambda_Aurigae> I suggest asking that question on #arduino channel too.
[05:48:17] <Gerritjan> oke because im programming sam3x8e thats why im asking hehe :S
[05:48:44] <Lambda_Aurigae> well, that is definitely for a different channel.
[05:48:51] <Gerritjan> im waiting on my arm board :D
[05:49:09] <Lambda_Aurigae> didn't even know they made arduino libs for sam3 chips, but, anything is possible.
[05:49:25] <Gerritjan> Arduino due
[05:49:48] <Lambda_Aurigae> guess you need that kind of processor power to get an arduino to run a decent speed.
[05:51:00] <Gerritjan> yea but im getting stm32f401RE board
[05:51:34] <Gerritjan> i did try to find a cheap faster board but they are not that cheap :d
[05:52:24] <Gerritjan> stm32f401RE is like 10 euro
[05:55:30] <Jartza> yeah, nucleo board
[05:57:44] <Gerritjan> yea
[06:00:20] <Gerritjan> only i dont know if i can get enough frames from a cam.
[06:00:59] <Gerritjan> because i got 84Mhz chip on it
[06:03:11] <Jartza> what cam and what frames?
[06:04:02] <Gerritjan> rs232 cam fps
[06:22:25] <Gerritjan> NUCLEO-F446RE if i buy this 1 do i need a programmer or debugger with it? or does it use the 1 onboard with arm software
[06:24:41] <Lambda_Aurigae> it appears to have a programmer built in.
[06:25:15] <Gerritjan> yes but does like keil accept the programmer / debugger
[06:25:22] <Lambda_Aurigae> I would recommend reading the datasheet
[06:25:34] <Gerritjan> oke :D
[06:25:40] <Gerritjan> 9.18 euro :D
[06:28:11] <Gerritjan> selection-mode switch to use the kit as a standalone ST-LINK/V2-1 :D so i can use the debugger / programmer onboard :D
[06:37:19] <Gerritjan> im sure im gone buy this 1 for my project :D
[07:25:13] <Jartza> all nucleo boards have st-link v2 (at least the new ones) built-in
[07:26:13] <Jartza> the only minus-side is, if you're thinking of making a product using one of those chips (not just one hobby-product), be aware that some of the chips actually cost more than the nucleo board with that mcu :) :)
[07:26:23] <Jartza> it's called subventing
[07:44:42] <jben> 'ai perdu
[07:44:53] <jben> wrong chan
[09:43:46] <Emil> Hello
[09:44:01] <Emil> does anyone have example code for m644?
[09:44:14] <Emil> to get 16 bit pwm working
[09:44:35] <Emil> The datasheet isn't really helpful with it
[09:45:52] <cehteh> m644?
[09:47:02] <cehteh> ah mega
[09:47:25] <cehteh> is there anything different to other 8bit atmels? or whats the problem?
[09:48:56] <cehteh> doesnt look diffferent to me
[10:14:27] <Emil> cehteh: I'm having a lot of trouble getting the 16 bit timer to work nor is there any clear indication of which port will act as output on compare match
[10:15:35] <cehteh> you have to configure/enable that
[10:21:22] <cehteh> Emil: TCCR1A ..
[10:26:55] <Emil> cehteh: no shit
[10:27:05] <Emil> but the datasheet isn't clear enough on what registers to use
[10:27:18] <cehteh> to me its crystal clear
[10:33:14] <Deskwizard> yeah, can't be clearer... just look at the table.
[10:33:47] <Deskwizard> set the bits according to whatcha want, bingo!
[10:33:52] <Deskwizard> (winning, not the dog.)
[12:31:37] <t4nk646> hello, is there someone who would like to help me?
[12:33:14] <t4nk646> nobody responding here?
[12:34:22] <sebus> t4nk646 just be patient...
[12:35:42] <t4nk646> ok i will wait :)
[12:35:53] <jancoow> Hi. I'm trying to understand and programming timers on atmega128. I want to let my programm interupt each second for doing something. So to do that, i want my prescaler on 1024 so that the counter is "slower". But this doesn't work at all, the timer should interupt on 0.01 seconds (according a calculator), but it's waaaay faster. Could someone explain me why this isn't working? https://jancokock.me/f/0872f
[12:36:57] <jancoow> and my ISR : https://jancokock.me/f/7ee94
[12:40:03] <CasperAtWork> t4nk646: it would be faster if you actually say your issue
[12:40:09] <Jartza> indeed
[12:40:21] <Jartza> hard to help, if we don't know what is the issue
[12:40:53] <CasperAtWork> jancoow: timer 8 bits? what F_CPU?
[12:41:25] <jancoow> CasperAtWork: Yes i want to use the 8 bit timer. Its 16mhz
[12:41:48] <CasperAtWork> my math ends up at ~ 1/61 of a seconds
[12:42:01] <t4nk646> I am getting this error: avrdude.exe: verification error, first mismatch at byte 0x0000 0xff != 0x0c avrdude.exe: verification error; content mismatch (using http://www.banggood.com/5V-USBASP-USBISP-AVR-Programmer-Download-Cable-With-10-Pin-Cable-Case-p-931222.html and a kk2.1.5 board)
[12:42:54] <CasperAtWork> so what you can do is: /1024, use a global variable, increase the count at every overflow, count 61 of them and you have close to 1 second
[12:43:16] <Jartza> t4nk646: what chip, how are the fuses set, internal or external oscillator?
[12:43:37] <CasperAtWork> or, set top at 125, count 125, and you have exactly 1 seconds... or is it 124/124.... brain don't work well today
[12:44:18] <CasperAtWork> with /1024, the timer will count up by 1 every 1024 clock cycle, 8 bits is 256 count, so 1024*256 cycles per overflow
[12:44:47] <jancoow> CasperAtWork: Timers are really difficult for me. Why do you get on 1/61 ? My ISR is set up for compare, not for overflow ?
[12:45:09] <t4nk646> its this board: http://www.hobbyking.com/hobbyking/store/__54299__Hobbyking_KK2_1_5_Multi_rotor_LCD_Flight_Control_Board_With_6050MPU_And_Atmel_644PA.html so chip is Amtel 644PA.
[12:45:23] <CasperAtWork> 16000000/1024/256 = 61.something
[12:45:41] <CasperAtWork> so 61.something overflow per seconds, so each overflow is 1/61
[12:46:22] <cehteh> uhm .. dont use 8 bit controller for multirotor
[12:47:47] <jancoow> CasperAtWork: I've a feeling that not only my calculation is wrong; When i remove al the code in ISR some leds on the board are still blinking. Is it in pwm mode or something? Really confusing.
[12:48:00] <cehteh> heh
[12:48:14] <cehteh> did you flash anything at all :D
[12:48:21] <jancoow> yes
[12:48:31] <cehteh> some boards come pre-flashed with bootloader and 'blink' example
[12:48:46] <jancoow> i ensure you that i flash it :)
[12:48:59] <cehteh> anyway .. i have some code for timing and a table about overflows .. moment
[12:49:04] <t4nk646> i flyed with it before.. it went fine, i only like to update this board. how can i check the fuses? (sorry, i'm not so very technical)
[12:49:29] <Jartza> oh, probably the fuses are set to default
[12:49:54] <Jartza> or, I mean, set to something for the old firmware
[12:49:55] <cehteh> http://paste.debian.net/379388/
[12:50:42] <jancoow> well, i doesn't want only the code, i really want to understand it. And i've a feeling that i set some wrong registers
[12:50:57] <Jartza> t4nk646: always the first suggestion is to try adding -B4 parameter to avrdude, which slows down the communication
[12:50:58] <jancoow> cehteh: thanks, that's a nice table! :)
[12:51:04] <cehteh> so with 16Mhz and /1024 8 bit overflows each 16.384 ms
[12:51:16] <cehteh> well its tied to my implementation
[12:51:23] <cehteh> but you may get some ideas
[12:51:29] <Jartza> the other hint is to check that the programming cable is connected correctly and that you provide power for the board
[12:52:43] <jancoow> cehteh: is it good that i'm using timer2 on atmega128? Isn't this the 16 bit timer?
[12:53:09] <cehteh> that should last way longer (256 times :D)
[12:53:25] <t4nk646> my command: C:\Users\Desktop\avrdude\windows\avrdude.exe -C C:\Users\Desktop\avrdude\windows\avrdude.conf -p m644p -P usb -c usbasp -e -U flash:w:C:\Users\Desktop\kk2\tmp\KK2V1_1V19S1Pro.hex:i -B4
[12:53:42] <cehteh> i only use 8 bit counters yet, because i wanted to make that work first
[12:53:50] <Jartza> put the -B4 before -U
[12:53:54] <jancoow> me to, i want the 8 bit
[12:54:04] <jancoow> so then i need to use TCCR0 i think, according the documentation
[12:54:14] <t4nk646> my board is powered on, and i checked the connections.. see: http://lazyzero.de/en/modellbau/kkmulticopterflashtool last image
[12:54:16] <Jartza> also, I haven't used "-P usb" ever with usbasp, but might be that it doesn't hurt
[12:54:23] <cehteh> yes
[12:55:13] <Jartza> t4nk646: you have made the correct 10-to-6-pin cable?
[12:55:20] <cehteh> jancoow: http://public.pipapo.org/pulseview2.png
[12:55:40] <t4nk646> http://www.hobbyelectronica.nl/product/10-pin-naar-6-pin-adapter-voor-avrisp-mkii-usbasp-stk500/
[12:55:42] <t4nk646> that one
[12:55:52] <cehteh> channel 3 are the overflow interrupts .. channel 2 is when the main loop wakes
[12:56:31] <cehteh> channel 5 in a blinking led
[12:56:44] <jancoow> wow, did you make that for me? :D
[12:57:06] <cehteh> so frequent overflows .. but when toggling the the led is due it triggers tha with a comparematch
[12:57:15] <cehteh> no i just had them on my server :)
[12:57:52] <jancoow> cool
[12:57:55] <jancoow> but it all make sense!
[12:58:08] <cehteh> http://public.pipapo.org/pulseview1.png
[12:58:32] <jancoow> so if i set the OCR0 register with a specific value, that would be my compare match, and if there is a match there would be a interupt ?
[12:58:43] <cehteh> yeas
[12:58:56] <cehteh> here this is an empty interrupt, only wakes the main loop
[12:59:25] <cehteh> main loop does the dirty work, checking a priority queue if any event is due and then executes it
[13:00:18] <cehteh> the priority queue uses a sliding window implementation so you can always add events up to some limited time (4000something) ms in the future
[13:01:20] <cehteh> toggle_green_timed (const struct muos_spriq_entry* event) {
[13:01:20] <cehteh> PIND = _BV(PIND3); muos_clpq_repeat (event, MUOS_CLOCK_MILLISECONDS (250));
[13:01:23] <CasperAtWork> jancoow: if you remove the interrupt function, yet you set the interrupt, then the AVR reset when the interrupt fire
[13:01:31] <CasperAtWork> EW... _BV....
[13:01:34] * CasperAtWork vomits
[13:02:04] <cehteh> heh
[13:03:27] <Jartza> t4nk646: hmm. you tried the -B4 before -U ?
[13:03:30] <Jartza> and still the same problem?
[13:04:46] <jancoow> cehteh: so if i doesn't decalre a ISR it wakes the mainloop?
[13:05:39] <cehteh> nah it needs a ISR .. but there is a special EMPTY_INTERRUPT() macro
[13:05:45] <t4nk646> @Jartza yes, i tried it now.. still same problem
[13:06:00] <t4nk646> how can i tag you lol :)
[13:06:16] <cehteh> just a optimization to return asap from the interrupt
[13:06:19] <jancoow> t4nk646: it's not twitter here..
[13:06:25] <cehteh> you still need to enable interrupts
[13:06:39] <jancoow> yes, it looks like it works now!
[13:06:43] <cehteh> and have proper handlers, be it empty or doing something
[13:07:41] <jancoow> cehteh: i'm all new to C and microcontrollers so it's sometimes really hard for me to understand :)
[13:08:04] <cehteh> you just jumped into the advanced stuff :D
[13:08:26] <t4nk646> sorry, shame on me but my last command: C:\Users\Desktop\avrdude\windows\avrdude.exe -C C:\Users\Desktop\avrdude\windows\avrdude.conf -p m644p -P usb -c usbasp -e -B4 -U flash:w:C:\Users\Desktop\kk2\tmp\KK2V1_1V19S1Pro.hex:i
[13:09:23] <jancoow> cetheh: is this advance stuff? I like PWM and i think i need pwm for this :)
[13:09:36] <jancoow> uhm, i need timers for pwm *
[13:09:44] <cehteh> jancoow: you want a timer or pwm?
[13:09:55] <cehteh> timer as in wall clock i mean
[13:10:05] <cehteh> and executing things at different times
[13:10:15] <jancoow> currently i'm creating a simple clock just for learning how these timers work
[13:10:33] <cehteh> study the datasheet ... carefully
[13:10:41] <t4nk646> i am also getting this warning, also with -B4: avrdude.exe: set SCK frequency to 187500 Hz avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
[13:10:45] <jancoow> yeah i have it right in front of me :)
[13:10:54] <cehteh> its not that complicated, but there are some things you must know
[13:13:33] <jancoow> yeah, like register value's
[13:14:36] <cehteh> the different PWM modes, at least when you do something serious
[13:15:14] <jancoow> i see a lot of different modus indeed
[13:15:27] <cehteh> default just generates some 'useable' pwm thats ok. but there are some tweaks for faster operation or phase correct pwm
[13:15:29] <jancoow> is it possible to set the duty cycle?
[13:15:41] <cehteh> that all about
[13:16:17] <cehteh> you have a counter which in hardware counts from 0 to 255 (or some other value) wraps over and repeats
[13:16:17] <jancoow> ah :)
[13:16:43] <jancoow> Well, let's first expirment with just the timers itself
[13:16:53] <cehteh> and you have one of this compare match registers .. when that value is reached the output flips
[13:17:06] <jancoow> i still having some timing issues; it still isn't 1 second ;p
[13:17:08] <cehteh> (i am simplifying)
[13:17:25] <jancoow> as i readed, there are 2 compare match register per timer?
[13:17:31] <cehteh> yes
[13:17:50] <cehteh> (few atmels have 3)
[13:18:38] <cehteh> well in the (default) easiest case the counter just counts from 0 to 255 an wraps over
[13:19:16] <cehteh> and OCR0A for example at 127 .. thats the middle, defines the point where to switch the output
[13:19:30] <cehteh> so with 127 you have 50% duty cycle
[13:20:09] <cehteh> with 63 you have 25% duty cycle and so on (pluss a lot options to configure it in other ways)
[13:23:28] <jancoow> ah right! That sound logic!
[13:24:04] <cehteh> and i am out, gn8
[13:24:56] <jancoow> Gn ! Thanks for your help
[13:24:59] <jancoow> u are my hero! :)
[13:25:05] <t4nk646> Jartza, are you still looking for an answer?
[13:26:26] <LeoNerd> There are some timers (e.g. on some of the smaller ATtiny) that have only one output compare match unit
[13:35:48] <t4nk646> this warning: cannot set sck period. please check for usbasp firmware update. is it possible that my usbasp doesnt support setting clock?
[13:42:09] <t4nk646> i am going to throw this board in the trash can, i failed flashing it... and nobody knows a solution apparently.. anyway thanks for the help!
[13:43:38] <jancoow> t4nk646: is it b roken now?
[13:44:42] <t4nk646> no, but i get a white screen when powering trough battery (lipo from my quadcopter), due to writing the firmware trough usbasp.
[13:45:05] <t4nk646> when powering trough the usbasp cable it gets the normal screen.
[13:48:02] <jancoow> weird
[13:49:45] <t4nk646> yh, it sucks big time :( but i dont know any other solution :P
[13:50:21] <t4nk646> so i am going to leave you guys! :) thanks for everything
[13:50:53] <jancoow> CasperAtWork: Could you maybe help me once more? My pre scaler is now 1024 and my compare register is 156 and the cpu frequency is 16mhz. Then it should be executed every 1/100 of a second right? But it's a lot slower :( https://jancokock.me/f/a8066
[13:53:13] <jancoow> or help from someone else is also appreciated :)
[14:10:07] <julius> hi
[14:10:52] <julius> looks like my hc-05 bliuetooth module "crashes" - it works for some time, but sometimes after i disconnect with the phone i cant reconnect
[14:13:06] <julius> jancoow, : http://eleccelerator.com/avr-timer-calculator/
[14:23:25] <jancoow> julius: yeah exactly, that one says 0.01 seconds ( 100 times per second). But for some reason that isnt right. It is somewhere around the 30 times per second.
[14:51:59] <anonnumberanon> Lambda_Aurigae thanks.
[15:01:37] <julius> i would guess that that is every 10ms
[15:01:43] <julius> and not a hundred times
[15:13:59] <avr_drone_noob> Hi, ill give it another shot, maybe someone is online now who can help me with the following? i am trying to flash a kk.2.1.5 board and i am getting the following error: verification error, first mismatch at byte 0x0000 0xff != 0x0c
[15:14:17] <avr_drone_noob> command used: C:\Users\Desktop\avrdude\windows\avrdude.exe -C C:\Users\Desktop\avrdude\windows\avrdude.conf -p m644p -P usb -c usbasp -e -B4 -U flash:w:C:\Users\Desktop\kk2\tmp\KK2V1_1V19S1Pro.hex:i
[15:16:29] <Jartza> well, that's programming error
[15:16:36] <Jartza> oh... sorry... _verification_ error
[15:16:42] <Jartza> does the programming work ok?
[15:16:47] <Jartza> maybe it has lock bits set
[15:16:53] <Jartza> then the verification does NOT work
[15:17:05] <Deskwizard> Jartza: good point
[15:17:38] <Deskwizard> I'm trying to remember what I was doing when I saw similar behavior... I'll let you guys know if memory call returns sucessfully
[15:17:49] <avr_drone_noob> how can i see if it has lock bits?
[15:18:04] <Deskwizard> avr_drone_noob: read the fuses
[15:21:56] <avr_drone_noob> then i need to dive in to that, i dont know how to do it..
[15:22:13] <avr_drone_noob> i come back later on then, i think!
[15:22:26] <Jartza> same avrdude
[15:23:02] <Jartza> instead of -U flash....... you put there "-U lfuse:r:-:h -U hfuse:r:-:h -U efuse:r:-:h"
[15:23:35] <Jartza> r means "read", "-" means "no filename" == print to stdout, h = hexadecimal
[15:24:20] <avr_drone_noob> thank you for that, i will copy it
[15:24:26] <avr_drone_noob> output is : avrdude.exe: Device signature = 0x1e960a avrdude.exe: erasing chip avrdude.exe: set SCK frequency to 93750 Hz avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update. avrdude.exe: reading lfuse memory: Reading | ################################################## | 100% 0.01s avrdude.exe: writing output file "<stdout>" 0xd7 avrdude.exe: reading hfuse memory: Reading | ####################
[15:25:54] <avr_drone_noob> srry: first output :0xd7 then 0xd1 then 0xfc then Fuses OK
[15:26:43] <julius> jancoow, oh...every hundreths of a secons is 10ms. 1s= 1000ms, 1000/10 = 100 times per second
[15:27:11] <Jartza> umm
[15:27:15] <Jartza> "erasing chip"?
[15:27:22] <Jartza> ohhh
[15:27:32] <Jartza> avr_drone_noob: you seem to have "-e" on the command-line
[15:27:37] <Jartza> which is... well... erase chip
[15:27:59] <Deskwizard> hehe
[15:28:03] <avr_drone_noob> lol..... and now :(
[15:28:11] <Jartza> now your flash is empty
[15:28:14] <Jartza> :)
[15:28:24] <avr_drone_noob> hahaha, so... its garbage? :(
[15:28:25] <Deskwizard> so at least you know whats in it now hehe
[15:28:29] <Deskwizard> no, is blank
[15:28:31] <Jartza> and your usbasp doesn't seem to support -B
[15:28:46] <Jartza> Deskwizard: true. it's filled with 0xff :)
[15:28:51] <Jartza> so it's... FULL!
[15:28:58] <Jartza> :D
[15:29:04] <Deskwizard> Jartza: if you want to be all technical about it, yeah :P
[15:29:19] <Deskwizard> I wont forget to mention next time ;) hehe
[15:29:34] <Jartza> but anyhow. seems avrdude reads fuses, so communication is ok.
[15:30:36] <Deskwizard> avr_drone_noob: http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega644p
[15:30:54] <Deskwizard> too bad it doesnt have a field to input them
[15:31:03] <Deskwizard> eclipse does it for me .. ;)
[15:31:41] <avr_drone_noob> that the chip in the kk2 board, and new fuse variables?
[15:32:13] <Deskwizard> avr_drone_noob: well thats the chip you were programing for
[15:32:32] <Deskwizard> the fuses change according to your requirements and see if they match your read
[15:32:44] <Deskwizard> if its the right or wrong one, I have no idea.
[15:32:49] <Deskwizard> (the chip I mean)
[15:33:12] <Jartza> oh mmkay
[15:33:18] <Jartza> atmega644p has one more "fuse"
[15:33:22] <Jartza> which is the lock bits
[15:33:47] <Jartza> avr_drone_noob: remove the "-e" from the avrdude and try one more, -U lock:r:-:h
[15:33:52] <Deskwizard> well, most of them (if not all) have the lock fuses
[15:34:21] <Jartza> some avrs have the lock bits embedded in extended fuse
[15:34:35] <Deskwizard> Jartza: then I misunderstood your last statement, thats what I meant
[15:34:44] <Deskwizard> you mean the 644 as another fuse for the locks ?
[15:34:48] <Jartza> yes
[15:34:51] <Deskwizard> oh, interesting
[15:34:53] <Jartza> lfuse, hfuse, efuse and lock
[15:34:58] <Deskwizard> I learned again :)
[15:35:02] <Deskwizard> ty
[15:36:12] <avr_drone_noob> output: signature = 0x1e690a lock mem: 0x3c FUSES OK
[15:36:36] <Jartza> "further programming and verification disabled"
[15:36:59] <avr_drone_noob> what..... stupid chip...
[15:37:20] <Jartza> it's not chip's fault
[15:37:37] <Jartza> someone who flashed the original firmware did put that lock into place
[15:37:56] <avr_drone_noob> can we remove that stupid lock?
[15:38:06] <Jartza> it could be worse, he/she could've disabled the ISP programming
[15:38:37] <LeoNerd> Full chip erase (-e) should already clear the lock bits
[15:38:43] <jancoow> julius: well, that's the point. It actually is 30 times per second
[15:38:46] <jancoow> and i can't see why
[15:39:13] <Jartza> avr_drone_noob: -e -U lock:w:0xFF:m
[15:39:13] <avr_drone_noob> but there are 1000s of users with this boards in the drone world.. and on the site they advise you to flash this board with new fw before flying
[15:39:26] <Jartza> should disable lock bits (don't touch other fuses)
[15:39:46] <Jartza> also, remove the -B4 as it doesn't seem to work on your programmer
[15:40:30] <jancoow> Does someone have an idea why the timer interupt runs every 1/30 second instead of my calculation: 0.01 times per second? Fcpu is 16mhz, prescaler is on 1024 and compare register is 156
[15:40:36] <avr_drone_noob> verification error, first mismatch at byte 0x0000 0x3c != 0xff
[15:40:40] <jancoow> https://jancokock.me/f/6603f
[15:41:59] <LeoNerd> jancoow: Which timer, what mode, etc etc...
[15:42:15] <LeoNerd> Unless you're in a CTC mode, the timer runs to full resolution (8 or 16bit value), not until a match occurs
[15:43:02] <jancoow> It runs in CTC mode, 8 bit
[15:43:07] <jancoow> As i understand it right
[15:43:11] <LeoNerd> jancoow: also, your second write to TCCR0 on the final line of this snippet seems ot have overwritten the first write earlier
[15:43:27] <LeoNerd> So you lost the WGM01 bit
[15:43:30] <Jartza> avr_drone_noob: yes, something is stopping the process of removing the lock
[15:43:36] <Jartza> what I've seen in the past
[15:43:47] <jancoow> LeoNerd: mm.. Good point, didn't metion that :/
[15:43:50] <Jartza> like, "preserve eeprom" might on some chips prevent the removing of lock bit
[15:44:09] <Jartza> and indeed it seems your chip has that enabled
[15:44:33] <Jartza> -U lfuse:w:0xD7:m -U hfuse:w:0xD9:m -U efuse:w:0xFC:m -U lock:w:0xFF:m
[15:44:37] <Jartza> oops
[15:44:54] <avr_drone_noob> lol i dont use that 1 i think?
[15:45:00] <Jartza> -e -U lfuse:w:0xD7:m -U hfuse:w:0xD9:m -U efuse:w:0xFC:m -U lock:w:0xFF:m
[15:45:23] <Jartza> that's the same fuses you have now, except without "eesave"
[15:45:30] <Jartza> might need to do it twice
[15:45:34] <avr_drone_noob> avrdude.exe: verification error, first mismatch at byte 0x0000 0xd1 != 0xd9 avrdude.exe: verification error; content mismatch avrdude.exe: safemode: hfuse changed! Was d9, and is now d1
[15:45:44] <avr_drone_noob> change it back?
[15:46:01] <Jartza> no, run the command twice
[15:46:11] <jancoow> LeoNerd: still not 100 times per second 0.o it a little bit faster
[15:46:15] <jancoow> am i doing something wrong?
[15:46:28] <avr_drone_noob> same, he asks if i want to change it back for second time
[15:46:32] <avr_drone_noob> i say.. no?
[15:47:39] <Jartza> hmm
[15:47:52] <jancoow> avr_drone_noob: isn't there a guid from the manufacturer?
[15:47:55] <jancoow> guide*
[15:47:59] <Jartza> so it doesn't let you change fuses
[15:48:11] <Jartza> avr_drone_noob: you sure you did put -e back there?
[15:48:45] <avr_drone_noob> C:\Users\Stefan>C:\Users\Stefan\Desktop\Gang.Beasts.v0.3.0\kk2\lib\avrdude\windows\avrdude.exe -C C:\Users\Stefan\Desktop\Gang.Beasts.v0.3.0\kk2\lib\avrdude\windows\avrdude.conf -p m644p -P usb -c usbasp -e -U lfuse:w:0xD7:m -U hfuse:w:0xD9:m -U efuse:w:0xFC:m -U lock:w:0xFF:m
[15:49:13] <avr_drone_noob> full command lol, and i dont think there is any official docs
[15:49:26] <avr_drone_noob> you can use this: http://lazyzero.de/en/modellbau/kkmulticopterflashtool
[15:53:15] <Jartza> bit strange
[15:55:23] <jancoow> but now is the question; what is it? Programming cable or your quadcopter board :)
[15:56:02] <avr_drone_noob> ill try to flash my quadcopter board (kk2.1.5) with a usbasp http://www.banggood.com/5V-USBASP-USBISP-AVR-Programmer-Download-Cable-With-10-Pin-Cable-Case-p-931222.html
[15:56:12] <avr_drone_noob> with a 10 to 6 pin converter
[15:56:59] <jancoow> The thing works, but you need to do something in order to get there. First you need a driver. I used this (the 12-version): http://www.fischl.de/usbasp/usbasp.2009-02-28.tar.gz Then you may need to figure out which of the 10 pins, you must use, because on many boards you can only connect 6 pins. With all that done, I managed to get a bootloader onto my controller, but Arduino IDE still complained about something. The device also exports Tx and Rx sig
[15:57:08] <jancoow> just a comment ~
[15:57:49] <jancoow>  but to be able it with AVRDUDE you need to short the 'selfprogram' jumper
[15:58:07] <jancoow> http://img.banggood.com/customers_images/large/2014081415221074-931222.jpg
[15:58:07] <avr_drone_noob> i have driver installed and disabled driver signature in windows
[15:58:08] <julius> jancoow, did you measure?
[15:58:29] <avr_drone_noob> so no yellow sign in device manager, i think it will work.
[15:58:40] <jancoow> avr_drone_noob: did you shortcut the j1 selfprogram?
[15:59:01] <avr_drone_noob> no how can i do that?, never read anything about that before
[15:59:41] <jancoow> julius: yes, well at least you can see what i'm doing in the ISR: creating a clock pulse every second and view it on the lcd
[16:00:24] <jancoow> avr_drone_noob: the comments are full with it: The programmer works fine, although the Arduino software states that the programmer probably needs new firmware. The firmware can be obtained from the URL in the description, but to be able it with AVRDUDE you need to short the 'selfprogram' jumper, which is not indicated on the board. After some investigation it appears to be the two holes of four, nearest to the 10-pin connector. If you short these, AV
[16:00:55] <jancoow> you need to open the plastic and connect these holes somehow :)
[16:00:59] <jancoow> do you have a solder iron?
[16:01:10] <Jartza> jacekowski: seems the programmer can communicate with the board as it can read the fuses for example
[16:01:17] <Jartza> but the programming fails because there's lock bits set
[16:01:30] <avr_drone_noob> yes, i have, can't i just put a jumer cable in it? lol
[16:01:31] <Jartza> chip erase should erase the lock bits too, but strangely that doesn't seem to work
[16:01:37] <jancoow> Jartza: maybe that's because what i just said, the self programmer jumper
[16:02:03] <jancoow> avr_drone_noob: if it makes contact it's good, make sure the holes are connected
[16:02:14] <Jartza> we're not trying to program the programmer?
[16:02:39] <jancoow> Jartza: for the firmware upgrade?
[16:02:48] <Jartza> for the drone firmware update?
[16:02:58] <Jartza> :)
[16:02:59] <jancoow> no
[16:03:00] <jancoow> lol
[16:03:06] <jancoow> for the programmer cable, maybe that will solve the issue
[16:03:22] <jancoow> i'm just posting the comments ;p
[16:03:28] <avr_drone_noob> i can't even do that with a jumper lol, the converter takes up all the space
[16:03:43] <jancoow> but i have to go, good night everyone!
[16:03:44] <avr_drone_noob> but i really need to go sleep, i must work tomorrow :(
[16:03:49] <jancoow> hehe
[16:03:53] <Jartza> avr_drone_noob: just try one more thing
[16:03:58] <Jartza> remove all the -U commands
[16:04:01] <jancoow> car exam tommorow :/
[16:04:06] <Jartza> and just put -e -V there
[16:04:09] <jancoow> driving license *
[16:04:13] <Jartza> erase chip without verification
[16:04:36] <Jartza> and then try the fuse command again
[16:04:58] <avr_drone_noob> suc6 with your car exam
[16:05:02] <avr_drone_noob> i will try
[16:05:12] <avr_drone_noob> succes lol.. im dutch
[16:05:49] <jancoow> me to ! :)
[16:06:14] <jancoow> so stay away from Rotterdam tommorow, 9 pm ;p
[16:06:19] <Jartza> avr people from the dutch mountains
[16:06:22] <Jartza> ":D"
[16:06:29] <Jartza> sorry
[16:06:30] <Jartza> :D
[16:06:31] <jancoow> haha
[16:06:48] <jancoow> gn!
[16:08:41] <avr_drone_noob> i cant run my avrdude anymore for some reason.
[16:09:37] <avr_drone_noob> ill quit for now.. maybe i see u in two days Jartza?
[16:10:13] <avr_drone_noob> or maybe not =).
[16:11:11] <avr_drone_noob> Good night every1ne!
[16:31:06] <Jartza> heh
[17:58:18] <jonas18175> hi
[18:01:21] <jonas18175> what formula is used for the error calculation on this site? http://wormfood.net/avrbaudcalc.php
[18:01:48] <jonas18175> *which
[18:11:23] <Lambda_Aurigae> jonas18175, probably the one out of avr datasheets
[18:14:36] <Lambda_Aurigae> on the atmega1284p datasheet, page 190, section 19.12.
[18:14:48] <Lambda_Aurigae> Error[%]
[18:14:48] <Lambda_Aurigae> BaudRateClosest Match
[18:14:48] <Lambda_Aurigae> BaudRate
[18:14:48] <Lambda_Aurigae> -------------------------------------------------------- – 1
[18:14:48] <Lambda_Aurigae> =    100%
[18:14:51] <Lambda_Aurigae> hmm.
[18:14:57] <Lambda_Aurigae> that doesn't copy/paste nicely.
[18:15:28] <lald> PDFs rarely do
[18:15:52] <Lambda_Aurigae> error[%]=((BAUDRATEclosetmatch/BAUDRATE)-1)*100
[18:19:30] <jonas18175> thx, but so i need the real baud?
[18:19:44] <Lambda_Aurigae> read the datasheet
[18:19:49] <Lambda_Aurigae> it is all explained.
[18:19:53] <jonas18175> ok
[18:20:02] <Lambda_Aurigae> there is a whole section on it.
[18:20:35] <Lambda_Aurigae> you need the target baud rate, the closest you can get depending on the settings of the usart, and do the math from that
[18:21:17] <Lambda_Aurigae> the percent difference is the real baud(according to the settings) divided by the target baud.
[18:21:26] <Lambda_Aurigae> it's a standard percentage difference calculation.
[18:21:44] <jonas18175> ok thx
[18:22:50] <studdentt> can i activate a led with this code instead of bit_is_set ? if(PC0 == 1)
[18:23:34] <studdentt> instead of if ( PORTC & 0x01)
[18:23:56] <studdentt> can't test atm..
[18:23:59] <Lambda_Aurigae> studdentt, neither of those is going to activate anything.
[18:24:33] <studdentt> well with PORTC |= (1<<PORTC1); for example in the if {}
[18:24:52] <studdentt> is the condition valid ?
[18:25:41] <Lambda_Aurigae> why not give a whole chunk of code rather than bits and pieces all twisted?
[18:25:53] <Lambda_Aurigae> because that is making no sense to me.
[18:28:00] <Lambda_Aurigae> PORTx is output.
[18:28:04] <Lambda_Aurigae> PINx is input.
[18:28:28] <Lambda_Aurigae> http://maxembedded.com/2011/06/port-operations-in-avr/
[18:28:31] <Lambda_Aurigae> read that.
[18:28:37] <studdentt> osorry]
[18:28:38] <Lambda_Aurigae> it explains the difference.
[18:28:39] <studdentt> http://codepaste.net/oj2aim
[18:29:40] <jonas18175> But I calculate my UCSRA_VALUE this like: baud_setting = (F_CPU / 8 / baud - 1) / 2;
[18:29:55] <studdentt> thanks then it is wrong
[18:30:22] <Lambda_Aurigae> jonas18175, you didn't ask about calculating UCSRA...you asked about the error calculation.
[18:31:42] <jonas18175> yes, but i need on same time the error value
[18:34:26] <jonas18175> I need the "real" value from baud ... or must it extra calculated?
[18:34:31] <studdentt> actually it might work
[18:34:52] <studdentt> Px is defined for portx and pinx
[18:35:03] <Lambda_Aurigae> you need the target baud and whatever baud you are setting the hardware to.
[18:35:27] <Lambda_Aurigae> studdentt, possibly. I have never used PXx before.
[18:36:58] <Lambda_Aurigae> jonas18175, so, you calculate the actual baud rate by BAUD=fOSC/(16*(UBRR+1))
[18:38:22] <Lambda_Aurigae> that is what the uart is set to when setting the UBRR.
[18:38:25] <jonas18175> ah, i thik i unterstand now.
[18:39:02] <jonas18175> ok, thanks :)
[18:39:09] <Lambda_Aurigae> the difference is how far off the actual is compared to the target.
[18:40:23] <Lambda_Aurigae> it is all in the datasheet.
[18:41:14] <jonas18175> really? ok ... to many information ...
[18:41:43] <Lambda_Aurigae> look at the USART section of the datasheet for your particular chip.
[18:42:12] <Lambda_Aurigae> I recommend reading the entire datasheet cover to cover at least twice but most people refuse to read it even once.
[18:44:04] <jonas18175> I am going to sleeping now ... ok i will try more reading datasheets.
[18:45:28] <jonas18175> Bye!
[19:01:07] <lald> Cover to cover?
[19:01:48] <lald> The m328p datasheet is 650 pages, why on earth would you read all of them?
[19:02:26] <lald> We can call it 550 because of graphics and stuff like that.
[19:16:19] <Lambda_Aurigae> I read the atmega32 datasheet before I ever got an avr to play with.
[19:16:37] <Lambda_Aurigae> I think reading is a lost art and reading comprehension is even worse.
[19:19:39] <lald> My hat goes off to you, sir.
[19:29:19] <Lambda_Aurigae> heck, you don't even have to read it all word for word but go through it, at least twice, just so you have an idea what is in there.
[19:29:22] <Lambda_Aurigae> skim it at least.
[19:29:38] <Lambda_Aurigae> so many people don't even look at the datasheets until they ask questions in here and are pointed there.
[20:59:12] <Casper> Lambda_Aurigae: some don't even know that a datasheet exists...
[21:00:00] <Tom_itx> a what?
[22:39:33] <Casper> ok...
[22:39:42] <Casper> theif 101
[22:40:15] <Casper> 1) don't do multiple breakin at the same place (5-6 times in 2 months)
[22:40:33] <Casper> 2) do not bring your wallet
[22:40:47] <Casper> 3) if you do bring your wallet, make sure that you can NOT lose it
[22:41:30] <Casper> 4) if you do bring your wallet, make sure that there is no ID in it, specially the driver licence, which have your name, photo and address written on it
[22:41:53] <Casper> 5) make sure to not be seen, expecially multiple times
[22:42:06] <Casper> 6) make sure to not leave blood on site
[22:42:49] <Casper> 7) do not use an easilly recognisable mean of transportation, like a bike with big wheels
[22:43:14] <Casper> 8) don't do your stuff when there is snow on the ground, specially fresh one. The police just have to follow the trail
[22:43:27] <Casper> ... yeah... theif are idiots
[22:46:16] <Deskwizard> Casper: 9) if you rob a bank using a note, dont use a letter from your probation officer
[22:46:28] <Deskwizard> and leave it there
[22:46:37] <Casper> Deskwizard: hear that one too
[22:46:46] <Deskwizard> 10) if you run away from the police, dont use shoes with LEDs on them at night
[22:46:57] <Casper> I also hear of 2 even stupider bank robbery thing
[22:47:01] <Deskwizard> Casper: dumbcriminals.com or something like that :P
[22:47:18] <Casper> one is: he did a normal withdrawal, then once it was over he took out the gun...
[22:47:21] <Deskwizard> that and dumblaws ... hours of laugh
[22:47:27] <Deskwizard> Casper: lol
[22:47:42] <Casper> a second one: hold up then deposit in his account
[22:48:04] <Casper> but the 1-8 is live on the police radio right now here
[22:48:54] <Casper> JACKPOT
[22:49:23] <Casper> not bad, about 20 minutes from the call to the arrest
[23:01:02] <Casper> ... he wasn't at his home, but elsewhere finally