#avr | Logs for 2017-02-01

Back
[00:47:46] <_ami_> phew! just verified that i did use thermal relief on copper fill by opening gerber files which i have sent to pcb manufacturer.
[00:48:21] <_ami_> relieved
[01:02:30] <sabor> hehe
[01:02:41] <sabor> kicad es useful defaults :)
[01:08:16] <_ami_> yeah, i noticed that.. the default settings for pad connection is thermal relief.
[01:08:25] <_ami_> n00b mistake by me :P
[01:09:16] <_ami_> i knew abt thermal relief (concept wise) and i was looking where to find that option.. but it was all there when u do copper fill... i did not see it at that time. :P
[01:09:35] <_ami_> but thankfully.. thermal relief was there all along.
[04:07:04] <CORDIC> Vikinger: ``Btn #1''?
[08:24:59] <Lambda_Aurigae> http://www.omroepwest.nl/nieuws/3340383/Spuitende-paal-leidt-tot-bijzondere-taferelen-in-Voorburg
[08:25:10] <Lambda_Aurigae> who do you call? Electrician or Plumber?
[08:25:13] <Lambda_Aurigae> or,,,,Exorcist?
[08:33:58] <malinus> Lambda_Aurigae: endingeer
[10:25:46] <skz81> <Lambda_Aurigae> who do you [gonna] call? >> Ghostbusters !!!!
[10:32:37] <avrdude> what happens if you have an ISR that is triggering so often that it doesn't have time to complete before the next one?
[10:33:14] <skz81> depends on I flag in SREG
[10:34:04] <skz81> if you don't SEI inside ISR, corresponding IRQ flag will be set, and ISR excuted as soon as SEI called
[10:34:14] <skz81> often when you exit ISR
[10:34:28] <skz81> so you loop in ISR constantly I guess
[10:34:36] <LeoNerd> Though the interrupted code does get /one/ instruction slot before the interrupt fires again
[10:34:46] <LeoNerd> So mainline code does get a chance to make (slow) progress
[10:37:54] <skz81> LeoNerd, sure ? I would have bet ISR would be immediatly re-entered if IRQ flag set at least before the RETI...
[10:38:29] <skz81> But thinking a bit more, the behaviour you describe is better (since allow main app to run, even if very slow)
[10:39:51] <skz81> AFAIK, if the trigger condition is met while IRQ flag is already set, nothing more happends (no event queue or anything).
[10:41:06] <skz81> s/SEI called/SREG.I flag set/
[10:41:20] <avrdude> Alright, thanks. Sorry for wasting your time actually - I'm using a PIC and it's horribly documented and there is no PIC-channel
[10:41:30] <avrdude> I guess I was asking more.. in general
[10:42:18] <LeoNerd> Hah
[10:42:25] <LeoNerd> Well, that sort of detail varies a lot between CPUs
[10:46:08] <avrdude> admittedly, it's a rather long ISR.. I've tried to streamline it a bit: http://ideone.com/4m3jVl
[10:47:13] <avrdude> any tips? If i call this 100,000 times per second, it seems to get stuck, but at 50,000 times per second it works fine
[10:48:23] <avrdude> basically, it's filling up an array with values, and the main-loop is writing the array to an SD-card
[11:12:25] <Emil> At 100kc/s you have 160 cycles per call. ~40 are taken by entering and exiting the ISR, which leaves you with 120 cycles for the ISR
[11:12:41] <Emil> also, wtf, are you implementing ISRs yourself?
[11:13:09] <Emil> The standard way is ISR(VECTORNAME_vect) and ISR(VECTORNAME_vect, ATTRIBUTES)
[11:13:54] <Emil> Or are you running on some other platform
[11:15:08] <CORDIC> avrdude: ##PIC does exist.
[11:15:21] <Emil> Wait, is that for PIC
[11:15:27] <CORDIC> Yes.
[11:15:31] <Emil> Wtf is that here, then :D
[11:15:45] <CORDIC> ``That''?
[11:15:46] <Emil> And dat naming, tho
[11:16:05] <Emil> CORDIC: those questions and that code
[11:17:01] <CORDIC> I sure like it more than Arduino :) .
[12:14:48] <ENHering> Hi.
[12:17:09] <bss36504> Howdy
[12:26:39] <ENHering> Anybody here know a good reason for AVR crashing when a master SPI sends a byte?
[12:28:19] <LeoNerd> Yeah; the datasheet is quite vauge on the detail
[12:28:35] <LeoNerd> but it's very important the order in which you set the DDR register for the SS# pin, vs. enabling the SPI master
[12:29:08] <ENHering> Which should be the right order?
[12:29:30] * LeoNerd checks
[12:30:14] <LeoNerd> DDR as output *before* enabling SPI master
[12:30:27] <LeoNerd> Ahyes, I recall now. If you do it in the other order, the SPI unit doesn't quite notice, and so it thinks the SS line is an input
[12:30:43] * ENHering checking
[12:30:47] <LeoNerd> Meaning it reverts into SPI slave mode, resetting the CPU since you likely don't have an ISR set
[12:31:24] <ENHering> void SPI::InitMasterSPI() {
[12:31:25] <ENHering> //Page 170 of Datasheet
[12:31:25] <ENHering> #ifdef ATMEGA328P
[12:31:26] <ENHering> // Enable SPI module
[12:31:28] <ENHering> cbi(PRR, PRSPI);
[12:31:30] <ENHering> // Set MOSI and SCK as OUTPUT
[12:31:32] <ENHering> sbi(DDRB, PB3); // MOSI
[12:31:34] <ENHering> sbi(DDRB, PB5); // SCK
[12:31:36] <ENHering> // Set SS as output and keep it high
[12:31:38] <ENHering> sbi(DDRB, PB2); // SS
[12:31:40] <ENHering> //sbi(PORTB, PB2);
[12:31:42] <ENHering> // Set MISO as input
[12:31:44] <ENHering> cbi(DDRB, PB4); // MISO
[12:31:46] <ENHering> // Set data mode to MODE 1
[12:31:48] <ENHering> cbi(SPCR, CPOL);
[12:31:50] <ENHering> sbi(SPCR, CPHA);
[12:31:52] <ENHering> // Set data order
[12:31:54] <ENHering> sbi(SPCR, DORD);
[12:31:56] <ENHering> // Enable SPI
[12:31:58] <ENHering> sbi(SPCR, SPE);
[12:32:00] <LeoNerd> Yeah.. That code doesn't work properly. Also please don't paste in here
[12:32:00] <ENHering>
[12:32:02] <ENHering> // Set Master
[12:32:04] <ENHering> sbi(SPCR, MSTR);
[12:32:06] <ENHering> // Disable interrupt
[12:32:08] <ENHering> cbi(SPCR, SPIE);
[12:32:10] <ENHering> // Set clock rate fck/16
[12:32:15] <ENHering> cbi(SPSR, SPI2X);
[12:32:15] <ENHering> sbi(SPCR, SPR1);
[12:32:16] <ENHering> sbi(SPCR, SPR0);
[12:32:18] <ENHering> #endif
[12:32:20] <ENHering> }
[12:32:24] <ENHering> Sorry.
[12:32:29] <LeoNerd> ((also in general that code style is *hideous*)
[12:32:57] <specing> Also it looks like C++
[12:33:03] <ENHering> It is C++
[12:33:12] <LeoNerd> Eh; any decent C compiler will accept // these days
[12:33:13] <specing> Wheres my puke bucket?
[12:33:21] <ENHering> I'me setting DDR before setting AVR as master. Isn't that right?
[12:34:00] <LeoNerd> It seems you are
[12:34:38] <LeoNerd> So maybe this isn't the problem you're encountering
[12:34:50] <ENHering> Looks like a segfault
[12:52:49] <hetii> Hi :)
[12:55:25] <hetii> I have idea to build press that will help me produce PCB boards. My idea is to use two ceramic tile and servo that will rotate screw and make pressure.
[12:56:27] <hetii> but here I wonder what will be better. Just use one servo and put screw in some arm in center of such ceramic tile or use two, one on left and second on right side
[13:07:26] <bss36504> hetii: How will this work? Precisely how much pressure do you need? Have you even looked into specing out motors or other mechanical components to acheive that? I think if you do, the decision will be apparent.
[13:07:42] <bss36504> whoops sorry specing
[13:07:46] <carabia> please look at specing.
[13:07:59] <carabia> just take a look at him.
[13:08:33] <carabia> then put servo on and screw and one on left one on right and ceramic tile and make pressure.
[13:08:57] <bss36504> Just look wayyyy up into him
[13:08:57] <hetii> well servo that I have is MG995 - 11KG
[13:09:07] <bss36504> Right will that work though?
[13:09:15] <bss36504> Is that enough? What exactly are you pressing here?
[13:09:34] <hetii> PCB board and paper
[13:09:51] <bss36504> To what end?
[13:10:12] <carabia> I can press about 90 kg
[13:10:15] <bss36504> Have you tested this with an 11KG weight in place of the servo?
[13:10:59] <hetii> To transfer pcb layout by using aceton+alcohole: http://www.elektroda.pl/rtvforum/viewtopic.php?p=16245262
[13:11:10] <carabia> I wouldn't trust those chinese servos to be pushed to their limits, even though that's an mg servo
[13:11:58] <hetii> well I just press my board by using single hand and all works fine. Not sure how strong I`m :)
[13:12:25] <carabia> hetii: 9/10 top dentists recommend EE by interrogation.
[13:12:26] <bss36504> Well with a rigid enough back plate, one screw will be adequate
[13:12:59] <carabia> though this is more in the realm of mechanical engineering, but no-one's paying attention anyway
[13:14:17] <ENHering> hang a 1kg weight on a line and hang the other end of the line on one of your fingers. Then lift the finger. That is 1kgf
[13:14:21] <carabia> and a rigid enough tile
[13:14:42] <ENHering> From there you can estimate how strong you are.
[13:15:26] <ENHering> One ca easily apply 10kgf over something by pressing it between two fingers.
[13:15:30] <ENHering> can
[13:16:16] <hetii> I see, ok thx :)
[13:16:25] <carabia> i think one screw's adequate. depends on the board size too, but i don't think you're going to diy very big boards...
[13:17:23] <carabia> also on the subject of comments. yeah // is much nicer. ain't nobody got time to close the comments.
[13:17:30] <hetii> My ceramic tile is 20x15cm
[13:17:31] <carabia> and is well accepted
[13:19:15] <carabia> but c++ sucks donkeyballs and i'll be called out on that, personally I do not care
[13:19:41] <Chillum> you prefer higher level languages?
[13:19:48] <Chillum> or are you an assembly person?
[13:19:48] <carabia> Chillum: amen brother
[13:20:14] <carabia> on smaller micros i prefer javascript. higher up in the spectrum i prefer php
[13:20:17] <ENHering> What is the problem with c++?
[13:20:27] <Chillum> using a higher level language on a microcontroller is like swimming with your clothes on
[13:20:35] <carabia> hey, i like that too
[13:21:02] <carabia> ENHering: I find concepts such as classes way too overkill for simple and small applications such as mcu firmware
[13:21:04] <Chillum> they are great for abstracting away hardware, but in a MCU you want to be near the metal
[13:21:27] <carabia> that, and i find the whole language overkill even for x86
[13:21:41] <ENHering> One day, when I grow up, I will understand why...
[13:21:55] <carabia> granted, i have never bothered to properly learn it, simply cause i wouldn't even know where to start.
[13:22:17] <ENHering> I wonder how can one write a kalman filter in assembler
[13:22:24] <carabia> i don't think i'd be using it even if great mister strosrsrskdlfjsdl would give me personal lessons on the advantages of STL
[13:22:49] <Chillum> start with data types
[13:23:03] <ENHering> Sorry. I'm old and ignorant. STL ?
[13:23:21] <carabia> standard template library
[13:23:33] <carabia> https://en.wikipedia.org/wiki/Standard_Template_Library
[13:23:41] <carabia> just an example.
[13:23:42] <ENHering> ok.
[13:23:44] <ENHering> Thanks.
[13:24:16] <carabia> Chillum: 1) i have no real need to learn C++, 2) not interested, this is a causality of point 1
[13:24:38] <ENHering> When I grow up...
[13:24:41] <specing> C++ sucks
[13:24:44] <specing> it really does
[13:24:49] <Chillum> I accept that you have no need, but your point was it sucks donkeyballs
[13:24:57] <carabia> C++ is much like GNU Emacs
[13:25:08] <Chillum> joe ftw
[13:25:14] <ENHering> What do you use to program microcontrollers?
[13:25:29] <carabia> over around here, nodejs frameworks
[13:25:39] <Chillum> one virtual machine to rule them all
[13:25:53] <carabia> umm, for small micros i don't really see the necessity for anything else than asm and c
[13:26:32] <Chillum> C is almost a subset of c++
[13:26:40] <Chillum> if you write in c you are probably writing valid c++
[13:27:18] <carabia> that's true, but that point's kind of counter-argumenting the use of c++ in the first case
[13:27:19] <Tom_L> c came first though
[13:27:59] <carabia> if the argument is for or against c++, as in what it brings to the table
[13:28:14] <ENHering> C is good. C++ gives me classes. Classes are good to me. They are my friends. I can test and reuse classes.
[13:28:37] <Tom_L> drags along bloat too
[13:28:43] <Tom_L> for free
[13:28:45] <Chillum> I don't use many of the features of the language, just enough to get along
[13:28:47] <carabia> unnecessary abstraction, in my humble opinion
[13:29:23] <Chillum> well I am down with getting closer to the metal, c and asm are great in my mind. I don't think high level languages belong in limited resource environments though.
[13:29:24] <carabia> i am not sure what gets optimized on compile time and what doesn't, so i can't argue on the bloatness straight
[13:29:39] <ENHering> I have a class to handle SPI, another to handle UART, another to handle each sensor. If I have two sensor installed I just instantiate twicw the same class.
[13:29:45] <carabia> well, de-abstracted, really
[13:30:18] <ENHering> I like that. Works fine. Gcc handles well.
[13:30:20] <carabia> ENHering: well, you could do that with basic functions, while passing a config struct or something.
[13:30:25] <carabia> or just an address.
[13:30:40] <ENHering> And repeating the whole data structure
[13:30:46] <carabia> ...no
[13:31:09] <carabia> you could just pass in an index too, it really depends how you want to implement it
[13:31:15] <ENHering> I'm dumb. I would take twice the time to do the same without classes.
[13:31:29] <ENHering> I'm so stupid...
[13:31:51] <ENHering> Almost like Casper, who drinks isopropanol.
[13:31:51] <Chillum> so you could manually do what a class does for you?
[13:32:05] <ENHering> Chillum: you can. But harder.
[13:32:15] <Chillum> I know, I just don't see the advantage
[13:32:35] <ENHering> To each, each own. My pile of shit is big.
[13:32:56] <ENHering> But I like it! :)
[13:33:05] <ENHering> Reason enough.
[13:33:21] <carabia> ENHering: a read prototype would just simply be something along the lines of uin16_t read(uint8_t addr);
[13:33:33] <carabia> for an i2c sensor
[13:33:47] <carabia> uint16_t, even
[13:34:22] <ENHering> Yep. With classes I hold all the sensor relevant data inside the object. If I make two objects, each has its own set. In one line of code
[13:34:54] <carabia> you could abstract address anf other config, and output in a struct, too
[13:35:00] <carabia> i can't type today
[13:35:22] <ENHering> You can.
[13:35:31] <carabia> with no need for classes
[13:35:50] <ENHering> No need for classes ever. They just make my life more readable.
[13:36:01] <ENHering> And easier.
[13:36:27] <carabia> struct sensor_t { uint8_t addr; stuff whatever; uint16_t data };
[13:36:32] <ENHering> Browse the repo: https://xp-dev.com/hg/YAUVC
[13:36:39] <carabia> if you really want that sort of abstraction
[13:36:46] <ENHering> structs do not hold functions.
[13:36:59] <ENHering> constructors and destructors
[13:37:09] <ENHering> Instantiate and everything is initialized
[13:37:32] <ENHering> destroy and everything is deinitizlied, the way you wish. No forgotten code.
[13:37:35] <carabia> constructors/destructors, no
[13:37:55] <ENHering> Clear, shareable code.
[13:38:44] <carabia> but you can have a function pointer in a struct
[13:39:16] <carabia> stmicro uses that kind of a thing in their hal-libs, which i find kind of stupid
[13:39:39] <carabia> i guess it's down to fundamental preferences though.
[13:40:22] <ENHering> You can
[13:40:29] <Casper> iso is a non-issue
[13:40:32] <ENHering> But isn't it easier with classes?
[13:40:52] <carabia> if i was interested enough, i'd find out exactly what kind of de-abstraction classes go through at compile-time, but i don't play on using c++ so, meh
[13:40:59] <carabia> ENHering: well basically that way you're emulating classes
[13:40:59] <ENHering> The repo has all the classes I use under firmware/src
[13:41:18] <ENHering> Yep.
[13:41:31] <carabia> i write my stuff device lib per file, organized enough for me
[13:41:39] <ENHering> I believe
[13:41:49] <ENHering> I just need classes to get organized
[13:42:06] <ENHering> Personal taste
[13:42:21] <carabia> guess so. hope for good compilers!
[13:42:36] <ENHering> avr-gcc works well enough
[13:43:02] <carabia> you need to go through the asm line by line
[13:43:09] <ENHering> never had problems. I just should not go to templates or other heavier stuff.
[13:43:18] <carabia> don't do that. ever.
[13:43:29] <carabia> not on a micro. that's really shooting yourself in the fucking foot
[13:43:35] <ENHering> In a cortex MCU they may be necessary
[13:43:44] <carabia> necessary, no
[13:44:04] <ENHering> templates reduce a lot the code size in some cases.
[13:44:08] <carabia> on a high-end cortex, such as cm4/7, you could use them if you're used to doing x86 stuff
[13:44:12] <ENHering> but i never had to use them
[13:45:03] <ENHering> I have a fem m4 here, which I pan to inser in a module later
[13:45:08] <ENHering> insert
[13:45:19] <ENHering> not any sooner
[13:45:40] <carabia> gonna do some dsp stuff with them or?
[13:45:48] <carabia> or what kind of a module
[13:45:52] <ENHering> But you guys have the experience. I'm just a wannabe in this area.
[13:46:02] <ENHering> The kalman code is heavy.
[13:46:21] <ENHering> I'm making a simple version of it to run on AVR
[13:46:48] <carabia> oh you are
[13:47:23] <ENHering> and as my system has the processing distributed into many MCUs, I can probably dedicate one module just to try to do kalman in an avr.
[13:47:55] <ENHering> And later, when everything is tested, I can just fuse everything into one high end MCU.
[13:48:13] <carabia> yeah, was thinking. cm4 seems quite suitable
[13:48:31] <ENHering> i even have a camera input in one pin...
[13:48:36] <ENHering> it
[13:48:46] <ENHering> amazing MCU
[13:49:05] <carabia> which mf
[13:49:10] <ENHering> but 500 pages of datasheet are too mauch for me in this moment
[13:49:33] <ENHering> mf?
[13:49:44] <carabia> manufacturer, freescale?
[13:49:48] <carabia> well, nxp
[13:49:53] <ENHering> ah, sorry. Wait
[13:50:54] <ENHering> ST
[13:51:00] <carabia> yay
[13:51:22] <carabia> with your way of coding, you're going to feel right at home with st-provided libraries, even though they're written in C
[13:51:45] <ENHering> STM32F417VGT6
[13:51:55] <carabia> just work your way through the clock section on the ds and you can start playing with it, pretty much
[13:52:23] <ENHering> I'm still afraid of soldering such IC. Long way to go, yet
[13:53:03] <carabia> oh wait, you didn't get a board? just tqfps?
[13:53:24] <carabia> ooh. that's gonna be funzies
[13:54:08] <ENHering> Like the MCU modules from the project. My own boards...
[13:54:28] <ENHering> Until now I have learnt a lot by being so stupid.
[13:55:30] <ENHering> I've got to leave. Be back in three hours if you are still here.
[13:57:32] <carabia> probably. it's not late. i'm working on something super secret. laters then.
[14:31:04] <Jartza> hmmh
[14:31:09] <Jartza> can't get attiny817 programmed :(
[15:29:14] <rue_house> what programmer?
[15:35:56] <Jartza> rue_house: uart ttl adapter
[15:36:00] <Jartza> attiny871 uses updi
[15:36:07] <Jartza> which is half-duplex uart
[15:37:27] <rue_house> at what baud at what crystal freq, with what bits/parity?
[15:37:59] <rue_house> if any of the answers are 'its magic' then there is your problem
[15:49:37] <Jartza> at default 4MHz that the chip is shipped from factory, 115200 bps speed, double-break at 19200 bps
[15:49:52] <Jartza> std 8n1
[15:50:02] <rue_house> you cant properly do 115200 at 4Mhz
[15:50:12] <Jartza> datasheet disagrees
[15:50:13] <rue_house> huge bit time error
[15:50:30] <rue_house> you CAN do 19200 within ascii spec
[15:50:44] <Jartza> (4MHz) - Default
[15:50:50] <Jartza> max baud rate 225kbps
[15:50:57] <Jartza> min baud rate 0.075kbps
[15:51:12] <rue_house> yea, but you cannot do 115200 within the error spec
[15:51:28] <Jartza> you are now talking about uart peripheral on "old" avr chips
[15:51:39] <Jartza> I'm talking about UPDI
[15:52:03] <Jartza> "Communication through the UPDI is based on standard UART communication, using a fixed frame format, and automatic baud rate detection for clock and data recovery."
[15:52:06] <rue_house> oh, they have an independent oscillator for the uart to get the error on the baud rate right?
[15:53:00] <rue_house> fosc = 4.0000 MHz
[15:53:00] <rue_house> Bit Rate
[15:53:00] <rue_house> (bps) U2Xn = 0 U2Xn = 1
[15:53:00] <rue_house> UBRR
[15:53:00] <rue_house> (dec) UBRR
[15:53:01] <rue_house> (hex) Actual
[15:53:03] <rue_house> Bit Rate Error UBRR
[15:53:07] <rue_house> (dec) UBRR
[15:53:09] <rue_house> (hex) Actual
[15:53:11] <rue_house> Bit Rate Error
[15:53:13] <rue_house> 115.2K 1 0x001 125K 8.5% 3 0x003 125K 8.5%
[15:53:14] <Jartza> "The UPDI baud rate generator utilizes fractional baud counting to minimize the transmission error."
[15:53:15] <rue_house> ugh
[15:53:17] <rue_house> 8.5% error for 4Mhz for 115200 baud
[15:53:48] <rue_house> is that a pll?
[15:54:08] <rue_house> 3 cycles per bit
[15:54:16] <rue_house> there is no resolution to not have error
[15:54:36] <rue_house> unless they use a pll to take it up a whole bunch and divide it down again
[15:55:05] <Jartza> that tiny also has totally different clock module than other avrs
[15:55:31] <rue_house> so it dosn't oscillate at 4Mhz in a normal way?
[15:55:46] <Jartza> ?
[15:55:59] <rue_house> the highest standard baud rate you can do with a 4Mhz clock, within 'good' error is 38400
[15:56:29] <rue_house> http://wormfood.net/avrbaudcalc.php?bitrate=300%2C600%2C1200%2C2400%2C4800%2C9600%2C14.4k%2C19.2k%2C28.8k%2C38.4k%2C57.6k%2C76.8k%2C115.2k%2C230.4k%2C250k%2C.5m%2C1m&clock=4&databits=8
[15:56:30] <Jartza> well the problem is still elsewhere
[15:56:36] <rue_house> if you insist
[15:56:42] <Jartza> doesn't matter what baud rate I set, it doesn't work.
[15:56:46] <Jartza> not even with 1200bps
[15:56:53] <Jartza> and nothing in between 115200 and 1200bps
[15:57:10] <rue_house> whats your interface circut look like?
[16:00:06] <Jartza> http://i.imgur.com/MEz0JZd.png
[16:00:54] <rue_house> ok
[16:00:54] <Jartza> and oscilloscope shows I get good input on the pin, the chip just doesn't answer anything
[16:01:02] <Jartza> I need to figure out more about UPDI
[16:01:15] <rue_house> you dont need control of the reset line?
[16:01:20] <Jartza> anyways. this chip has more like microchip peripherals, so that old AVR crap about baud rates doesn't stand
[16:01:30] <Jartza> UPDI *is* reset line :)
[16:01:54] <rue_house> dude, at 4mhz, it dosn't matter what the hardware is, you can only hit particular baud rates properly
[16:02:04] <Jartza> incorrect
[16:02:15] <rue_house> ugh
[16:02:57] <Jartza> depends of the hardware
[16:03:00] <rue_house> so, can I synthasize properly a 999Khz osc from a 1Mhz clock source?
[16:03:34] <rue_house> even spaced pulses?
[16:03:43] <rue_house> without a pll
[16:04:45] <Jartza> nitpicking
[16:05:52] <rue_house> no, physics
[16:06:34] <rue_house> you can make time slices of any rate by integer divisions of a fixed rate
[16:07:21] <Jartza> sure you can't make 999kHz from 1MHz but that's not what we were talking about
[16:07:29] <Jartza> and did I say integer divisions?
[16:08:46] <Jartza> with 4MHz clock I can get 115200 with fractional divisor 2.17
[16:08:49] <rue_house> I doubt they would employ a set of delay lines that are walked thru to get timing right
[16:09:31] <rue_house> do to the .17 they just have a pll and divider
[16:09:57] <rue_house> datasheet crashed on me, not interested in paging thru it more
[16:10:21] <Jartza> google "fractional baud rate divisor" or something like that
[16:11:30] <Jartza> the datasheet seems to have some crap characters in it, already reported that
[16:13:39] <Jartza> https://www.google.com/patents/US6392455
[16:15:29] <Jartza> anyway. similar to what ARM processors have... and old sharp 16-bit processors... and some microchip ones
[17:49:20] <ENHering> Hi.
[17:53:11] <ENHering> Have you drank you 1/4 cup of isopropanol today, Casper?
[17:55:17] <carabia> murican units are so dumb, i'm not even gonna bother
[17:57:56] <ENHering> In the end it is about chemical safety.
[17:58:10] <carabia> drinking isopropanol?
[17:58:22] <ENHering> Ignoring toxnet
[17:58:47] <carabia> sounds fun. why are we bringing this up?
[18:00:10] <ENHering> I'm trying to leave a message. Ignoring knowledge from toxnet is bad. Can kill people. There was a discussion about this yesterday.
[18:00:13] <carabia> also, why didn't anyone end up using that one scale by the french guy. I always forget the name
[18:00:36] <ENHering> How do you share code here?
[18:00:44] <carabia> your favorite pastebin
[18:01:15] <ENHering> my irc client asked me if I wanted something similar. Don't know if it is automagical
[18:01:20] <carabia> ENHering: i for one would be keen on seeing natural selection less prohibited
[18:01:35] <carabia> ENHering: what?
[18:02:48] <ENHering> My irc client is lime chat. It suggested using GlST to paste code. I do not even know what gist is. I'll go for pastebin
[18:03:07] <carabia> people should be left to their own devices regarding warnings of toxic substances
[18:03:13] <carabia> ENHering: it's that github thing
[18:06:37] <ENHering> I had a PhD advisor who almost killed a student because he thought safety measures were too strict. The student was left inside a closed room with a bottle of chloric acid to clean some substrates. The bottle felt from her hand.
[18:08:04] <ENHering> People should be directed to the good references on safety. It is their responsibility to follow the guidelines or not. But no one can misdirect another person saying that chemical safety is useless.
[18:09:11] <ENHering> In many years of research, working with many kinds of extreme conditions and dangerous stuff, I or any of my students had accidents.
[18:09:31] <carabia> toxnet says breathing chloric acid is bad, mkay
[18:09:32] <ENHering> My message.
[18:10:03] <ENHering> They also list cases and consequences. Useful info.
[18:10:22] <carabia> well depends on the item, it seems to be more of a collection of papers
[18:10:57] <ENHering> Search for a chemical compound. It is in the middle of the paper list
[18:11:41] <ENHering> changing subjects, this is an amazing new view of our universe: http://www.ufolou.com/p/blog-page_14.html
[18:11:54] <carabia> huh? I'm searching across all the databases
[18:12:14] <carabia> anyway, was she really in grave danger? how fast does it vaporize in room temp and how big was the room?
[18:13:01] <ENHering> Her clothes got wet with acid.
[18:13:12] <carabia> what a fuckup
[18:13:15] <ENHering> yep
[18:13:17] <carabia> did she get burns?
[18:14:06] <ENHering> Another case in my university: a student took hf from one bottle, another acid from another one and return the excess of one of them to the wrong bottle
[18:14:09] <carabia> not sure if she'd still die, toxnet says it does produce skin burns on tissue contact...
[18:14:34] <ENHering> This is nothing you want on your record...
[18:14:35] <carabia> yeah, see, i was never that big on chem. i would've blown myself up too.
[18:15:22] <carabia> it is true, all i'm saying is imminent danger to life might have been an overestimation
[18:15:53] <ENHering> maybe yes. But you do not want to breath HCl vapor
[18:16:16] <carabia> it is true, but don't you have those ventilated cabinets in which to conduct experiments?
[18:16:25] <carabia> i'm sure they don't recycle the fumes back into the room, just fire them up
[18:16:26] <ENHering> These things should be taken seriously. We have only two lungs and two eyes.
[18:16:50] <ENHering> In that case the bottle felt off the fume chamber
[18:16:59] <ENHering> Forget...
[18:17:22] <carabia> no i mean, you can get the air and the fumes moving if you open the cabinets and just stand someplace else
[18:17:49] <ENHering> The idea is that people must be aware of the dangers related to what they are dealing with. Just that.
[18:17:58] <carabia> that is true. i understand
[18:18:26] <carabia> soo anyway, what is this ufolou
[18:18:46] <ENHering> Lou Baldin is the author of some books.
[18:19:10] <ENHering> About UFOs. He has a very peculiar view of why we are here.
[18:19:39] <ENHering> And his view is well aligned with many ancient texts, like the vedas.
[18:19:52] <carabia> he likes to write "lol"
[18:20:01] <ENHering> yep. a lot.
[18:20:08] <carabia> searching for lol\s produced 49 results on that page
[18:20:30] <carabia> most of which seem actual lols!
[18:20:42] <ENHering> He has a very interesting way of trasnlating ancient knowledge to our times.
[18:21:17] <ENHering> If you like science fiction you may enjoy "A day with an extraterrestrial"
[18:21:24] <carabia> i for one am very skeptical about a book entitled "...answers about the life, the universe, and everything else"
[18:21:31] <carabia> is this a satire?
[18:21:47] <ENHering> He does not mean it to be a satire
[18:21:53] <ENHering> maybe it is
[18:22:03] <carabia> my point exactly
[18:22:27] <carabia> THOUGH. Have to give it to this guy. At least his not trying to sell these books on barnes&noble / amazon for $59.99
[18:22:40] <carabia> he's*
[18:22:51] <ENHering> All that for free. All his books.
[18:23:05] <carabia> yeah. so he seems alright.
[18:23:51] <ENHering> I wonder if UFOs exist. There are so many reports, by so many people from so many places. And those reports match so well.
[18:23:58] <carabia> there's nothing worse than the scientology people who charge you for both books and lessons, more and more so you can climb up the level-tree from MASTER IV THETA to CLEAR OK CLEAR GOD LEVEL
[18:24:11] <ENHering> If they do exist, they hols a technology that is far different from what we know.
[18:24:37] <ENHering> hold.
[18:25:18] <ENHering> You would love a couple from Canada, who claim to have amazing answers for gravity research, but only if you buy their lab books at 50 dollars each
[18:25:46] <carabia> of course
[18:26:11] <carabia> well, for example if the many-worlds theory is anything to go by with, then it's a statistical impossibility that we're the only ones
[18:26:39] <carabia> "cosmologists" are quite a useless bunch, however
[18:26:59] <ENHering> they study many interesting hypotheses.
[18:27:02] <carabia> i would love to have a job where i could simply come up with untestable theories
[18:28:11] <ENHering> If you rethink many things you will notice that most of what we call scientific knowledge is a set of hypotheses that can be unproven at any time.
[18:28:33] <carabia> surely they're interesting. but in the sense of seeking knowledge it's nigh-stalemate. though naysayers are always written in the history books as the idiots, in any case there are more imminent problems to solve
[18:28:58] <ENHering> There is a field called futurology...
[18:29:08] <ENHering> They study how the future will be
[18:29:10] <carabia> surely, but for the most part of cosmology there simply are no tests to be conducted
[18:29:44] <ENHering> I suggest a series of nice books called Hidden in Plain Sight
[18:30:17] <ENHering> He talks a lot about that, in a nice language. Even I could understand.
[18:30:28] <carabia> futurology?
[18:31:25] <ENHering> futurology or something similiar. People study how spaceships should be. And if they be like that how should they behave, then how should they be made, which materials would be necessary, whoat hould be their strength, etc.
[18:31:54] <ENHering> Must be very, very nice to work in that field.
[18:32:42] <ENHering> Like a reverse engineering of possible futures.
[18:32:57] <ENHering> Forewarned is forearmed
[18:34:21] <ENHering> I don ot remember the name of this area. I believe it was futurology
[18:34:38] <carabia> perhaps. if i was calling the shots, i would not fund this. then again, i'm not. and someone else will fund it.
[18:35:04] <ENHering> probably
[18:36:29] <ENHering> You probably would not fund many of the condensed matter physics projects too
[18:36:39] <ENHering> And they produce a lot of devices.
[18:37:17] <carabia> that's a completely different branch
[18:37:36] <ENHering> You should see the projects and their costs...
[18:37:51] <carabia> well, they do work with tangible principles in some way, shape or form.
[18:38:28] <ENHering> People in many countries compete to see who publishes data first about very exotic compounds. Pure competition. Lots of money evaporated in helium baths
[18:38:38] <carabia> where as cosmologists can suggest well, hurrdurr, you know, it has to be strings. cause otherwise we get infinities. strings it is. -- and -- hurr durr, it has to be 26 dimensions, cause you know durr durr, the math doesn't add up otherwise
[18:39:07] <ENHering> cosmologists are advancing math too.
[18:39:36] <carabia> that seems to be the only thing they can do
[18:40:02] <ENHering> In my dumb view, scientific method increases the quality of human life. In any area. Should be enforced at school.
[18:40:26] <learath> ENHering: that's going to make a *lot* of people mad.
[18:40:31] <ENHering> we have better and better telescopes thanks to cosmology questions too.
[18:40:52] <carabia> and exactly how, does telescopes solve issues of human life?
[18:41:05] <carabia> well, do. even.
[18:41:05] <ENHering> CCDs got better.
[18:41:14] <carabia> and consumer products use CMOS
[18:41:15] <ENHering> electronics got better
[18:41:20] <ENHering> Space flight got better
[18:41:37] <ENHering> Everything is interconnected
[18:42:02] <ENHering> Questions move the world. Not answers.
[18:42:46] <ENHering> Getting rid of the heat of a sattelite, cooling down detectors to few mK for years
[18:43:18] <carabia> electronics getting better due to cosmology, is a stretching it orders of magnitude
[18:43:22] <carabia> -a
[18:43:32] <ENHering> all these things generate subproducts. Tecnicians who work at research facilities thake the knowledge to small industries
[18:43:46] <ENHering> take
[18:44:11] <carabia> space flight, well, i don't think it's strictly really cosmology-related. You need human-rated spacecraft and boosters, and 90% of the space launches have nothing to do with cosmology, I believe
[18:44:32] <carabia> they send commsats up tenfold what they send telescopes and other sensors up
[18:44:33] <ENHering> everything contributes.
[18:44:43] <carabia> sure, but the contribution is minimal, to space flight
[18:44:51] <carabia> if not downright negligible
[18:45:14] <carabia> probably way more than tenfold, actually.
[18:45:45] <ENHering> how do you stabilize hubble telescope? There is no air there to danpen(?) the thermal and mechanical energy.
[18:45:52] <carabia> i mean, human-rating spacecraft will be the ultimate crunch to advance space flight. that was the thing i tried to carry over
[18:46:08] <carabia> how is that related?
[18:46:40] <ENHering> this technology was necessary. It had to be developed.
[18:46:53] <ENHering> And it is probably in use down here.
[18:47:22] <ENHering> But you are right. Cosmological questions deal with a future we probably will not live to see
[18:48:23] <carabia> nah, i plan to live for quite long
[18:49:05] <ENHering> Isn't is amazing that you are made from material fused inside a sun?
[18:49:08] <carabia> dying feels quite the bore
[18:49:33] <ENHering> That your gold ring was made of something that was produced in a supernova?
[18:49:50] <carabia> i'll have to get back to you once i get a golden ring
[18:49:54] <ENHering> The iron in your body came from a sun core?
[18:50:11] <carabia> hey, don't touch my iron, i need it.
[18:51:21] <ENHering> That there may exist millions of planets inhabited before Earth ever existed?
[18:51:43] <ENHering> So much to ask, so much to learn.
[18:52:56] <ENHering> Black holes evaporate matter... That is amazing.
[18:53:22] <ENHering> In the end, we know nothing.
[18:53:31] <carabia> i think the existence of other lifeforms is not only possible but probable
[18:53:56] <carabia> however i don't think we're likely to encounter them by a long shot
[18:54:45] <ENHering> And if those questions were asked at school, we would probably produce more environment aware people, who would look at the sky and not see day or night, but a deep, deep empty space separating us from the rest of the planetary bodies.
[18:55:22] <ENHering> carabia: some people say they are here now, living among us. Many people sign their names below those statements.
[18:56:14] <carabia> i know, and while i can't say anything for sure... if i was a betting man i'd put my money against it
[18:56:15] <ENHering> Buckminister fuller has a lot of interesting ideas about taeching at schools.
[18:57:21] <ENHering> Here is a list of good books on the subject: http://www.enhering.com/index.php?p=5
[18:57:59] <ENHering> They show an increasingly complex view of what is happening on Earth now.
[18:58:52] <ENHering> Ardy Clarke wrote amazing books. Very well written.
[18:59:26] <ENHering> Charlie Hall reports his life in the army interacting with them
[18:59:35] <ENHering> and many others.
[19:00:09] <ENHering> If they are right, we are nothing but pets. Or penn pals.
[19:00:13] <carabia> what would be the motive for an alien species to infiltrate us, lowly beings?
[19:00:25] <ENHering> dunno
[19:00:35] <ENHering> what would be it?
[19:00:46] <ENHering> many options
[19:00:47] <carabia> i don't know, i'm not an authority on such a subject
[19:01:22] <ENHering> I do not remember seeing any of htem, so I treat everything as hypotheses
[19:01:50] <carabia> i watched this documentary of a guy going down to china to document panda raising
[19:02:38] <carabia> while i was disgusted by the documentary, perhaps there's an analogy. the people grew them in captivity in a makeshift forest, and they went among them dressed as pandas not to attach them to humans
[19:02:53] <carabia> so perhaps the aliens are raising us in captivity, imitating our appearance!
[19:03:17] <ENHering> Lou baldin says this planet is a pennitentiary
[19:03:40] <ENHering> Others say there are many races with many agendas
[19:04:08] <ENHering> Authors suggest they are here, and have been here before us
[19:04:11] <carabia> and they have disclosed themselves to those exact individuals, so they can charge $59.99 order now!
[19:04:37] <ENHering> those books are cheap on kindle. sometimes one dollar each.
[19:05:13] <carabia> well, for a reason
[19:05:21] <ENHering> lou baldin does not even get money from his writings
[19:05:31] <carabia> yeah, baldin seems like a good guy.
[19:05:31] <ENHering> well.
[19:05:47] <ENHering> I have only listed good people.
[19:06:20] <carabia> on the subject
[19:06:28] <ENHering> But this is just a hypotheses. We may be alone in the universe too.
[19:06:31] <carabia> http://www.thebeatlesneverbrokeup.com/ i can't believe this thing still even exists
[19:07:08] <ENHering> There is another line that says we have never been to the moon.
[19:07:10] <carabia> i have adblock, so i don't know if there's any ads on the site. Perhaps there is
[19:07:48] <carabia> however there's actual reproducible evidence that we have, unlike of the aliens
[19:08:55] <ENHering> two premises
[19:10:06] <ENHering> As I said, I do not remember to have seen any of these things.
[19:11:20] <ENHering> Is there a MC with math coprocessing?
[19:11:29] <specing> MC?
[19:11:34] <ENHering> How do you deal with floats?
[19:11:42] <ENHering> microcontroller
[19:11:45] <specing> sure
[19:11:45] <ENHering> sorry
[19:11:48] <specing> they are called DSPs
[19:11:54] <ENHering> hum
[19:11:54] <specing> digital signal processor
[19:12:26] <specing> you can also get a M4F cortex
[19:12:27] <ENHering> I had a tenfold decrease in speed as soon as I uncommented the floating point calculations
[19:12:38] <carabia> M4F has single precision floats
[19:12:39] <specing> they have floating point unit
[19:13:07] <carabia> of course, if you do avr
[19:13:44] <ENHering> I read somewhere about doing he math with integers
[19:13:48] <ENHering> the
[19:13:56] <carabia> that's what people usually do
[19:14:15] <carabia> your stm32f4 has a single precision fpu
[19:14:44] <carabia> so, if you stick with single precision, it's fast
[19:14:52] <carabia> if you go double then you're fucked again
[19:15:14] <ENHering> i see
[19:15:15] <carabia> though, you can run the chip at a fairly high system clock so
[19:15:31] <carabia> whenever there's a problem just throw more cycles at it. faster.
[19:17:20] <ENHering> I have a counter inside the main loop of the sensor module. It used to change the led state after 200000 counts. Now, with all statistics going on to calculate sensor data std dev, I have to change led state at every 20000 counts
[19:22:31] <specing> my M4F runs at 80MHz, thats a bit faster than a standard AVR
[19:22:52] <specing> also 32bit math helps
[19:22:52] <ENHering> a bit...
[19:23:17] <carabia> stm32f4
[19:23:26] <specing> stellaris m4f
[19:23:30] <carabia> stm32f4** runs up to 168MHz in-spec
[19:23:36] <carabia> yeah, figured
[19:23:47] <carabia> i pressed enter accidentally there
[19:23:50] <specing> hence a bit ;p
[19:24:04] <specing> SLOWPOKE STELLARIS!
[19:24:45] <carabia> I think some of stm32s cm4s are specced to 200+, dunno. I know their cm7s are. and some of their cm7s have double precision fpus
[19:25:05] <carabia> but cm7 really is kind of a silly thing for a microcontroller, haha
[19:27:17] <specing> someone should make a 1 GHz 8-bit mcu just to laugh in everyone's face
[19:27:32] <ENHering> :)
[19:27:48] <Tom_L> 3Ghz with a heatsink
[19:27:51] <ENHering> ATtiny45, 1GHz.
[19:28:11] <specing> too bad it would be like <0.1 mm^2 on a 22nm process and you can't buy such small space
[19:28:12] <ENHering> Flash your leds like no other one.
[19:28:23] <specing> add 10 MB cache to it
[19:28:33] <carabia> slightly on the note, there was an interesting article on hackaday (for a change) a while ago, where some guy spun his own die off a die fab to blink a led
[19:28:35] <specing> ATfast45
[19:29:05] <ENHering> You will not see it coming
[19:31:07] <carabia> http://hackaday.com/2016/10/13/blinking-an-led-extreme-edition/
[19:31:08] <carabia> this
[19:32:26] <carabia> most of the video is crap but the ending is nice.
[19:32:59] <Jan-> hihi avr people :)
[19:38:37] <ENHering> amazing...
[19:38:57] <Jan-> Eh, this old thing? I just threw it on as I was running out the door. But thanks!
[19:53:58] <ENHering> I 'd love to have a debugger for atmega328p
[19:54:26] <carabia> well, drop the buck$$$ and get the ICE
[19:56:19] <carabia> or a second-hand dragon. But I think even those are pricy
[19:56:33] <Jan-> I'm not that clear on how a debugger works for a microcontroller.
[19:56:43] <ENHering> me neither
[19:57:30] <carabia> but ENHering you should be more than fine just using serial to debug. hw or sw.
[19:57:52] <Jan-> first thing I wrote
[19:57:53] <carabia> tx-only
[19:57:55] <Jan-> basic serial echo
[19:57:59] <Jan-> yes, tx only
[19:58:04] <carabia> yeh
[19:58:09] <Jan-> you do have to write a very cut down itoa function, so you can log ints.
[19:58:13] <Jan-> but that's only a dozen lines.
[19:58:29] <ENHering> There is a nonsense bug in the code.
[19:59:07] <ENHering> I uncomment a group of lines and the MCU hangs.
[19:59:23] <ENHering> One of these lines is a simple delay.
[19:59:42] <carabia> care to share?
[20:00:45] <ENHering> http://pastebin.com/NfvkkTWM
[20:01:13] <carabia> where does it hang, this is quite a mouthful
[20:01:16] <ENHering> Lines 177 to 190
[20:01:55] <ENHering> If I comment all of them, the code works. If I uncomment any of them, it hangs.
[20:02:04] <ENHering> Even if it is only a delay.
[20:02:25] <ENHering> This seems to be a stack overflow, or a segfault somewhere else.
[20:02:50] <carabia> hmm. What's Delay_ms() like?
[20:03:01] <ENHering> I 'll share
[20:03:22] <carabia> is it just a wrapper around _delay_ms so you can use umm variables not known compile time?
[20:03:34] <carabia> well, a _delay_ms loop, that is
[20:03:43] <ENHering> http://pastebin.com/mDBJibbH
[20:04:18] <ENHering> Line 111
[20:04:34] <ENHering> Just a simple delay.
[20:05:46] <carabia> ah it's like that
[20:05:59] <ENHering> Very stupid delay
[20:06:26] <carabia> ha, yea. some people just loop over _delay_ms n times
[20:06:42] <carabia> _delay_ms(1) that is
[20:07:02] <ENHering> I'll fix that later
[20:09:17] <Jan-> sad reality
[20:09:23] <Jan-> no matter how much guitar processing electronics you own
[20:09:26] <Jan-> someone will want something else
[20:09:36] <Jan-> :(
[20:14:11] <carabia> ENHering: what if you replace those with _delay_ms(1) to test?
[20:14:34] <ENHering> I'll try now, carabia.
[20:14:38] <carabia> you gotta include util/delay.h
[20:19:46] <ENHering> still hanging
[20:22:00] <carabia> hmmh, what's the sensor you're reading?
[20:23:50] <ENHering> these readings are done through SPI. They are done by another module, with another 328p. It reads the sensors and store the data to calculate the std devs and averages of each sensor output. I tested that module and it is working fine. It responds to whatever is asked. I tested it using an arduino and a serial output
[20:25:00] <ENHering> I have a LIS331 accel, a HMC5883L magnetometer, an l3g4200d gyro and BMP085 barometer there
[20:25:16] <ENHering> All four are ok.
[20:26:02] <carabia> and it hangs on all four?
[20:27:40] <ENHering> That module is disconnected now. I have the COMmunications module attached to the ATMEL ICE programmer. If everything is OK the module led blinks after the module is programmed, and keeps blinking. If not, it stays on.
[20:28:08] <carabia> whaa, you have an atmel ice?
[20:28:21] <ENHering> When I comment those lines I get a blinking led. If I uncomment, the led keeps on.
[20:28:24] <ENHering> I do.
[20:28:33] <ENHering> But I do not have atmel studio.
[20:28:48] <carabia> there's little reason not to have it if you own the ICE
[20:28:51] <carabia> little-to-no, even
[20:29:06] <ENHering> Mac is the reason. AS does not run on mac.
[20:29:18] <ENHering> I use avr-tools
[20:29:33] <carabia> vmware/whatever/install windows
[20:29:36] <ENHering> avrdude, and now I'm trying to learn how to use avr-gdb
[20:29:38] <carabia> you do have an intel mac?
[20:30:11] <ENHering> yep. intel mac. But virtualbox makes everything slow if OS is other than XP
[20:30:45] <carabia> install it along the current one then
[20:31:04] <carabia> on a related note, can you show your spi class?
[20:31:13] <ENHering> yep
[20:32:20] <ENHering> http://pastebin.com/MWdf5U0L
[20:32:50] <ENHering> I also have a USB tiny, which died last week.
[20:33:22] <ENHering> The ICE was boxed until then. I bought it in France, two years ago in case the USBtiny died.
[20:37:38] <ENHering> does fck/128 slow down the MCU significantly?
[20:37:52] <ENHering> I'm running the SPI at fck/128
[20:38:02] <carabia> it only slows the bus down
[20:38:18] <carabia> that's the clock prescaler for the spi bus
[20:38:57] <ENHering> That is what i thought. But the COM module led switched off after many,many seconds. Maybe it is not hanging, just incredibly slow.
[20:38:58] <carabia> in a sense you could say it does, cause it blocks. but indirectly.
[20:39:22] <ENHering> I'll try fck/16
[20:41:00] <carabia> at 16 MHz that'd be 125 kHz bus speed
[20:41:20] <carabia> /128
[20:42:12] <ENHering> I'm running at 8MHz. 3.3V.
[20:42:37] <carabia> well that'd be 62.5 kHz
[20:42:38] <carabia> I think
[20:42:46] <carabia> getting late, math might be off!
[20:43:14] <ENHering> This is the makefile, that makes everything easily reprodicible, in case you are interested:
[20:43:15] <ENHering> http://pastebin.com/wLVfZ46H
[20:43:22] <ENHering> Good night. It is late here too.
[20:43:36] <carabia> nah, not going quite yet I think
[20:45:34] <ENHering> Ops... fck/16 made it blink a bit faster. SPI really blocks when waits for SPIf
[20:45:46] <carabia> of course it blocks
[20:48:52] <carabia> you gotta get a REAL cpu with DMA
[20:49:21] <carabia> real cpus dont block with puny serial txs!
[20:49:24] <ENHering> It is taking around 1 minute to run 5000 cicles
[20:49:38] <carabia> wat
[20:51:04] <ENHering> hum... That was only the delay that was uncommented... No SPI yet. So weird.
[20:51:52] <carabia> you go with F_CPU in the delay, is it defined correctly?
[20:52:15] <carabia> and i can't think of anything else than that, and ckdiv8 fuse being set
[20:52:18] <ENHering> probably not. But the uncomented delay was the one you suggested.
[20:52:35] <ENHering> ckdiv8 fuse is unprogrammed
[20:52:47] <carabia> delay.h relies on F_CPU being defined correctly before including it
[20:54:36] <ENHering> DEFINITIONS=-DF_CPU=8000000UL -DATMEGA328P=1 -D__AVR_ATmega328P__=1
[20:54:39] <carabia> it should be 8000000 and people explicitly cast it to unsigned long
[20:54:54] <carabia> hmh
[20:56:15] <carabia> and fuses are set to external xtal?
[20:56:23] <ENHering> Now I removed all the delays and left only the SPI transfers, amazingly slow
[20:56:33] <ENHering> no. Fuses set to internal oscillator.
[20:57:07] <ENHering> I bricked a few AVRs when enabling external xtal. Decided to leave the problem for the near future.
[20:57:09] <carabia> oh wait yeah it's an 8mhz osc
[20:59:57] <carabia> spi transfers, fck/16?
[21:00:05] <ENHering> yep
[21:01:10] <ENHering> I hate these bugs. I take days to find their cause.
[21:01:35] <ENHering> LED is still on. Probably hanged.
[21:02:03] <CapnJ> is there a guy from people comming from arduino on how to program using AVRDUDe directly?
[21:02:25] <ENHering> I use avrdude directly
[21:02:43] <CapnJ> but is there a guide?
[21:02:46] <ENHering> But I know nothing. Probably someone else can help much more
[21:02:58] <ENHering> hum...
[21:03:07] <ENHering> Probably.
[21:03:32] <carabia> oh wait i just figured
[21:03:42] <carabia> you're using USART, right?
[21:03:53] <CapnJ> usbasp
[21:04:18] <carabia> ENHering?
[21:05:00] <carabia> anyway be right back, need a ciggy.
[21:05:39] <ENHering> Sorry, my daugther cried.
[21:05:46] <ENHering> Yep. I'm using USART.
[21:07:36] <ENHering> USART code: http://pastebin.com/78tM05yM
[21:08:28] <ENHering> CapnJ: What you really need is in that makefile.
[21:08:57] <ENHering> But I believe I have digged around to find more info on how to get rid of arduino and run avrdude
[21:09:08] <CapnJ> I'm still trying to figure out the "benefits" of using the Arduino IDE over using C++ alone
[21:09:51] <carabia> ENHering: no wait, nevermind you're not
[21:10:06] <carabia> I just got fooled by the defs in your spi file
[21:10:08] <ENHering> CapnJ: https://learn.adafruit.com/usbtinyisp/avrdude
[21:10:18] <CapnJ> Thanks!
[21:10:47] <ENHering> CapnJ: If you have a programmer, you probably do not need arduino.
[21:11:01] <carabia> it's just a bit counter-intuitive to set the spi_pin_port and other defs to the usartspi
[21:11:09] <carabia> and then actually use the other spi module
[21:11:46] <ENHering> carabia: you must be talking about the MSPIM
[21:11:49] <carabia> soo... which bus is the sensor actually connected to?
[21:12:16] <carabia> yesh
[21:12:35] <ENHering> I'll explain: In the COM MCU module, there are no sensors. This module is directly connected to the backbone
[21:12:57] <ENHering> https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller <- pictures here
[21:13:03] <carabia> no need to -- i simply want to know, the device you're polling, where is it connected to?
[21:13:30] <ENHering> In the code I showed you I'm polling another module, another atmega 328p
[21:14:09] <carabia> alright, but it's on the spi bus in portb?
[21:14:14] <ENHering> This one is responsible for reading sensores and processing sensor data
[21:14:55] <ENHering> The backbone bus is the spi bus portD
[21:15:48] <carabia> alright, but your code transfers use the portb bus
[21:15:52] <ENHering> PORTD is for talking to sensors, in the modules that have sensors
[21:16:20] <ENHering> nope. The code uses PORTD
[21:16:33] <carabia> http://pastebin.com/MWdf5U0L
[21:16:44] <carabia> line 107 most definitely does not
[21:17:20] <ENHering> HUM.....
[21:17:40] <carabia> the usart-spi has a different buffer for txrx
[21:17:51] <ENHering> Wait...
[21:17:52] <carabia> "MSPIM"
[21:18:06] <ENHering> Yep. MSPIM is another library
[21:18:13] <ENHering> Checking/
[21:18:19] <carabia> yeh, but this is the one you showed me
[21:18:21] <carabia> that the code uses
[21:19:02] <carabia> and SPDR is the portb spi bus data register
[21:20:20] <carabia> perhaps it's just talking to the programmer and being slow due to some spooky action at not so long of a distance
[21:20:36] <carabia> or i'm not sure if you upload it through a bootloader
[21:20:52] <ENHering> no bootloader
[21:21:00] <ENHering> you found a big mess here...
[21:21:47] <carabia> refer to the usart-spi section in the datasheet for the mspim registers
[21:22:04] <ENHering> I have a MSPIM class.
[21:22:15] <ENHering> wait
[21:23:16] <ENHering> http://pastebin.com/BtrxvB5U
[21:23:20] <ENHering> This is MSPIM
[21:25:52] <ENHering> I use it to talk to athe accel
[21:25:55] <ENHering> the
[21:26:29] <ENHering> Ok. Those definitions you pointed are wrong. I completely messed them. I'll comment that code and rewrite it.
[21:26:56] <ENHering> They should point to PB, not to PD.
[21:27:03] <carabia> yes
[21:27:25] <ENHering> But the SPI code is correct. It does not use those definitions. Bits are set directly.
[21:27:33] <carabia> I know
[21:27:34] <ENHering> Thanks a lot for that.
[21:27:46] <carabia> but you say it's connected to the bus on PD!
[21:28:32] <ENHering> Now, about the possibility of interaction with the programmer, I just powered the module alone, decoupled from the programmer
[21:28:39] <carabia> and about the defs, that's why I said it's a bit counter-intuitive to define them like so
[21:28:47] <ENHering> I just opened the kicad schematic of the module. BUS is connected to PB
[21:28:48] <carabia> again, you're trying to talk to PD bus yes??
[21:28:50] <carabia> oh
[21:29:11] <carabia> you said differently a while ago :(
[21:29:17] <ENHering> When I use the PD bus I cannot use USART.
[21:29:19] <ENHering> Sorry.
[21:29:26] <carabia> i know, that's nothing
[21:30:10] <carabia> alright, so anyway. we're back to square one
[21:30:35] <ENHering> yep...
[21:30:40] <ENHering> sorry for the mess
[21:31:49] <carabia> no biggie
[21:32:34] <carabia> you are sure the slave works as expected?
[21:33:08] <ENHering> yep. I tested it using an arduino and the serial output. Answer every call with good data
[21:45:40] <ENHering> I just tried some crazy gymnastice here, uploading arduino code to the COM module and wiring the usart to a USB to tty. But went too far. Did not work.
[21:48:53] <carabia> before that, it was still slow at bus clocked fck/16?
[21:50:23] <carabia> with no delays
[21:50:48] <carabia> and did you verify the data received (echo or something?) with uart?
[21:56:54] <ENHering> I just made two small videos showing the process. They will be uploaded in 5 mins.
[22:01:42] <ENHering> carabia: First one: https://www.youtube.com/watch?v=VHyZjcJpICg
[22:05:42] <carabia> hmmm, the led stays on
[22:05:56] <ENHering> second video: https://www.youtube.com/watch?v=UVaXAsN1HfU
[22:06:06] <ENHering> This is the sensor module test
[22:07:09] <carabia> hmmm yeah so that works
[22:07:47] <ENHering> Yep....
[22:08:28] <ENHering> No idea what is going on. It will take a few more days to find the problem. What I know is that it worked in the past, with an older version of the system.
[22:08:40] <ENHering> Thanks a lot for your help with this.
[22:08:50] <ENHering> I need to go to bed.
[22:09:23] <ENHering> If you get more interested, all the project files are availabe here for download: https://xp-dev.com/hg/YAUVC
[22:10:09] <ENHering> my keyboard is eating letters, or I'm getting old and unable to type.
[22:11:10] <ENHering> I'll be back tomorrow with more info, I hope.
[22:11:20] <ENHering> Thanks again for all help!