#avr | Logs for 2016-02-16

Back
[00:09:23] <nikomo> Casper: kinda funny that your avr-gcc is more up to date, than your system compiler :P
[00:11:38] <Casper> yeah
[03:23:59] <mohsen_> Should I send commands through UART to get data from this gps module? BK-PA6C : http://www.aliexpress.com/store/product/Free-shipping-PA6C-breakout-board-patch-gps-antenna-UART-TTL-data-output-input-10Hz-115200bps/605000_32436725576.html
[03:26:18] <mohsen_> Is it like the process of AT commands?
[03:31:21] <cehteh> mohsen_: do you know that this GPS performs good? otherwise better use a ublox m8 .. they are known to perform well and there are a lot libs for tem
[03:31:59] <cehteh> usually you speak NMEA or some vendor defined protocol to GPS, there may be a few AT commands for setting the serial interface at best
[03:38:59] <mohsen_> cehteh: I found a ublox variant but people were saying it won't work in covered areas.
[03:41:13] <mohsen_> cehteh: Which one of ublox variants works well in roof-closed areas?
[03:41:43] <cehteh> which ublox?
[03:42:06] <cehteh> no gps works well in covered areas
[03:42:11] <cehteh> (i mean standalone)
[03:42:25] <cehteh> ublox 6m is legacy .. dont use that
[03:42:34] <cehteh> but 8m works pretty decent
[03:42:56] <cehteh> if the other you picked is *known* to work well then use that
[03:43:33] <cehteh> i just dont know it and there is a lot cheap trash
[03:44:07] <cehteh> well try to pick some documentation first :)
[03:44:18] <mohsen_> the one that people were saying won't work in house: ublox Neo-6m
[03:44:32] <cehteh> when you cant find any specs and cant use it then its not worth it
[03:44:45] <cehteh> yes i have a 6m its not very good
[03:44:53] <cehteh> 8m is much much better
[03:45:17] <cehteh> but as i already saied, no gps works inside
[03:45:32] <cehteh> at least not very good or only by chance
[03:46:04] <cehteh> mobile phones use assisted GPS .. adding a lots other data sources for better locating
[03:46:38] <cehteh> gps coldstart inside a building takes ages or wont work at all, and if it succeeds it wont be accurate
[03:48:40] <mohsen_> Would putting a gps inside a metal container decreases its accuracy?
[03:49:06] <cehteh> no
[03:49:24] <cehteh> it will totalle disable it :D
[03:51:07] <Xark> Well, technically that is a decrease. :)
[03:51:16] <cehteh> to 0
[03:51:25] <Xark> Yep. :)
[03:51:47] <mohsen_> About the module I showed you, someone was saying he put it inside a metal container which its top was not closed and it worked well.
[03:51:49] <cehteh> even the metall coated windows shield against GPS signals already
[03:51:51] * Xark links https://en.wikipedia.org/wiki/Faraday_cage
[03:52:26] <cehteh> with top open you may have some luck .. but in that frequency range everyting is black magic
[03:52:54] <cehteh> any metal surface close to it may detune the antenna .. or improve it
[03:52:57] <mohsen_> So I have no chance in using a gps module in-house?
[03:53:18] <cehteh> not that much
[03:53:27] <cehteh> with a warm start you get signals and you get some position
[03:53:51] <cehteh> but usually that positions accurary is lower than the house's size
[03:54:33] <cehteh> and dont compare that with smartphones .. because i already saied they use some other data to make it more accurate
[03:55:11] <cehteh> standalone gps wont work well in covered areas, it doesnt work with reflections
[03:55:36] <cehteh> cold starting needs some time to gather sattelite date
[03:56:59] <cehteh> bbl
[03:57:05] <mohsen_> What do you mean by cold starting?
[03:57:23] <cehteh> read the wikipedia article about gps
[05:43:41] <limpkin> ok, general attack related question: is it theoretically possible to make the PC go to a given address when we can (only) change the RAM contents and jump to a given address in flash for execution? If so... is it _always_ possible?
[05:44:53] <limpkin> I realize this i a very broad question highly dependant on the firmware part you're jumping in, also depending on the program input sanitation routines..
[05:58:42] <WormFood> limpkin, I don't understand your question
[05:58:58] <limpkin> what part didn't you get?
[05:59:13] <WormFood> I don't understand what exactly you're asking.
[05:59:40] <limpkin> ok, do you know what is a program counter?
[05:59:46] <WormFood> of course
[06:00:45] <limpkin> ok, is it possible to change its contents when a known firmware is running in a microcontroller and when you can change the microcontroller RAM contents and have the ability to change once the PC contents but only to a given flash space
[06:01:44] <WormFood> I don't see any specific commands to change the PC
[06:02:47] <limpkin> well isn't any function call a way to change the PC?
[06:03:08] <limpkin> I'm not sure how it is translated in ASM though
[06:03:12] <limpkin> compiled*
[06:03:26] <WormFood> that changing the PC, is part of how it works.
[06:03:42] <WormFood> I'm not aware of how to change the PC on the AVR family.
[06:04:54] <limpkin> http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_RCALL.html
[06:04:56] <limpkin> is an example
[06:05:48] <WormFood> The address is from the execution
[06:06:14] <limpkin> http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_CALL.html then
[06:06:19] <WormFood> You'd have to edit the return address on the stack.
[06:07:15] <limpkin> you asked me how to change the PC, I answer you with the CALL asm instruction. return address isn't part of the problem i described
[06:07:16] <WormFood> And that is what NagraVision smart cards do...at least the older ones did...I'm sure the newer ones still do. They embed parms after the function call, then edit the return address on the stack, to skip the following data bytes. It was a rather clever way to do things, but made disassembling tricky.
[06:09:04] <WormFood> I gotta split, but I'll be back. You gotta understand how things work. What commands load the PC? an RTS, right? So, just push the return address on the stack, and call an RTS
[06:09:23] <limpkin> i think you misunderstood my goal :)
[06:09:30] <limpkin> we'll talk when you'll be back then
[06:10:08] <WormFood> Give me an example then
[06:10:38] <WormFood> I think what I said, gives you what you asked for
[06:10:50] <limpkin> of course, otherwise you wouldn't have said it
[06:10:58] <WormFood> and, it's an RET command
[06:11:19] <limpkin> I'm deliberately knowing that the return address that I'm storing when running CALL won't be taken into account
[06:12:18] <WormFood> oh. And now I see the SP address in ram. It's 0x3D/E(0x5D/E). Just load that, and it should work.
[06:12:23] <limpkin> my question, is a general question, purely theoretical if you wish. when jumping into a known address, is it possible to get back to another address in flash when you have control of the RAM contents
[06:12:39] <limpkin> ok nevermind then.
[06:12:48] <WormFood> sorry, gotta go.
[06:13:42] <WormFood> define "have control of the ram contents". You mean like dual ported ram, being having it's contents able to be changed from another device? I'll be back, probably within the hour
[06:14:30] <limpkin> yes
[06:51:59] <julius> hi
[06:52:27] <julius> is there somewhere a #arm channel which got more than 6 people in it?
[06:52:48] <Lambda_Aurigae> probably.
[06:59:07] <julius> google doesnt help :(
[06:59:35] <Lambda_Aurigae> yeah..twitter needs to stop using the #
[06:59:41] <Lambda_Aurigae> we had it first on irc damnit!
[07:03:12] <julius> true
[07:03:25] <Lambda_Aurigae> and long before it was called a hashtag
[07:03:41] <julius> anyone here ever tried a arm cortex m0/m3 and knows what kind of programmer you need?
[07:03:55] <Lambda_Aurigae> jtag
[07:04:07] <Lambda_Aurigae> or, manufacturer specific
[07:47:59] <lorenzo> julius: depends a lot on the microcontroller, the vendor, the toolchain..
[07:48:22] <lorenzo> stm32 + st-link + openocd is okay
[07:48:32] <lorenzo> nxp + lpc-link + openocd is okay too
[07:48:33] <cehteh> some have usb and usb bootloader
[07:48:39] <lorenzo> segger j-link can do both stm32 and nxp
[08:46:42] <gerritjan> Im using eclipse and i want to add this line UBRR0H = (unsigned char) (MYUBRR>>8); but it doesnt know the UBRR0H whats the problem
[08:48:16] <LeoNerd> You probably just have to set UBRR0
[08:48:24] <LeoNerd> Rather than the L and H halfs separately
[08:48:48] <gerritjan> because if i read the pdf from the atmel it gives me that code
[08:49:09] <LeoNerd> Yeah but that's Atmel
[08:49:21] <LeoNerd> Most language libraries/bindings/etc... synthesize full 16bit fields for those
[08:50:02] <gerritjan> oke so i have to remove the H but how can i set the MYUBRR and (MYUBBR>>8) to the UBRR0?
[08:50:36] <gerritjan> because they are 2 lines
[08:50:38] <LeoNerd> Just work to a native 16bit quantity already
[08:50:45] <LeoNerd> Don't worry about the two separate 8bit halves of it
[08:51:12] <gerritjan> oke so i need th set only the MYUBRR and not the 8 bit part
[08:51:14] <Casper> gerritjan: often the build in library will have some macro that take care of it for you
[08:51:36] <Casper> UBRR0 = 436;
[08:51:46] <gerritjan> thats it?
[08:51:49] <Casper> yup
[08:52:15] <Casper> need to go, see ya
[08:52:15] <gerritjan> lol so the Whole baudrate calculation is not necessarie?
[08:52:20] <gerritjan> see ya
[08:52:25] <Casper> oh sure, you need to calculate
[08:52:34] <Casper> but no need to split it into low and high 8
[08:52:45] <gerritjan> ah oke :D
[08:52:55] <gerritjan> thx
[08:56:10] <gerritjan> oke now i did change that but Eclipse doesnt know UBRR0 onlu UBRRH andf UBRRL
[08:56:47] <LeoNerd> "eclipse"...
[08:57:00] <gerritjan> yes with avr
[08:58:41] <gerritjan> and build with avrdude
[08:58:59] <LeoNerd> "build with avrdude"..
[08:59:06] <LeoNerd> I think you're getting confused about what does what
[08:59:30] <gerritjan> sorry upload :S
[09:00:26] <LeoNerd> Right; so the uploading tool doesn't matter...
[09:02:03] <gerritjan> nope but still he doesnt accept the 0 in any like [UCSR0B = UCSRB] and [RXEN0 = RXEN] can it be that my board got a atmega2560?
[09:02:45] <gerritjan> or ATMega328p?
[09:03:17] <LeoNerd> Whether or not the compiler is happy with your code doesn't matter what board is plugged in
[09:04:41] <gerritjan> oke because the pdf is for a ATMega 328p so i dont know why he is not happy why i try RXEN0 and he doesnt accept it
[09:05:02] <LeoNerd> What compiler?
[09:05:43] <gerritjan> gcc-avr
[09:06:16] <LeoNerd> Well, UBRR0 works fine for me with gcc-avr
[09:06:38] <gerritjan> because if i check the RXEN it will open iom16.h
[09:07:03] <LeoNerd> You don't want to be pulling in iom16.h directly
[09:07:11] <LeoNerd> Just #include <avr/io.h> and the right things should happen
[09:07:20] <LeoNerd> If they don't, then you've done something else wrong elsewhere
[09:07:28] <gerritjan> i have that
[09:07:33] <rue_house> I use makefiles, never had a problem
[09:08:25] <gerritjan> hmm strange
[09:10:54] <gerritjan> rue_house: but it makes a makefiel with eclipse when you compile
[09:16:55] <rue_house> sounds like it dosn't do it right, want a working makefile?
[09:17:49] <gerritjan> but the i can see with eclipse the pre programed functions so i can see it has only those 2
[09:34:33] <WormFood> rue_house, what would a pwm calculator calculate for you? I mean, what type of information would you want to feed it, to give you what information back?
[12:01:53] <julius> lorenzo, thanks
[12:02:10] <lorenzo> you're welcome
[12:24:03] <Jartza> evening
[12:43:11] <Karin00> hello how can change the the chip in eclipse code because i did find out that in linux and eclipse, gcc-avr eclipse select the wrong chip so i cant code write without any error
[12:59:56] <julius> i know a guy who can answer that, we are very close
[13:00:06] <julius> i call him uncle google
[13:00:21] <julius> i dont use eclipse with avr, for me its a change in the Makefile
[13:01:52] <Karin00> well unclu google doesnt know it because its somewhere i cant find it :S code will compile only with the itellisence i cant get the rigth code
[13:06:24] <Karin00> but i know i need to set the define chip only i dont know how :S
[13:20:01] <Casper> look for a Makefile maybe, or in the project settings
[13:20:08] * Casper uses linux and vim
[13:22:46] <avr_0xff> i have a little question:
[13:22:55] <avr_0xff> if i run this command: C:\Users\Stefan\Desktop\kk2\lib\avrdude\windows\avrdude.exe -C C:\Users\Stefan\Desktop\kk2\lib\avrdude\windows\avrdude.conf -c usbasp -p m644p -U lfuse:w:0xe2:m -U hfuse:w:0xd7:m -U efuse:w:0xfc:m -F
[13:23:15] <avr_0xff> it asks me: avrdude.exe: safemode: lfuse changed! Was e2, and is now d7 Would you like this fuse to be changed back? [y/n]
[13:23:28] <avr_0xff> i say no... then the next time same error appears..
[13:23:49] <avr_0xff> why i cant change fuses?
[13:35:29] <twnqx> aren't the fuses inverted, e.g. a 0 to set a bit? and some bits not settable? something like that
[13:41:50] <avr_0xff> i don't know, but it's a kk2.1.5 board i try to flash because it is broken now.. (software only) and i saw this link: http://www.rcgroups.com/forums/showthread.php?t=1675613&page=514
[13:41:56] <avr_0xff> and stole that command..
[13:41:57] <avr_0xff> lol
[13:46:40] <avr_0xff> my topic for the intrested: http://www.multi-rotor.co.uk/index.php?topic=17295.0
[20:47:23] <Evidlo> Do the Atmel datasheets leave out the _vect suffix in all the ISR names?
[20:53:00] <Casper> the datasheet show what they use with their stuff
[20:53:10] <Casper> not what you probably use
[20:53:20] <Casper> if you use gcc, then the name will change
[21:00:29] <JoeLlama> moo
[21:10:09] <Casper> Boo!
[21:11:34] <Evidlo> Also, could somebody explain what this mean: 'The low level of INT0 generates an interrupt request.'
[21:12:02] <Evidlo> This is in the settings table for INT0. How is that different from falling edge?
[21:13:04] <Casper> because it is not the edge itself, but the "it was high, now when I checked it is now low"
[21:13:40] <Evidlo> So that causes it to interrupt every clock cycle?
[21:13:46] <Casper> no
[21:13:48] <Evidlo> assuming its low
[21:14:11] <Casper> but the edge and the interrupt can take significant time to be detected due to the clock
[21:14:13] <Evidlo> oh, I didn't read
[21:15:07] <Evidlo> I thought the high->low was how a falling edge was detected anyway
[21:16:07] <Evidlo> I still don't get it
[21:17:57] <Casper> but really, I guess the difference is mostly technical, the result is the same..
[21:19:04] <Evidlo> How are edges detected if not by a high->low transition?
[21:19:19] <Evidlo> falling edges*
[21:20:04] <Casper> from what I understand, the falling edge is made by a comparator, and will trigger right away
[21:20:28] <Evidlo> and the low level setting has to wait until the pin is sampled?
[21:20:32] <Casper> while the way the avr do it is by sampling the pin every x cycles (every single one?), so basically analog vs digital
[21:20:39] <Casper> yeah
[21:20:39] <Evidlo> ok
[21:20:51] <Casper> that is my understanding atleast
[21:27:03] <Evidlo> Am I forgetting something? My external interrupt isn't working: https://dpaste.de/AToR
[21:27:15] <Evidlo> I got pin change interrupts working fine, though
[21:31:05] <Evidlo> found it. wrong ISR name
[22:23:48] <Evidlo> Are there any other kinds of interrupts besides pin and timer interrupts?
[22:38:40] <Casper> sure
[22:38:49] <Casper> like, over 20 interrupts
[22:52:14] <flyback> http://www.bgmicro.com/pwb51847c-vo-20x4-alpha-numeric-lcd-with-a-white-backlight.aspx
[22:52:26] * flyback trips Casper with a french pastry
[22:54:33] * Casper use an angle grinder on flyback's back then pour a mixure of salt and rubbing alcohol with some peroxide
[22:54:35] <Casper> hi ya
[22:54:48] <Evidlo> How might I generate a sequence of pulses a,b,c,d,... ticks long? I've tried changing OCR1A and OCR1C in an interrupt, but this is causing jitter
[22:54:57] <flyback> hi
[23:10:28] <Casper> Evidlo: the jitters is due to the pwm mode, update at top or bottom... I forgot which one is the proper one