#avr Logs

Sep 13 2017

#avr Calendar

12:08 AM day is now known as daey
12:11 AM _ami_: NoHitWonder, which lib do you use for STM32LXX?
12:17 AM enh: This one has more than one SPI, plus all the rest, in a 7mm x 7mm package. LQFP 48.
12:17 AM enh: http://br.mouser.com/ProductDetail/STMicroelectronics/STM32F303CCT6/?qs=%2fha2pyFaduhRYzl9i01%252bkyaDTeT%2fT3f4ieFMMcJ7Fzmg5r4cUTd1bg%3d%3d
12:18 AM enh: A bit expensive though
12:19 AM enh: http://www.st.com/content/ccc/resource/technical/document/datasheet/f2/1f/e1/41/ef/59/4d/50/DM00058181.pdf/files/DM00058181.pdf/jcr:content/translations/en.DM00058181.pdf
12:21 AM _ami_: enh, checkout this board too: m4, f407, http://amitesh-singh.github.io/stm32/2017/09/02/blinking-leds-on-stm32f407zgt6.html
12:23 AM enh: _ami_: That is nice, but the IC is too big for my modules
12:23 AM enh: I believe the LQFP48 is the biggest I can install on the module PCBs
12:24 AM _ami_: hmm, i see.
12:24 AM enh: The STM32F303xC is already a lot to put on a single module.
12:24 AM enh: But I may be wrong
12:25 AM enh: I
12:25 AM enh: I'll go to bed. 2 am here.
12:25 AM _ami_: i think medium density stm32 IC is good option for you.
12:26 AM enh: have a nice afternoon there
12:26 AM enh: which one?
12:26 AM _ami_: enh, thanks, gn!
12:26 AM enh: If you have a suggestion in mind, please send me. I'll accept happy
12:27 AM enh: Bye!
02:49 AM Tachyon` is now known as Tachaway
07:22 AM enh: Is this a good candidate to install in a mcu module? http://www.st.com/content/ccc/resource/technical/document/datasheet/f2/1f/e1/41/ef/59/4d/50/DM00058181.pdf/files/DM00058181.pdf/jcr:content/translations/en.DM00058181.pdf
07:22 AM enh: Pretty powerful
07:25 AM _ami_: enh, dude how much did u sleep? ;)
07:25 AM noHitW_work: sure, but if you want low power, go with L-series. they are more expensive tho.
07:25 AM enh: 4 hours, _ami_
07:25 AM _ami_: < 6 hrs ? :)
07:25 AM _ami_: woah!
07:25 AM _ami_: not good
07:25 AM enh: 1.2 year old baby at home.
07:26 AM _ami_: aha! but i can understand.
07:26 AM enh: heavy load
07:26 AM _ami_: generally first 6 - 8 months are difficult.
07:27 AM _ami_: time to roll though
07:27 AM enh: probably first three years are
07:28 AM enh: I must use any window of spare time to push my stuff
07:28 AM enh: or I accomplish nothing
07:32 AM noHitW_work: how much is that chip enh?
07:32 AM enh: 5.96
07:33 AM noHitW_work: not bad
07:33 AM enh: nope
07:34 AM enh: I wish I made my living in USD. Would be even cheaper.
07:34 AM enh: In BRL it is 18.xx
07:54 AM enh: Plus taxes and all shit
07:57 AM enh: cehteh, I need to define a basic number of servo channels that should be able to control many kinds of vehicles. These channels will be made explicit in the data structure that will be exchanged between modules. How many would you use?
07:58 AM cehteh: huh? cant you make it dynamic?
07:58 AM enh: I can make it uncommentable
07:58 AM enh: not dynamic
07:59 AM cehteh: pretty much depends on the vehicle, for an aircraft i say 3 axis of freedom + speed gives 4, but you can fly a plane with only 3 channels too
07:59 AM enh: I have an array on the communications module that receives info from modules and sends them too. That array size is fixed.
07:59 AM cehteh: cars only have speed and steering
08:00 AM cehteh: a generic copter may have more (octocopter has 8 esc's)
08:00 AM enh: So eight channels should be enough for most stuff
08:01 AM cehteh: generally most protocolls settle around 8 channels
08:01 AM cehteh: CPPM and so on
08:01 AM enh: This is hackable to 16 channels if needed
08:01 AM cehteh: but when you want more features thats not enough (gimbal control, lights, gears)
08:02 AM enh: For each servo I have5 programmable info: enable, zero, max, min and pos
08:03 AM enh: If I keep all 16 on the data array, it will be at least 80 more bytes of SRAM
08:05 AM cehteh: you need frequency too
08:05 AM cehteh: old servod run at 50hz
08:05 AM cehteh: and protocol
08:06 AM cehteh: old servos run at 50hz .. far to low for copters
08:06 AM enh: They are all PWM, not?
08:06 AM cehteh: modern ones at 400hz
08:06 AM cehteh: and ESC's have plenty new protocols
08:06 AM cehteh: oneshot etc
08:06 AM enh: I hope people do not try to mix them
08:06 AM cehteh: you have to mix that
08:06 AM enh: hum
08:07 AM enh: more memory still
08:07 AM cehteh: for example copter ESC's should run at oneshot while a landing gear would be a traditional servo
08:07 AM enh: what is oneshot?
08:08 AM cehteh: and oneshot (and few more modern protrocols ) really stress the cpu because they have much tighter timing and they run in sync with your control loop
08:08 AM cehteh: google that
08:08 AM enh: ok
08:08 AM cehteh: some ESC's use digital protocols CANbus etc
08:12 AM enh: Hum. Basically a higher frequency PWM, but synced with the control loop
08:13 AM enh: digital protocols may be a problem. My servos are controlled by a PWM chip
08:21 AM LeoNerd: ESC?
08:22 AM enh: Eletronic Speed Controller
08:23 AM enh: I can smooth the signal changes, as I have a microcontroller just to control the PWM chip.
08:23 AM enh: This could eliminate jitter
08:26 AM enh: one byt is enough for etting the servo position?
08:26 AM enh: byte
08:26 AM enh: setting
08:26 AM enh: sh*t! my keyboard is msixing all the keys!
08:33 AM cehteh: byte, certanly not
08:40 AM enh: the pca9685 is a 12 bit pwm, 16 channel, 24hz to 1500 hz.
08:40 AM enh: all those 12 bits then.
08:41 AM cehteh: sounds good, for simple pwm
08:43 AM cehteh: or mhm manybe not, servo signals are not really pwm, or at least they are pwm with long pauses, while the duty phase needs to have at least 10bit resolution
08:44 AM devinmcelheran: Has anyone here implemented I2C on ATtiny chips using the USI? I'm trying to find some reading material to learn how, but the only thing I've found is an Instructables article and the author admits that their code was utterly incompatible with other devices in its first iteration and I'm not sure if the second is much better.
08:44 AM LeoNerd: devinmcelheran: I've done that before yup
08:44 AM LeoNerd: I have a .c file handy if you want to stare at it
08:45 AM devinmcelheran: I've been listening to embedded.fm and it sounds like a common practice in the profession.
08:45 AM devinmcelheran: Yes, please, if you don't mind.
08:45 AM devinmcelheran: Have you had any trouble with it? Does it seem to work flawlessly?
08:45 AM enh: cehteh: https://www.nxp.com/products/interfaces/ic-bus/ic-led-controllers/16-channel-12-bit-pwm-fm-plus-ic-bus-led-controller:PCA9685
08:46 AM cehteh: enh: tl;dr .. busy with other things
08:46 AM LeoNerd: I haven't used it a *lot* but for the testing I was doing with it, it seemed to work fine
08:46 AM devinmcelheran: I'll take it either way, thank you.
08:46 AM cehteh: but you can easily do the math when you look at good old servo signals how they where defined/created when everything was analog
08:47 AM LeoNerd: http://paste.debian.net/985880/ <-- I2C for USI
08:47 AM enh: ok
08:47 AM devinmcelheran: Most of what I find is the Arduino ecosystem. But that ties into all the other Arduino stuff too much to make sense of it without familiarizing yourself with all their spaghetti macros.
08:48 AM devinmcelheran: Not that I'm knocking Arduino, it just seems that as much as they tote it as a learning platform, it really takes away the real learning.
08:48 AM cehteh: enh: http://public.pipapo.org/cppm_parser.png thats a logic analyzer plot from the cppm parser i wrote, bottom line is the 8 channel ppm signal
08:48 AM LeoNerd: devinmcelheran: it's a relatively simple implementation. It's a spin-wait blocking one, that uses a CPU delay for timing. It could be improved with a timer unit somehow, but I didn't want to bother for my usecase
08:48 AM devinmcelheran: Or "abstracts" it away, I should say.
08:48 AM enh: thanks
08:48 AM LeoNerd: Eh; Ardunino is pretty terrible for learning real technical details
08:49 AM LeoNerd: It's good enough for showing newbies what is possible, but it doesn't teach *how*
08:49 AM devinmcelheran: LeoNerd, from what I read, you should be able to use the timers built into the USI hardware.
08:49 AM cehteh: 8 short pulses from 500 to 1500µs length distributed over 22ms
08:49 AM LeoNerd: devinmcelheran: the USI module itself doesn't have a timer; it can be clocked from one of the timer units
08:49 AM devinmcelheran: LeoNerd, yeah, it hides everything that's required to understand the difference between programming for micros vs programming for a desktop class CPU.
08:50 AM enh: hum
08:50 AM cehteh: single channel in traditional format is one of these short pulse in a about 20ms frame
08:50 AM devinmcelheran: LeoNerd, I read about a 4-bit counter that should auto increment with the clock and that an interrupt is drive off of that.
08:51 AM cehteh: so you see loong pause and short signal which you need to create accurately (10bit or better)
08:51 AM LeoNerd: Right; the USI has a 4bit counter for its own purposes. How you clock *that* is up to you
08:51 AM LeoNerd: You can software program it, or you can use timer0
08:51 AM enh: ok
08:52 AM LeoNerd: In my implementation I just software program it with CPU busywait delays. It keeps the CPU busy but it's simpler to write for not having to integrate it with a timer unit
08:52 AM devinmcelheran: LeoNerd, okay. Sorry if it sounded like I was arguing. It's just a little difficult when one person has one way of doing it and another has their own.
08:52 AM cehteh: but thats only the old traditional signal (what most receivers output as CPPM sum signal)
08:52 AM devinmcelheran: Is this master or slave?
08:52 AM LeoNerd: Master
08:52 AM LeoNerd: I²C slaves don't generate the clock
08:53 AM devinmcelheran: Awesome
08:53 AM devinmcelheran: True
08:53 AM devinmcelheran: I'm so green, hah.
08:53 AM LeoNerd: Everyone has to start somewhere ;)
08:53 AM enh: yup
08:54 AM LeoNerd: I²C is definitely easier to learn on one of the ATmegas (or even a later ATtiny) with a proper I²C unit, but if you know what you're doing with it, using the USI isn't too hard
08:55 AM devinmcelheran: One of my pitfalls is that my conceptual knowledge and understanding exceeds my practical knowledge (too much reading and not enough hardware?), so I get caught up in details sometimes.
08:55 AM * LeoNerd nod
08:55 AM LeoNerd: Are you familiar with I²C generally? If not, I'd definitely suggest starting on some other chip that supports it at a higher level
08:55 AM devinmcelheran: I've got ATtiny85s, do they have the integrated I2C hardware?
08:56 AM LeoNerd: No; I believe that's just USI too
08:56 AM devinmcelheran: I'm somewhat familiar.
08:57 AM devinmcelheran: I've read into it and I mostly understand the protocol with a couple things I'll have to reread, mainly the start/stop conditions and other non R/W SDA/SCK signals.
09:01 AM enh: devinmcelheran: https://bitbucket.org/enhering/yauvc/src/7fbafe94c299574a34ef1b31ef898eae6408d3cb/firmware/src/classes/interfaces/?at=default
09:01 AM enh: check the TWI code
09:02 AM LeoNerd: Yeah; I²C with a real TWI unit is definitely simpler. I have the code for that too if you want - same .h file :)
09:02 AM LeoNerd: (I have two .c implementations for the two different chips, sharing the same interface)
09:02 AM enh: Not completely my code. I mixed solutions from the internet ntil I got something simple that I could understand.
09:03 AM devinmcelheran: enh, is yours using software to drive the clock or a timer?
09:03 AM LeoNerd: On the TWI unit? The real TWI unit on an ATmega has its own clock divider, so it does all its own counting
09:03 AM enh: dunno. it drives the atmega328p twi
09:04 AM LeoNerd: It's only the ATtiny's USI where you need to count bits individually
09:04 AM devinmcelheran: Okay
09:04 AM LeoNerd: The ATmega's full SPI and TWI units are entirely self-contained and autonomous
09:04 AM enh: thanks god
09:04 AM LeoNerd: The ATtiny's USI is little more than a software-controlled shift register. You still have to do some of the work to make it talk SPI or I²C
09:05 AM LeoNerd: It's about halfway between the full SPI or TWI units, and entirely software-defined bitbanging
09:05 AM devinmcelheran: Oh, so the ATtiny can't do SPI either?
09:05 AM devinmcelheran: Without a driver, I mean.
09:05 AM LeoNerd: The ATtiny totally can do SPI, using the USI
09:05 AM LeoNerd: I've done that too, to great effect. That one I use a lot more
09:05 AM LeoNerd: I have a 'tiny84 talking to an nRF24L01+ in a little battery-powered handheld remote
09:06 AM devinmcelheran: I've got the impression that SPI is more common. Is it because of the higher data rates?
09:06 AM enh: SPI is simpler, ins't it?
09:06 AM enh: isn't...
09:06 AM devinmcelheran: The protocol,yes.
09:06 AM devinmcelheran: The implementation, not sure.
09:06 AM enh: I believe it is
09:06 AM enh: no master slave stuff
09:07 AM LeoNerd: Huh? SPI verymuch still has a master and a slave
09:07 AM enh: it has
09:07 AM devinmcelheran: Instead of addresses you just use a line for chip selection.
09:07 AM LeoNerd: In both I²C and SPI, the master is the side that generates the clock signal
09:07 AM enh: much simpler than i2c
09:07 AM LeoNerd: Generally simpler though, yes.
09:07 AM enh: i2s has that arbitration code too, hasn't it?
09:07 AM enh: i2c
09:08 AM devinmcelheran: Yeah
09:08 AM devinmcelheran: For multimaster buses.
09:08 AM enh: that must be hell on earth to implement
09:08 AM LeoNerd: The protocol of I²C has the ability to do multimaster arbitration, but in practice I've never used it as I've never used a multimaster setup
09:08 AM devinmcelheran: I don't think SPI can do that.
09:08 AM LeoNerd: I've always had one MCU in control of a bunch of slave sensors and whatnot
09:08 AM enh: spi has a simliar stuff
09:08 AM devinmcelheran: I don't think the arbitration can be that complicated.
09:08 AM enh: low the SS of the master and it will fall to slave
09:08 AM LeoNerd: ARB isn't too hard
09:09 AM devinmcelheran: It's probably like a random backoff timer like in ethernet.
09:09 AM LeoNerd: No, it's fancier than that
09:09 AM devinmcelheran: Oh, really?
09:09 AM LeoNerd: It relies on the opendrain nature of SDA
09:09 AM devinmcelheran: Why so?
09:09 AM LeoNerd: SDA is effectively a wired-AND gate. If any one master wants to pull it down, it goes down. Only if no master pulls it down does it stay high
09:10 AM devinmcelheran: I mean, a random backoff timer and then one of them opens the line when the timer expires.
09:10 AM LeoNerd: So how arb works is that the master watches the -actual- value on SDA while it is clocking out the slave selecting address byte
09:10 AM devinmcelheran: Thereby staking claim
09:10 AM LeoNerd: If it sees a lower value going out than the one it wrote, because some other master pulled down the line when it didn't, then it knows it lost the race, so gives up
09:10 AM enh: i wish I could believe in simple implementations
09:11 AM LeoNerd: Mm ;)
09:11 AM enh: I spent weeks to build a protocol to transfer arbitrary data via SPI.
09:11 AM LeoNerd: Well, the devil is always in the detail
09:11 AM devinmcelheran: Yeah, that sounds like ethernet's, albeit it simpler due to the two wire nature. In ethernet they both pick a random time to wait and listen all the while until theirs expires.
09:12 AM devinmcelheran: That's old half duplex ethernet, though.
09:12 AM LeoNerd: At some point I do want to try to design myself a 3-way shared SPI bus though. I want to share an SPI RAM chip between two AVR chips, acting as an offload buffer between them
09:12 AM LeoNerd: The "main" AVR chip would write lots of pixel colour values into that RAM chip in its own time, then hand it over to the other chip (probably just an ATtiny) which would read the values out while spitting them down a WS2812 LED chain
09:13 AM devinmcelheran: There was a duo on embedded.fm that had done that but with flash or eeprom for a hacker convention badge.
09:13 AM LeoNerd: It's not *too* hard to design a scheme whereby both AVRs can share an SPI RAM chip, but I want to see if additionally I can have the second AVR chip be an SPI slave to the first one, for control and setup purposes
09:13 AM devinmcelheran: They had an STM and a PIC running in tandem.
09:14 AM devinmcelheran: Every time I come into IRC for help, the talk is more interesting that what I needed help with.
09:14 AM LeoNerd: :)
09:15 AM devinmcelheran: Random question - I read that the Ateml ARM stuff is some sort of marriage of AVR and ARM. Is that true? And how does that work? Is it just well known Atmel peripherals on the ARM chips?
09:17 AM LeoNerd: I doubt that's the case. For one thing, all the AVR(8) peripherals are entirely 8bit addressed; whereas the ARM CPU core is 32bit
09:17 AM LeoNerd: I haven't really played with those at all though so I can't really speak from experience. I do have an STM32 board I should play with oneday though
09:18 AM enh: LeoNerd: https://bitbucket.org/enhering/yauvc/src/7fbafe94c299574a34ef1b31ef898eae6408d3cb/firmware/src/classes/protocols/?at=default
09:18 AM enh: This may be useful for you
09:18 AM devinmcelheran: I have two STM M0(+?) boards and two ESP32 boards coming.
09:18 AM devinmcelheran: It turns out that the ESP32 basically requires an RTOS, though. I didn't know that when I ordered them.
09:19 AM devinmcelheran: They're dual core, though. I'd never heard of that in micros until I read into them a little before buying.
09:20 AM enh: The slave side is interrupt driven. The master side is triggered when you wanto to transmit or read something from a slave
09:21 AM enh: there is example code on the modules, a few levels above that. If interested, check the SCMModule.cpp in the src folder
09:22 AM enh: IT should work with any one byte interface
09:23 AM devinmcelheran: LeoNerd, about the #define statements in the .c file, I take it you're making those bit twiddled register statements easier to type, right? Is it common practice to use definitions to make portions of setup/config declarative like that?
09:24 AM LeoNerd: devinmcelheran: That is indeed the reason. It is sometimes common practice, but so too is just defining little 'static' functions and letting the compiler/optimiser link it nicely.
09:25 AM LeoNerd: Lately I use -flto to do things like that efficiently, but this code predates my use of that
09:25 AM devinmcelheran: What do you mean by static functions? I'm only familiar with static vars and static methods in c++.
09:25 AM LeoNerd: I *tend* to #define macros for little single-bit twiddling like that, of PORT or DDR registers, but most other things I'd probably make a static function
09:25 AM devinmcelheran: By static function do you mean an inline one?
09:26 AM LeoNerd: Notice how most of the functions in this .c file are labeled 'static'. That.
09:26 AM LeoNerd: No, inline is different
09:26 AM LeoNerd: 'static' really just means this function isn't visible outside this one .c file. But it's a good hint to the compiler that it could be a candidate to inline it
09:26 AM devinmcelheran: What is static in c? I've only seen static variables in c.
09:27 AM LeoNerd: Because the function is 'static', it cannot be called from outside. So if the only occurance of it is inside the .c file itself, the compiler could decide to inline it and not bother emitting a real function at all
09:27 AM LeoNerd: It often does this if it's only called once or twice, for example
09:27 AM devinmcelheran: Ah
09:28 AM devinmcelheran: So, it more or less makes the function private to the file and possibly optimizes it?
09:28 AM LeoNerd: Correct; a better word for it would be 'private'
09:28 AM devinmcelheran: And what's -flto?
09:28 AM LeoNerd: link-time optimisation
09:28 AM LeoNerd: A very good idea on AVR :)
09:29 AM devinmcelheran: Good to know
09:29 AM devinmcelheran: I didn't know that optimizations were made outside of compiling.
09:29 AM cehteh: depends on how your code is written and organized, but can give impressive savings
09:29 AM cehteh: (or none at all)
09:29 AM LeoNerd: Eh.. "compile" vs "link" is really a quite artificial distinction
09:30 AM LeoNerd: "link-time optimsation" generally refers to the sorts of optimisations that can only occur once you link the .c files together
09:30 AM cehteh: nah
09:30 AM devinmcelheran: I thought that the .o files were linked?
09:30 AM LeoNerd: E.g. if main.c only calls uart_setup() in uart.c once, at startup, with constants in its arguments, then only at link time can we apply things like constant-folding
09:30 AM cehteh: it is real link time optimization, the compiling phases work vastly different
09:30 AM LeoNerd: So what -flto does is allows the compiler to constant-fold and inline functions *between* .c files
09:30 AM cehteh: the compiler emits some immediate RTL representation to the linker only then
09:31 AM LeoNerd: This can make a huge difference to CPU time and code size
09:31 AM cehteh: and the linker does shitloads of 'compiling'
09:31 AM LeoNerd: In fact, I have programs that *can* only fit on a chip because of -flto; without -flto there is too much code emitted and it no longer fits on a 32Ki flash part
09:31 AM cehteh: and do not even try to debug code compiled with lto :)
09:31 AM devinmcelheran: That's interesting.
09:31 AM cehteh: it looks like it was put in a blender
09:32 AM devinmcelheran: cehteh, I've heard debugging code with any optimizations is especially difficult in embedded systems.
09:32 AM cehteh: code is ripped apart on lower levels than functions and reorganized
09:32 AM LeoNerd: I tend not to bother with onchip debugger anyway
09:32 AM devinmcelheran: Apparently it can throw intricately timed events off and stuff?
09:32 AM cehteh: devinmcelheran: lto is a complete different league :)
09:32 AM LeoNerd: printf'ing to a spare UART or soft-UART on a GPIO, or toggling and LED, combined with an LA. Usually does me just fine
09:33 AM cehteh: when you code 'safely' and standard conforming then everything should stay fine, just expect the compiler/linker can and will do anything allowed
09:34 AM cehteh: so for timed stuff you need inline asm and some volatiles
09:34 AM cehteh: but also you need to understand volatile
09:34 AM cehteh: and use macros with memory barriers and so on
09:34 AM devinmcelheran: Yeah, embedded.fm stresses volatile.
09:34 AM cehteh: good code uses it rarely
09:35 AM cehteh: most people dont understand all its implications
09:35 AM devinmcelheran: Well, I should say that they stress the use of it when using interrupts.
09:35 AM devinmcelheran: I'm reading the book Making Embedded Systems, which is written by one of the hosts of the podcast.
09:36 AM cehteh: only when sharing data between interrupts and non interrupted code *but* even then its sometimes not a good idea
09:36 AM devinmcelheran: They have some really interesting guests, like a guy that's using machine learning to assist with "smart prosthetics."
09:36 AM cehteh: dont blindly declare any variable you use in a interrupt as volatile, that kills performance
09:36 AM LeoNerd: Most of my ISRs tend to be little more than { task_schedule(SOME_TASK_ID); }
09:36 AM polprog: volatile tells the compiler "dont touch this, code it as is"
09:37 AM cehteh: for any more complex task its often better to cli/sei and copy the interrupt variables into some safe space
09:37 AM LeoNerd: UHMUGURD SAFE SPACE!
09:37 AM polprog: in case of variables it's value will be always tied to HW, so any change will not only affect a register it is stored in but the memory cell as well
09:38 AM devinmcelheran: I was told that it boils down to "don't trust that you think you know what this variable is, check it as you use it." Which implies performance issues, but ensures that if an interrupt came through one clock before you use it, you'll still check it's actual value.
09:39 AM cehteh: more importantly is that you often need to access more than one variable in some atomic way, volatile wont help you
09:44 AM devinmcelheran: You would have to disable interrupts for that, right? To be certain that your access was entirely atomic, I mean.
09:51 AM cehteh: there are different ways to archive this, disabling interrupts is one way
09:53 AM cehteh: also reading/copying a structure in a loop until you have it read 2 times with the same data, works, thats more costly but doesnt block interrupts, sometimes thats desireable
09:53 AM cehteh: and some other ways
10:34 AM enh: I could put all this info in an array of longs in atmega328p and still have 1.1k left of SRAM. https://pastebin.com/05tBnMrQ
10:39 AM HighInBC: enh: not sure how MODULESELECTOPTIONS_H defines those values, but it may be storing them in flash not ram
10:40 AM HighInBC: ram will be used as they are accessed if so
10:40 AM enh: it only indexes these values. They are stored in an array of longs
10:41 AM enh: int32_t m_anDataArray[MODULE_SELECT_TOTAL_OPTIONS];
10:41 AM devinmcelheran: Wouldn't you be better off using defines for them, then?
10:41 AM devinmcelheran: You would reduce the memory needed for the enum.
10:41 AM devinmcelheran: And still be able to use your mnemonics
10:42 AM enh: When I use the enum I can use the index in a switch statement directly
10:42 AM enh: system wide
10:42 AM enh: with defines also, i know
10:43 AM devinmcelheran: Can't you still do the same with defines?
10:43 AM enh: probably can
10:43 AM enh: but isn't the code cleaner with enum?
10:43 AM enh: dunno
10:43 AM devinmcelheran: I'd say it's the same, really.
10:44 AM bss36504: I really love when i kick the power cord out of my work computer >.<
10:44 AM enh: I'll think abou that
10:44 AM enh: time for a coffee, bss36504.
10:45 AM devinmcelheran: Or you could use structs.
10:45 AM polprog: i love it when i lick the switch on the strip
10:45 AM polprog: kick*
10:45 AM bss36504: enh: I guess so. I'll hold out for the team lunch where I get a beer on the company's dime.
10:45 AM enh: licking the switch sounds weird
10:45 AM polprog: against healh and safety rules i think
10:45 AM enh: yep
10:46 AM enh: hey dude. Stop licking that switch!
10:46 AM devinmcelheran: Is the fetish a product of your career/hobbies or did you end up in this field of interest as a result of it?
10:46 AM enh: fetish
10:46 AM enh: :)
10:46 AM enh: I want to see a brick flying.
10:47 AM enh: then I wanto it to fly over my neighbour sound system.
10:47 AM enh: Finally I wanto the brick to be dropped
10:47 AM Tom_itx: just a brick?
10:47 AM enh: Then I'll get back to physics.
10:47 AM devinmcelheran: Is it bluetooth?
10:47 AM Tom_itx: how about a brick of C-4?
10:47 AM enh: i can't c4.
10:47 AM devinmcelheran: Or Sonos/other wifi?
10:47 AM enh: A pity
10:47 AM devinmcelheran: You could always jam the signal.
10:48 AM enh: I'm lazy
10:48 AM polprog: enh: here you go :P https://youtu.be/wBAiysFzLOY?t=17s
10:48 AM enh: I prefer dropping bricks
10:49 AM enh: devinmcelheran: I 'll think about defines instead of enums when i understand the problem
10:49 AM enh: too dumb I am
10:50 AM enh: Tom_itx: can you c4? I totally want to learn how to make some
10:50 AM bss36504: pretty sure making C4 is illegal in basically any country
10:50 AM enh: must be
10:50 AM bss36504: I almost googled how to, but I don't want to be on a watchlist haha
10:51 AM enh: me neither
10:51 AM devinmcelheran: A lot of countries have vague laws about it like not distributing it.
10:51 AM devinmcelheran: But creating it might not be off the table.
10:51 AM devinmcelheran: Using it without a license might be another issue, though.
10:51 AM devinmcelheran: bss36504, lookup the anarchist cookbook.
10:51 AM enh: against neighbour's sound system, you mean?
10:52 AM devinmcelheran: enh, in general.
10:52 AM polprog: i dont wanna googlee that boo
10:52 AM enh: ah
10:52 AM bss36504: I mean, in america you can buy shitloads of tannerite, which is pretty explosive. But If I bought 2000lbs of fertilizer I'd have a bad time (with the gov't)
10:52 AM polprog: k
10:52 AM devinmcelheran: People forget about gasoline. What's worse, a van filled with gasoline or fertilizer explosives?
10:52 AM enh: maybe if I drop a fertilizer bag...
10:53 AM devinmcelheran: enh, you could go the less aggressive route and pay for one of those services that literally mail you animal poo.
10:53 AM enh: it is not easy to ignite a van with gasoline. fluid would be ejected before iginition temp
10:53 AM devinmcelheran: It won't resolve the problem, but you'll at least feel good about it.
10:53 AM bss36504: How about instead of literally bombing them, just glitter bomb them
10:54 AM devinmcelheran: bss36504, yes
10:54 AM devinmcelheran: Glitter is the herpes of the crafts world. It'd take a decade before he managed to deglam his house.
10:54 AM enh: i thought about a directional speaker and a c tone. Druing weeks.
10:54 AM enh: during
10:54 AM devinmcelheran: C tone?
10:55 AM enh: 440 Hz
10:55 AM devinmcelheran: That's A
10:55 AM enh: or microphony sound
10:55 AM enh: ops
10:55 AM polprog: shooting glitter from the speaker?
10:56 AM enh: nope
10:56 AM devinmcelheran: In my town we have the "good neighbor bylaw" where anything that's annoying is illegal.
10:56 AM enh: just making them crazy searching for the source of that sound
10:56 AM polprog: ah
10:56 AM enh: Where is your town, devinmcelheran?
10:56 AM enh: I will move there
10:56 AM devinmcelheran: North Bay, Ontario, Canada
10:56 AM enh: Ah, Canada. Home of civilized people
10:57 AM polprog: in some polish electronic magazines there was often a project of a device that starts to beep some time after you shut the light off (to sleep) and stops as soon as you turn it on
10:57 AM devinmcelheran: The previous mayor wanted to turn it into a retirement town, so there are some ridiculous laws.
10:57 AM devinmcelheran: polprog, that's pure evil.
10:57 AM enh: Love those laws, devinmcelheran
10:57 AM enh: i like that, polprog
10:57 AM enh: Do you have a copy of that article?
10:58 AM HighInBC: polprog: if you made it a very low sound instead of a beep it would be much harder for a human to locate it
10:58 AM HighInBC: as low sounds are less directional
10:58 AM polprog: yeah, it's in polish but i think you can manage to translate
10:58 AM enh: Imagine yourself living near someone who likes bad music. Even funk stuff. Really low quality tastes.
10:58 AM devinmcelheran: enh, they're nice when you're on the protected side, but they can be pretty annoying if you want to play your drum kit and your neighbor is hypersensitive even though he would rev his muscle car really loud from six in the morning to eleven at night.
10:58 AM polprog: http://elportal.pl/pdf/K06/02_11pipek.pdf ,it's called "The Torment Beeper"
10:59 AM enh: Thanks for that, polprog!
10:59 AM polprog: ofc it's 555 based :P
10:59 AM HighInBC: extra points if you can make it produce a soft raspy breathing sound
10:59 AM enh: I'll make a few and throw in their house
11:00 AM HighInBC: then a quick gasp followed by silence when the lights come on
11:00 AM polprog: lol
11:00 AM enh: If I had enough money I would buy their house and flat it down.
11:00 AM devinmcelheran: Imagine how crazy they'd go if you changed the pitch of the beep so as to imply there's some sort of notification or change in state.
11:00 AM devinmcelheran: It might make it harder to find, too.
11:01 AM enh: lol
11:01 AM polprog: i had an idea of making several beepers connected with a network so they beep at random
11:01 AM enh: a nice project.
11:01 AM daey: super high frequencies are a pita to locate. you sometimes can only hear them when you angle your head into the right direction
11:01 AM enh: amazing use for a network, indeed
11:01 AM polprog: yeah that too
11:01 AM daey: in a specific place in the room
11:02 AM devinmcelheran: Also, if you have a pair and one beeps shortly after the other to further increase the positional ambiguity of random beeps.
11:02 AM devinmcelheran: Put one INSIDE the smoke detector.
11:02 AM enh: see? A lot of good things can be accomplished when there is a purpose
11:02 AM devinmcelheran: Make it time out after being moved.
11:04 AM enh: inside a car this would make wonders
11:04 AM polprog: they cease beeping for a moment after they detect one's beed defused
11:04 AM enh: ops... one down...
11:04 AM devinmcelheran: When I was in college my classmates put a cellphone in a PC and turned off the vibration. Someone would call it and it sounded like the user of that computer was disrupting the class with some video online.
11:04 AM enh: humans are so bad.
11:05 AM enh: the beeps can carry codes...
11:05 AM enh: you could have an infrared sensor and emitter too...
11:05 AM enh: get some commonly used codes around and repeat them random.ly
11:06 AM enh: instead of a network, the beeps can be used to communicate
11:07 AM enh: many good ideas
11:07 AM devinmcelheran: There was actually a proof of concept virus that did exactly that. It was essentially dialup in supersonic frequencies.
11:08 AM polprog: gotta solder a QFN-16... it's small...
11:08 AM enh: ah, devinmcelheran: a reason for enums. They self reorder if you add or take one.
11:08 AM devinmcelheran: Once a computer was infected, it could still comunicate, even if air-gapped.
11:08 AM devinmcelheran: enh, true, but how often will you be doing that?
11:09 AM devinmcelheran: And you can also give you defines meaningful int equivalents.
11:09 AM devinmcelheran: That way, scaling your external devices is a matter of adding and so on.
11:09 AM enh: polprog: flux on PCB and on IC, melt solder past on PCB with hot air, place the IC above and hold with a tweezer until it is caught by surface tension of solder.
11:10 AM devinmcelheran: polprog, solder paste? I've yet to try it, but it looks awesome. It has flux right in it.
11:10 AM enh: devinmcelheran: I'll keep thinking
11:10 AM polprog: devinmcelheran: dont get fooled, you still need a hell of flux
11:11 AM enh: devinmcelheran: My stuff
11:11 AM enh: https://hackaday.io/project/11724-yauvec-yet-another-unmanned-vehicle-controller
11:11 AM devinmcelheran: Yeah, flux does miracles. I was soldering with the cheapest of solders, cheapest of irons, and then no flux. No matter what I did, it was impossible to solder properly.
11:11 AM enh: polprog: I use a no clean flux that is transparent and needs only a drop
11:12 AM polprog: me too
11:12 AM devinmcelheran: enh, are those custom PCBs?
11:12 AM polprog: also gel flux from a syringe
11:12 AM polprog: devinmcelheran: yes
11:12 AM enh: yep
11:12 AM polprog: devinmcelheran: learn some EDA (like kicad) and you will be able to make those too !
11:12 AM enh: kicad is amazing
11:13 AM polprog: it's fun, and you can get prety artistic
11:13 AM enh: i moved from eagle to kicad in two weeks
11:13 AM polprog: me too !
11:13 AM devinmcelheran: Did you order? they look multi layer, or is that a silk screen on top?
11:13 AM enh: feel so free
11:13 AM enh: i ordered them
11:13 AM enh: pcbway
11:13 AM enh: good service in the last two orders. Nothing to complain
11:14 AM devinmcelheran: I want to try the old fashion DIY way with the copper blanks.
11:14 AM devinmcelheran: And ironed on toner
11:14 AM enh: get yourself a hot air rework machine, for like $80.00, and you can do a lot.
11:14 AM polprog: devinmcelheran: dont
11:14 AM polprog: trust me
11:14 AM polprog: it's pain in the ass
11:15 AM enh: these are 4 layers
11:15 AM polprog: i'd rather pay 20 bucks and wait for a week
11:15 AM enh: cannot do at home without a lot of equipment
11:15 AM polprog: also, you can go 2 layer easily
11:15 AM polprog: and soldermask and silkscreen
11:15 AM polprog: it's a whole different league as we say in poland
11:15 AM devinmcelheran: enh, I have one. The Yihua 862D+. It's a cheap Chinese one, but no complaints so far. It's reflow + iron and takes Hakko tips.
11:15 AM enh: i have a small cnc and i still order
11:16 AM devinmcelheran: I paid about $80USD for it, too.
11:16 AM polprog: done
11:16 AM polprog: that was simpler than it seemed
11:16 AM enh: mine is a chinese clone afr 850a
11:16 AM enh: only hot air
11:16 AM polprog: i have a dremel butane iron
11:16 AM enh: soldering iron is on another station
11:16 AM polprog: for hot air it's <3
11:16 AM enh: can you do smd with that, polprog?
11:16 AM polprog: the only bad thing it looks like a big vape :P
11:17 AM polprog: enh: of course i can
11:17 AM enh: no ic burning?
11:17 AM devinmcelheran: I want to try and make my own PCB just for the sake of having done it. Maybe I'll only do power stuff on it, or a guitar pedal or something. I wouldn't trust toner and an etching agent for a QFP or something with that fine a pitch.
11:18 AM enh: it should work well, devinmcelheran. But you can do only two layers
11:18 AM polprog: enh: i used to burn pcb but i have a feel for it now, you need to hold it 1 1/2 inch away from the board
11:18 AM devinmcelheran: enh, yeah, it's mainly for me to do it myself, the same reason I moved away from Arduino stuff.
11:18 AM enh: This works too: http://gabuleu.blogspot.com.br
11:19 AM enh: cheap laser, black ink, small cnc.
11:19 AM enh: but i still order
11:19 AM enh: i design for future production, so I use four layers
11:20 AM devinmcelheran: If you were careful enough and had thin enough copper blanks, could you (within reason) adhere multiple blanks together for multiple layers?
11:21 AM enh: the insulation is the problem. It must be thin, yet handle heat from soldering
11:21 AM enh: and stay in place
11:21 AM devinmcelheran: Yeah, I hadn't thought about the heat.
11:22 AM enh: http://www.drdobbs.com/when-enum-just-isnt-enough-enumeration-c/184403955?pgno=2
11:24 AM polprog: shit i dropped an 0603 cap :P
11:24 AM enh: big one
11:25 AM enh: i dropped a few 0205. Never ever found them
11:25 AM enh: Put a flashlight tangent to the floor
11:25 AM enh: their shadows will reveal them
11:29 AM cehteh: i have OSB plates at floor in my workshop :D
11:30 AM cehteh: you can drop a 1" nut there and not find it again
11:30 AM enh: Look: https://imagebin.ca/v/3aGLWOXfSWSy
11:30 AM enh: These are the samples we used to mount.
11:30 AM enh: the tip of the diamond you see is 300um diameter
11:31 AM enh: the sample is < 50um wide
11:31 AM enh: we had to spot weld those gold wires
11:31 AM enh: and those samples commonly disappeared from view because we breathed
11:32 AM cehteh: :)
11:32 AM enh: finding them was always a problem. And sometimes we had only one
11:32 AM cehteh: what are that?
11:32 AM enh: Now think about why I do not want to do condensed matter physics any more
11:32 AM polprog: wow, that's tiny
11:33 AM polprog: i'd show you mine but it's work stuff...
11:33 AM enh: special alloys. Heavy fermion systems. Inside diamond anvil pressure cells filled with liquid argon.
11:33 AM polprog: wow
11:33 AM enh: wow is when they simply break down and you have to restart a two week setup again
11:34 AM enh: any error means restarting from zero
11:34 AM enh: and lovely is when you find a sample but do not know if it is yours
11:34 AM enh: the diamond cells ara then cooled down to a few mKelvin.
11:35 AM enh: and measurements are taken until they reach room temp
11:35 AM enh: one week, one point in a diagram
11:35 AM enh: hell.
11:36 AM enh: i get shakiy hands just by remembering...
11:44 AM devinmcelheran: I'm reading through some USI driver code and I'm seeing DDR and PORT a lot. PORT is for writing to and DDR is for configuring right? And what does DDR stand for?
11:47 AM polprog: Data direction register
11:47 AM polprog: or east germany
11:47 AM devinmcelheran: Okay
11:48 AM devinmcelheran: Thank you
11:52 AM LeoNerd: Dance Dance Revolution
12:13 PM JanC is now known as Guest39146
12:13 PM JanC_ is now known as JanC
12:24 PM polprog: yay, stuff works
12:42 PM polprog: i wouldn't wish any of you making a complex prototype on a universal board
12:42 PM polprog: just dont
01:41 PM JanC_ is now known as JanC
03:01 PM TheHexaCube: hey there, is this the right place to ask about something concerning the STM32?
03:02 PM LeoNerd: There's probably better p'aces, but many folks here might know anyway
03:02 PM LeoNerd: places
03:02 PM TheHexaCube: to be more specific, i'm looking at the guidelines for own designs, and at some point it says to connect VDDA and VREF+ - if I look at the pinout however, they seem to be the same pin
03:03 PM TheHexaCube: 1) https://i.imgur.com/TLkM49p.png
03:03 PM TheHexaCube: 2) https://i.imgur.com/e0hNnmo.png
03:03 PM TheHexaCube: pin 13 seems to be both VDDA and VREF+
03:10 PM NoHitWonder: maybe in some chips it is the same pin and in some others not. if both of those links would be from same datasheet then it would be strange
03:10 PM NoHitWonder: but the first one is app note
03:13 PM TheHexaCube: right, fair enough, I'll look if I can find a specific instruction for that IC
03:13 PM TheHexaCube: thanks thoguh!
03:13 PM TheHexaCube: *though
03:49 PM hetii: Hi :)
03:49 PM hetii: I have stlink, usb blaster, lpclink, all them use jtag connection, is it means that I can use any of them to work with any jtag target?
04:07 PM polprog: goodnight
04:10 PM hetii: polprog, goodnight :)
04:30 PM Lambda_Aurigae: hetii, no.
04:30 PM Lambda_Aurigae: jtag is a standard suggestion
04:31 PM Lambda_Aurigae: jtag interfaces are as varied as there are manufacturers who might even think about jtag.
05:26 PM Casper: I feels like jtag got botched
05:29 PM Lambda_Aurigae: and then some.
09:04 PM enh: hi
09:04 PM enh: https://imagebin.ca/v/3aJ91F8YZP1m
09:04 PM enh: A possible next generation MCU module for my project
09:06 PM enh: I'll probably have to add fine pitch headers too, to handle the many peripherals that this IC have