EmbeddedRelated.com

Zoltan Kocsi (@Kocsonya)

PhD, MSc, been designing/programming embedded systems for 30+ years. Experienced with Linux, never used Windows. Worked on various fields, from medical through industrial control to building automation and more. Expert level knowledge of C. In the last 10+ years almost exclusively worked with ARM core based MCUs and SoCs. Before that used to work with Z80, 68HC11, AVR and M68K as well. FPGA design in (System)Verilog, mainly Xilinx. Schematics entry and PCB design with Eagle.

Re: SD card logging in STM32 Microcontroller

Reply posted 2 months ago (02/01/2024)
"I managed to get it working and I measured the time it takes for the writing instructions. In my case is around 3-4 us, but after every 128 writing instructions,...

Re: [ESP32] [ESPIDF] Simoultaneous interrupt handling

Reply posted 7 months ago (09/06/2023)
Mechanical buttons tend to bounce, which means that when you press or release them, it is not a single transition from one state to the other, but a series of transitions...
I don't know why you find it scary, really. They give you the equation for calculating the baud rate, which is pretty simple, for the baud rate is PCLK divided by...

Re: Open source, Generic, Secure CAN Based Bootloader

Reply posted 10 months ago (06/24/2023)
I don't want to sound negative, but I think it's not going to be easy, to say the least. You need to cater for too many situations. Simple thing: on some systems...

Re: USB communication

Reply posted 10 months ago (06/08/2023)
Well, you need to look at the data sheets. If your hub is unpowered, then all power is supplied by the USB port on your board. It then has to power the 3 USB peripherals...

Re: USB communication

Reply posted 10 months ago (06/06/2023)
I don't know the answer to your second question, but for the first it won't be different. Linux handles the hub internally and you don't have to do anything with...

Re: Embedded Linux guys, report in.

Reply posted 1 year ago (04/15/2023)
The question is, how much SW background you have, and how familiar you are with Linux. If by not having much experience with processors and micros you mean you...

Re: Embedded Linux guys, report in.

Reply posted 1 year ago (04/14/2023)
Linux is Linux, all those different names are more about the build system than the kernel and the user code. You want to run some application code on your gizmo....

Re: Replacing specific bits in a number

Reply posted 2 years ago (05/30/2022)
There are other caveats with bitfields too. Obviously you declare every HW register as volatile. Volatile bitfield operations, however, require (by the C standard)...

Re: Replacing specific bits in a number

Reply posted 2 years ago (05/28/2022)
Yes, you can do it and there is no need to rotate the register, it is enough to shift the replacement byte. Say, you want to set the most significant byte:new_word...

Re: Interface mems microphone to microcontroller

Reply posted 2 years ago (12/03/2021)
If it's a differential microphone, why not connect it to the OPA as a differential signal? You can then use the OPA to set an arbitrary standby output voltage (e.g....
I think you will need to give us more. So far, you said "I built something. Turned on, didn't work. I tweaked it, and it still doesn't work. Tell me what's wrong.".Give...
As these chips communicate using fixed 16-bit long SPI messages, if you daisy chain three of them, you need a 6 byte buffer. If you use separate transmit and receive...

Re: Another Noddy Question

Reply posted 3 years ago (06/08/2021)
Well, there were comments about -1 possibly causing problems with signed/unsigned and so on. But you don't need -1, any value that is outside of the valid value...

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/30/2021)
At least in C and derived languages the && operator is specified to stop evaluating as soon as the first condition is false and similarly, the || operator...

Re: Skillsets from 8-bit, 16-bit, 32-bit

Reply posted 3 years ago (12/22/2020)
Apart from what everyone else said, they might be looking for experience in different fields. If you've worked with 8 bitters, then you probably keep data sizes...

Re: Embedded C - Linking obj file

Reply posted 3 years ago (11/12/2020)
Usuallylinkers use object files in their entirety. If you want selective linking, split myFunc.c into the separate functions, myFunc1.c, myFunc2.c and so on, compile...

Re: RMS calculation over one cycle 50/60Hz

Reply posted 3 years ago (10/16/2020)
If you sample by 6kHz, then your sample rate actually is an integer multiple of both 50Hz (6000/50=120) and 60Hz (6000/60=100).The mains frequency is usually changing...

Re: SPI Signal

Reply posted 4 years ago (10/13/2020)
Considering that SPI needs 4 signals plus ground, a 40-lane flat cable is not a very likely choice. Even if every second lane is GND, and a few used to deliver power,...

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/03/2020)
There's a quite interesting book on the subject. It's old, but still, every bit of it still stands. It's "Peopleware" by Timothy Lister & Tom DeMarco. It is...
Well, ARM has many instruction sets. There was the original 32-bit ARM ISA. Then, for embedded systems they came up with a more code-space efficient limited subset,...
While I agree that learning a 32-bit uC coming from an 8-bit background might be steep, it's not really the core that makes it hard. It's just what surrounds it....
MIPI DSI is a specification to delivers video (and configuration) data with high-speed differential signalling. I doubt that an 8-bit PIC could do it. An ARM based...

Re: Energy managment

Reply posted 4 years ago (08/25/2020)
As it was said before, you need to work out a power budget. Random charging is not necessarily a battery killer. What you need to consider, though, is that batteries...

Custom LCD

New thread started 4 years ago
For a scientific project I'd need a linear polariser where I can control the polarisation angle on a pixel by pixel basis.My idea is to use an LCD, with only one...

Re: When is a State Machine not a State Machine?

Reply posted 4 years ago (07/20/2020)
Well, I think you can call it a state machine, if you really want, but it's a bit of a stretch. It's a state machine as much as thisfor ( int i = 0 ;; i = ( i +...

Re: AT45DB641E dataflash

Reply posted 4 years ago (07/17/2020)
I would look into the driver source code. 16000 is a very human number, not a computer one. So it is unlikely that it is bits being chopped off or anything like...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/14/2020)
The other way around, extern const. The order is important; if you use const extern the compiler will complain. The keywords extern, register, static and auto are...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/13/2020)
Well, the const keyword is a bit of a misleading thing. If you read the C standard it turns out that the const keyword means the following, not more, not less:"I...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/13/2020)
Two comments, apart from the 'extern' business that "hodgec" has already told you.1. You are wasting space. You store 1 bit in one byte. You could store all the...

Re: STM32H747 GPIO access by two cores

Reply posted 4 years ago (07/07/2020)
Yes, it is true for all pins and all peripheral modules.

Re: STM32H747 GPIO access by two cores

Reply posted 4 years ago (07/07/2020)
I mean, you don't need to do anything.The peripherals don't share pins. Each pin can be used by one and only one peripheral at the time, including the GPIO. When...

Re: STM32H747 GPIO access by two cores

Reply posted 4 years ago (07/07/2020)
If the I2C is done by an I2C module on the chip, then you need to do nothing. The granularity of the GPIO is indeed port-width. However, when a pin is assigned...

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
Well, your example contains these:(uint32_t) (red << 16)where red is int. What you told the compiler was 'shift the signed int red by 16 bits then convert...

Re: failure to wake up LPC2148 from power down mode

Reply posted 4 years ago (05/31/2020)
no wht m sayn iz that when the chip wakes up u shud set pll and pincon and pindir and all aftr PCON=2 instead of ISR cos thats where execution will continue after...

Re: failure to wake up LPC2148 from power down mode

Reply posted 4 years ago (05/30/2020)
The power-down mode does not call the IRQ handler when it wakes up, in fact interrupts can be disabled both on the CPU and the VIC. You need to enable the wake up...
Yes, you are right. UB cannot be warned against enough times.There is implementation defined behaviour, which is something that the standard leaves to the compiler...
> ISO/POSIX C at least guarantees a char is 8 bits todayWell, I wouldn't be that sure of that:An object declared as type char is large enough to store any member...
That should not be the case. The C standard says that the result of an integer division must be "the algebraic quotient with any fractional part discarded" and...
The answer is the C standard...Char can be signed or unsigned, depending on the compiler. You can force it either way by declaring the variable signed char or unsigned...
Depends on the chip. First, the bus width is one thing, but the internal architecture is an other. Back in the old days the 8088 was pretty much an 8086 with an...
It is up to the compiler to name your variables any way it likes. As long as it is doing it in a consistent manner, the same compiler generated name will refer to...

Re: STM MCU for GPS Tracker

Reply posted 4 years ago (04/20/2020)
As beningjw said. Forget the 8-bit chips. The ARM core based 32 bits chips can be sent to really low power consumption mode and they are just so much simpler to...

Re: USB composite device with Cortex M

Reply posted 4 years ago (03/30/2020)
It does not depend on the microcontroller. The USB controller on the chip gives you the physical transfer capability, everything above that is your firmware. The...
I'm not familiar with this particular chip, nor with the cubemx framework, but I often work with other STM32 chips On those, to configure the RTC (and some of the...

Re: Rolling over before reaching 256 (8051)

Reply posted 4 years ago (02/08/2020)
Take a look at either uuencode or base64. They both transform a 3-byte (i.e. 24-bit) block to 4 bytes where all 4 bytes are printable ASCII characters.uuencode has...

Re: Has anyone seen this GCC compiler behavior before?

Reply posted 4 years ago (01/19/2020)
Yes, you are completely correct.A lot of people does not seem to know how positively evil the C standard is regarding undefined behaviour.Undefined behaviour basically...
Are you sure that the other memory chips have their addresses set correctly?
Do you have one or more spare port pin(s) to which you can put a scope?You could toggle them every time you enter and leave the ISR and also every time you enter...
A possible issue is that in your ISR you have the following:ISR() {     if ( ( IRQ_source_reg & 0x0e ) == 0x04 ) {         process_receive_char;...

Re: Looking for better touchscreen displays.

Reply posted 4 years ago (01/02/2020)
Take a look at the FT81x chips from FTDI (more precisely, the FTDI spin-off Bridgetek). They are quite interesting.The chip does not have a frame buffer, but it...
For a simple AVR micro that you possibly just use for hobby projects you probably don't need a bootloader. Burn the chip and that's it.But if you develop a system...

Re: LPC2148 UART0 and UART1

Reply posted 4 years ago (11/13/2019)
1. Check the power, the state of the reset pin and as @hodgec pointed out, the state of the ISP pin.2. If it's all good, check that your code is actually running....

Re: Industrial RS485 converters

Reply posted 5 years ago (10/05/2019)
Driving the wire on its own is not a major issue. Of course you need proper impedance matching termination at both ends. You will have a limited data rate; maybe...
As mr_bandit suggested, a scope would definitely help.An other thing that you might consider is to check whether after StartConversion() the SPI becomes busy or...

Re: NOR Flash as mass storage with cortex M Series.

Reply posted 5 years ago (06/28/2019)
PDF is a bit more complex than HTML. PDF has its roots in PostScript. PS is a full-blown stack based language, Turing complete an all. That is very cool, because...

Re: general linux question about distro/kernel

Reply posted 5 years ago (03/15/2019)
Forget the distro for a second.The way Linux (and any unix system) boots is, roughly, the following:Bootloader gets loaded and startsIt loads the kernel and a very...
Software interrupt is an interrupt triggered by software. That is, the ISR is started not because some hardware requests a service but because you execute a special...
Well, for starters, when the RF module is powered down, you will receive a constant 0, which is a break condition. When you turn the power on, first the RF module's...
Most MOS FETs do not need 10+ V to do anything. In fact, many can be killed with that kind of gate voltage. There are many which fully open at less than 2.5V, some...
If I understand your circuit correctly, you use the transistor to short the power for the radio module and hope that you can find a resistor value for R2 that is...

Re: SSP DMA problem in ARM lpc2388

Reply posted 5 years ago (01/25/2019)
I can only repeat my suggestion: try to make your SD work with the SSP using interrupts. Until that works, forget the DMA. You will need to understand the SSP in...

Re: SSP DMA problem in ARM lpc2388

Reply posted 5 years ago (01/25/2019)
The 23xx series chips use the ARM DMA macroblock, which is notoriously hard to set up properly. In addition, you need to set up the SSP correctly, which, by the...
If your MCU runs at 22MHz, then you can't generate an output faster than 11MHz. The 74HC595 at 4.5V has a maximum clock frequency of 25MHz, so there's no problem...

Re: Stack - interrupt, function call?

Reply posted 5 years ago (01/05/2019)
Before the IRQ hits, you have a stack that looks like this:SP-> local data of the called function saved registers return address (and possibly a frame...

Re: Stack - interrupt, function call?

Reply posted 5 years ago (01/04/2019)
"THERE IS ONLY ONE STACK"I beg to differ.Even on very old CPUs, like the m68k you mentioned, there were two stack pointers, the USP and the SSP (user and supervisor...

Re: SPI communication

Reply posted 6 years ago (06/13/2018)
"So -the first byte from the slave is trash."Not necessarily. Some slaves put a status byte into the data register at the falling edge of the slave select. That's...

Re: Cooperative scheduling

Reply posted 6 years ago (06/04/2018)
I believe (but not sure, never been a Windows person) early Windows versions were co-operative as well. I mean before W95, like 3.x and earlier. When I saw Win 1.0...

Re: Cooperative scheduling

Reply posted 6 years ago (06/03/2018)
Well, the Commodore Amiga had a pre-emptive kernel, but bad applications still ended in Guru Meditation, as there was no memory protection. You could not hog the...

Cooperative scheduling

New thread started 6 years ago
Recently there was a discussion about RTOS vs. bare-metal on this forum.I happen to work with embedded systems which are somewhere in the middle. They are not tiny,...

Use this form to contact Kocsonya

Before you can contact a member of the *Related Sites:

  • You must be logged in (register here)
  • You must confirm you email address