Being trolled by STMicroelectronics - Page 1
Forum section: electronics / general

author: Psi
author_rank: Super Contributor
timestamp: May 16, 2018, 04:12:42 am
content: Being trolled by STMicroelectronics engineers in the LIS2DE12 Accelerometer datasheet.http://www.st.com/resource/en/datasheet/lis2de12.pdf

author: ataradov
author_rank: Super Contributor
timestamp: May 16, 2018, 04:35:32 am
content: A bit like this exists in a lot of Atmel/Microchip devices as well.Just some setting that was supposed to be optional, but was determined to be mandatory.

author: Dubbie
author_rank: Unknown
timestamp: May 16, 2018, 04:38:52 am
content: Ha!I just wrote a driver for that chip the other week. I also chuckled at that line.

author: xaxaxa
author_rank: Regular Contributor
timestamp: May 16, 2018, 04:40:35 am
content: well if you work with stm32s often you know they are all full of gotchas; forgot to enable RCC_AFIO? some of your peripherals just don't work and you don't know why. Enabled your adc on a stm32f1 and suddenly uart stops working? oh you have to look through the entire pin remapping table and make sure no peripherals share the same pins. I don't even know why the pin mapping on the stm32f1 is peripheral-based rather than pin-based like the stm32f0. Last time I still haven't managed to get usart receive working even though I've double checked all the registers I can think of - I can see the uart waveform onthe RX pin but the receiver on the stm32 just never reports anything.I will never use an stm32 in any mission critical devices for the simple reason it violates the "no surprises" principle EVERYWHERE.

author: ataradov
author_rank: Super Contributor
timestamp: May 16, 2018, 04:44:26 am
content: Everything is a surprise in a new device. All new devices I've worked with (excluding members of the same family) from different manufacturers had something initially strange in them.With principles like that you will never use anything more complicated than a resistor. Or devices you already know and got used to all the quirks.

author: xaxaxa
author_rank: Regular Contributor
timestamp: May 16, 2018, 04:57:57 am
content: I haven't had that experience with atmel or TI microcontrollers or even the esp8266; i don't know but it just seems to me that everything in stm32 is designed to be confusing; something that takes me a few minutes to get working on any other platform takes hours of debugging on stm32; not even the gpios can be trusted and I end up having to poke the pins with a multimeter just to make sure the gpios are even outputting what I want them to output.Even learning fpga development was far easier and more straightforward; when I set a gpio to mode output and drive the signal with a '1' I *know* for sure that the pin is now high, provided the pcb design isn't messed up. In stm32f1 you potentially need to do something different for every pin; for example the pin named "PB4" does NOT power up as "PB4"; you have to set something in the jtag controller registers to get that pin to be a gpio. Arguably this is a pin naming issue but it was still a big surprise on something supposed to be simple.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 16, 2018, 06:25:10 am
content: Quote from: xaxaxa on May 16, 2018, 04:57:57 amNot the JTAG controller, the alternate function multiplexer (AFIO). Older parts just say "this pin is NJTRST". With modern 32 bitters you can choose to use it for GPIO if you have SWD and don't need JTAG, but you need it during reset to program it so it defaults to JTAG. Looks like you're just ranting on it being a modern part you don't understand yet.Just remember, it is hard to write good documentation. And we can't yet transfer memories with BrainLink™, so you'd have to do it with PDFs for now.

author: ataradov
author_rank: Super Contributor
timestamp: May 16, 2018, 06:29:26 am
content: Well, we are two for two. On Microchip SAM V7x pin PB4 also powers up as one of the JTAG pins and needs to be disables to be used as GPIOIf I were stressing like this over all minor inconveniences in the MCUs, I'd have grey hair by now.

author: JPortici
author_rank: Super Contributor
timestamp: May 16, 2018, 06:33:14 am
content: Quote from: xaxaxa on May 16, 2018, 04:57:57 ampretty much, yeahAnyway, we had one product that changed from the dsPIC(don't remember which exactly) to its "A" version (may have been dsPIC33FJ256GP708A)the first release went out of production and since then we had intermittent issues with the canbus.i then went looking at the datasheets, checking registers while debugging and i noticed that an undocumented bit was 1 in the previous release, 0 in the current release.Set the bit at startup, no more faults since then.I think it i also saw it in the errata

author: Jeroen3
author_rank: Super Contributor
timestamp: May 16, 2018, 06:35:30 am
content: Quote from: ataradov on May 16, 2018, 06:29:26 amNo hair would be more accurate I think. You'd have pulled it all out.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 16, 2018, 06:47:53 am
content: Quote from: ataradov on May 16, 2018, 04:44:26 amHey, Z80s in DIP40, PLCC44 and so on are still readily available (if nowhere near competitive with modern ARMs and such, let alone in terms of power).Tim

author: xaxaxa
author_rank: Regular Contributor
timestamp: May 16, 2018, 07:05:21 am
content: well suppose I'm implementing the WIRING api pinMode() function; I'd have to special-case those pins since there is no universal way to say "set this pin to gpio mode no matter what alternative functions are available on it"; it's even worse if i want to support analog pinMode, since I don't know what other functions may be on each adc-supported pin and I'd have to hard code a table for every device variant, then have some complex logic to go through each possible alternate function and either set the right remap bits or disable that peripheral. What if i want to remap only usart rx? that's not possible because setting the remap bit remaps the entire peripheral.The stm32f0 doesn't have this problem but that begs the question - why are even the gpio facilities different between f0 and f1? I have a lot of library code that I want to work with both f0 and f1, and I prefer to avoid special casing as much as possible.

author: ataradov
author_rank: Super Contributor
timestamp: May 16, 2018, 07:10:19 am
content: Quote from: xaxaxa on May 16, 2018, 07:05:21 amNo, you just disable overriding functions in the startup code.Quote from: xaxaxa on May 16, 2018, 07:05:21 amBecause sometimes you learn new things and use cased as you use the device, and it makes sense to address those issues in the newer designs. Otherwise you are stuck with original bad design.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 16, 2018, 07:26:05 am
content: Quote from: xaxaxa on May 16, 2018, 07:05:21 amYou can't. Improvise. Adapt. Overcome.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 16, 2018, 08:06:54 am
content: Quote from: ataradov on May 16, 2018, 07:10:19 amOr you do a Microchip and just keep adding bad to worse.Anyone ever used PIC24? I've heard horror stories...Tim

author: Yansi
author_rank: Super Contributor
timestamp: May 16, 2018, 08:24:42 am
content: Well sorry guys, nothing new.Any larger 32bit MCU is full of registers, with undocumented bits and bytes, that in some cases need to be cared of: Typically: "leave these reserved bits at reset value" or such.A single LPen bit in the accelerometer is still nothing compared to the Silabs EZRadioPro devices. There are some registers that contain invalid values after reset and these needs to be rewritten by the user. But you will never find out, unless you read through all of these like 200+ registers descripttion! Jeez... I was pissed.

author: Yansi
author_rank: Super Contributor
timestamp: May 16, 2018, 08:28:43 am
content: Quote from: xaxaxa on May 16, 2018, 07:05:21 amJeeez. You haven't worked with STM32 much, have you? STM32F1 is an really old series made back then when the Cortex M started. The pin mappin and reampping feature was garbage and was abandoned and replaced by the more freindly AF multimplexers such as the F0 has. You should not be bitchin about, you should be glad that was abandoned!

author: Dubbie
author_rank: Unknown
timestamp: May 16, 2018, 08:47:02 am
content: I would never choose an F1 chip.I always choose between an F0 or F4 for my projects.Because I am an amateur, I use cubeMX to plan out my pin usage and generate the init code. Haven’t run into any problems yet with that method, but that may be because I don’t know what I don’t know.

author: fourtytwo42
author_rank: Super Contributor
timestamp: May 16, 2018, 09:06:38 am
content: Quote from: T3sl4co1l on May 16, 2018, 08:06:54 amMeeahhhhI decided self flagulation was not enough and not drawing enough blood so I went for PIC24EP AND used many features in it's high speed PWM!!! The medicine is definetly working, there is blood all over the workbench

author: fourtytwo42
author_rank: Super Contributor
timestamp: May 16, 2018, 09:08:56 am
content: Quote from: Dubbie on May 16, 2018, 08:47:02 amIt depends what peripherals you want, if you need a lot of analogue F3 is the best IMOPBut sadly as I found there pwm is a bit deficient

author: xaxaxa
author_rank: Regular Contributor
timestamp: May 16, 2018, 10:07:29 am
content: Quote from: Yansi on May 16, 2018, 08:28:43 amoh I thought stm32f1 was newer than f0. That clears it up, thanks; yes the f0 has much more sane pin remapping.I only got on the stm32 bandwagon because the stm32f103 is really cheap, has usb, and really good "bang for the buck" in terms of processing power and ram... Only the f1 and f0 are reasonably priced (~$1), so I guess my only choice in stm32 left is f0 then.

author: madires
author_rank: Super Contributor
timestamp: May 16, 2018, 10:21:26 am
content: Bonus points for Chinglish, contradicting statements and commands/registers lost in space. You'll love datasheets for LCD controllers.

author: Yansi
author_rank: Super Contributor
timestamp: May 16, 2018, 11:02:11 am
content: LCD controller datasheet are still nothing compared to touch screen controllers, I mean those capacitive ones! We are currently developing something with a lovely 480x800 panel with a CTP. The LCD controller was indeed pain in the butt (ILI9806E), it required a ton of registers to be filled with settings, that all pretty much depend on the exact HW workings of the panel itself! Despite the fact the panel is chinese (Startek/Shenzen), the chinese guys were pretty helpful after we wrote them. They were only baffled where did we get those panels (Taobao).The CTP controller was an another one. The display came wit the CTP already glued on and we didn't know anything about it, apart from the controller type and pinout. The same was needed: A metric shitton of registers, specific to the HW of the CTP. Doh! We couldn't figure that out, without the CTP datasheet. Fortunatelly - my friend found that these registers in the CTP controller are non-volatile, already written by the manufacturer. That saved the whole project!Quote from: xaxaxa on May 16, 2018, 10:07:29 amAll other series use the AF multiplexers, only F1 has those annoying remap features.You may want to have a look at L0 series too, when looking for very cheap ones like L011. The F3 series also has a very good ratio of bang for a buck, as these are quite not as popular as they should.

author: JPortici
author_rank: Super Contributor
timestamp: May 16, 2018, 11:57:42 am
content: Quote from: JPortici on May 16, 2018, 06:33:14 amfound it: dsPIC33EPFJ128GP706AQuoteQuote from: T3sl4co1l on May 16, 2018, 08:06:54 amonce. in high school. PIC24FV KA series. i tried many times without success to use that idiotic ADC.if anybody asks i'll rather use a PIC18 K42 thank you very muchdsPIC33E are more than fine though

author: TassiloH
author_rank: Regular Contributor
timestamp: May 16, 2018, 01:41:56 pm
content: I guess one will find stuff like that in most complex devices:I've recently ported an USB CDC device library to add support for the STM32F7 controller series (before it was only for STM32F4). I read the migration guide "not software compatible". Hm. Looked at the reference manual and thought: "Well, looks pretty similar, I can make this work without many code changes". I found the differences in VBus detection settings etc, but it still wouldn't work, just no device visible to the host.Many hours later I found the reason (basically by reading every register with the debugger and comparing between F4 and F7): The SDIS bit in the DCTL register. Same functionality on both controllers (that is why I missed it before), but the state after reset is different (on STM32F407, session/D+ pull-up is enabled after reset, on STM32F767, it is not). I just didn't see the difference in the Hex number which is given as reset state(I am basically posting this so that google can find it, so someone running into the same problem can save some time)

author: tszaboo
author_rank: Super Contributor
timestamp: May 16, 2018, 01:52:33 pm
content: You know, I got a gotcha from ST sensors just now as well. LIS3xxx so the sensor has I2C and SPI interface. They are on the same pins. So far OK, I wouldnt care. How do you select between I2C and SPI? With the CS signal of the SPI.Seriously, was this designed by aliens who never saw SPI in their life? So you want to use SPI, and connect more than one device on the same SPI line? Well, you better hope that the sensor doesn't interpret your SPI communication with a different device as a start condition on I2C, because then it starts sending data...

author: rstofer
author_rank: Super Contributor
timestamp: May 16, 2018, 02:24:48 pm
content: Quote from: T3sl4co1l on May 16, 2018, 06:47:53 amI have a 50 MHz Z80 running CP/M off a Compact Flash drive. It's pretty quick! There are ARMs that are much faster but some of the jelly bean parts are in the same speed range.The LPC2106 (ARM7TDMI) was only 60 MHz.It's a fun board to play with when I get nostalgic.

author: aandrew
author_rank: Frequent Contributor
timestamp: May 16, 2018, 04:26:10 pm
content: Quote from: NANDBlog on May 16, 2018, 01:52:33 pmNothing wrong with this, and it is common with several vendors' devices. You're asking the vendor to do your systems level engineering which is impossible.Now if you want to complain about I2C devices that *require* you to dummy-clock to get them out of being stuck in some goofy-ass state... ugh.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 16, 2018, 09:32:24 pm
content: And on that note...There was an ADI part, a DDS I think, with SPI done by a retard. Not even kidding. Apparently the interface state does not reset on CS rising. So everything is fine the first few frames, assuming you do everything perfectly, every time, of course. Inevitably a bit error occurs, the whole thing goes out of whack, and you have no choice but to reset it. There's no COMM reset, it's, I forget if it has a full-chip reset, or it needs to be power cycled. But yeah, that.Tim

author: thm_w
author_rank: Super Contributor
timestamp: May 16, 2018, 09:44:11 pm
content: Low pass enable or Low power enable? The first one makes a bit more sense than the second, since you would expect it to work with low power = 0.Also for general power down, ODR controls that so it seems to be unrelated. But its not that unusual for some chip to default to low power/disabled mode at startup.

author: langwadt
author_rank: Super Contributor
timestamp: May 16, 2018, 09:56:14 pm
content: Quote from: T3sl4co1l on May 16, 2018, 09:32:24 pmseems to usually happen when you let the analog designer do digital parts of a chip

author: fourtytwo42
author_rank: Super Contributor
timestamp: May 17, 2018, 07:34:16 am
content: Quote from: langwadt on May 16, 2018, 09:56:14 pmI worked for a company who's engineers designed an ASIC containing a very fancy modem for metropolitan area networks but the digital interface they put on it had less bandwidth than the modem!! Many many meetings were nececery to get them to accept that and from then on the knives were out...........

author: AndyC_772
author_rank: Super Contributor
timestamp: May 17, 2018, 07:43:32 am
content: Quote from: Psi on May 16, 2018, 04:12:42 amI think those accelerometers must have become part of the ST range via an acquisition.Their data sheets are unrelentingly awful. Vague, incomplete, poor English, with a lot of relevant information located in separate "application notes" which, I strongly suspect, were written by (real) ST engineers after seeing just how bad the OEM data sheets were.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 17, 2018, 09:58:36 am
content: The real ST-troll is in the ADC Injected channels. Now, this is a nice feature, don't get me wrong. It allows to "inject" slower (or faster) samplerate channels in a regular stream of triggered conversions.But to configure it you have to assign a channel to the sequence registers: JSQ1 to JSQ4.Good, you'd think it runs the sequence from 1 to 4.No... It starts with 4-n count, thus with 2 injected conversions it does sequences JSQ3 then JSQ4.Then, it stores the results in the injected data register, JDR1 to JDR4.You'd think JSQ4 goes to JDR4.No... The first conversion always goes to JDR1, thus with 2 injected conversion it does JSQ3=JDR1 -> JSQ4=JDR2.This is some genius trolling to make sure you have to read all the fineprint.Oh, and this is the best mistake not fixed for19 revisions: attachment.

author: tszaboo
author_rank: Super Contributor
timestamp: May 17, 2018, 08:59:03 pm
content: Quote from: aandrew on May 16, 2018, 04:26:10 pmNo, it would be fine, if you would have a 5th pin to select between SPI and I2C. Here, the CS pin of the SPI is this pin, which is ridiculous, because SPI cannot be shared with any other peripheral.

author: Yansi
author_rank: Super Contributor
timestamp: May 18, 2018, 03:11:53 pm
content: Quote from: Jeroen3 on May 17, 2018, 09:58:36 amThe reference manual states clearly what is the order of the seqence, so what?

author: Red Squirrel
author_rank: Super Contributor
timestamp: May 18, 2018, 03:19:53 pm
content: For some reason this reminds me of when I found 12v LED bulbs on Amazon that use a normal 120v socket base. It specified that they were 12v but there were so many reviews of people saying they blew up on first use.