hybridfree/eevblog-posts huggingface dataset:
AVR 0 Series- CRC Issue and question - Page 1
Forum section: electronics / general

author: sanka1p
author_rank: Contributor
timestamp: December 05, 2023, 04:05:29 pm
content: Hi All,I am using Atmega1608 and IAR IDE.I have a boot.hex file and a App.hex file. I always update my App.hex file using the boot-loader. I want to make sure that the App.hex file has been updated correctly and has not been corrupted. To do this I want to use CRC checksum. My boot.hex file wont be changing, How can I check from the boot section that the App.hex file I just updated is correct? I can make CRC of App.hex and then just run a CRC check in the boot-loader before giving control to the App.hex. Is that a good idea? Am I missing something here? I did refer to AN2521 Application note from Microchip.

author: mikerj
author_rank: Super Contributor
timestamp: December 05, 2023, 05:33:59 pm
content: Typically you would embed the length and CRC of your application binary at fixed addresses so your bootloader can run a CRC check. It may be possible for the length to be calculated and inserted by the linker when you build your application, you will need to investigate the linker symbols available.I have never used IAR so I don't know if it includes any facility for calculating and including a CRC at the link stage, most tools do not. If not you can run a post build application (e.g. written in Python or similar) to calculate the length and/or CRC and insert it at the appropriate locations, which will will need to have been reserved to prevent any code or data being placed there.

author: cv007
author_rank: Frequent Contributor
timestamp: December 05, 2023, 07:34:26 pm
content: QuoteThat can be addressed via the bootloader and its controlling app on the pc- such as reading the flash after its programmed and compare it to what it should be. So if you want to only verify programming and do not need verification on each power up/reset, you could skip the boot crc checking (whether using hardware crcscan, or on your own).According to your posts elsewhere-https://www.avrfreaks.net/s/topic/a5CV400000000HlMAI/t393167?comment=P-2934502IAR can generate the crc for you, but you would have to come up with an initial value due to the bootloader code being included in the hardware crcscan. You could also do your own crc checking code in the bootloader where you only check the app code and could then use the iar generated value with a default initial value.Unless there is a real need for crc checking on each power up/reset, or even while running (pretty hard to otherwise detect corruption if your app remains powered on for long periods), I would stick to only verification at time of programming which is easily done by any bootloader/pc app combination (and most likely already done).

author: sanka1p
author_rank: Contributor
timestamp: December 05, 2023, 08:55:43 pm
content: QuoteI think thats a good idea. But my question is even if i find that the file I just uploaded was corrupt, how can I erase it just using an pc application?

author: cv007
author_rank: Frequent Contributor
timestamp: December 05, 2023, 10:37:50 pm
content: QuoteYou just try programming again.
Help! ATMega1280 memory/programming issue - Page 1
Forum section: electronics / general

author: Rjc987
author_rank: Contributor
timestamp: December 14, 2023, 06:31:49 pm
content: Hey guys! I’m pretty new to AVR/ATmega but I’m having an issue with an embedded system. It’s a Biotek Eon Spectrophotometer which is based around an atmega1280. The 1280 has an ISSI 128kx8 SRAM connected to all of ports A&C, and all of Port D from the 1280 is connected through to all of Port E on an ATMega1281 (the 1281 is handling motor control, with UI, Sensors, etc running on the 1280). I pulled the ROM through the 1281 JTAG header at the start of the project but along the way, somehow a big block of memory got corrupted. The checksum changed and the comparison between the old hex and the post corruption read has a huge chunk missing. I tried reprogramming from the hex with a Snap in ipe and ide on both windows and Mac but every time it comes up with error “ at 0x0, expected 0x00000099, got 0x000000ff, programming did not complete”. I searched around the AVR forums and read that this was almost certainly due to a failed block of flash memory on the micro.So I ordered a replacement 1280, soldered it to the board, tried to program it and no luck, still the same error. Could it actually be the 1281 that has the bad memory somehow, even though I’m programming through the 1280’s JTAG (both Jtags are separate btw, not daisy chained). Is the error and the missing block of memory caused by something else entirely? I’m so confused here and don’t know what to do. Any ideas?

author: Buriedcode
author_rank: Super Contributor
timestamp: December 15, 2023, 06:26:17 pm
content: I think we need a basic block diagram of how these things are connected. You said the JTAG lines are not daisy chained - but do they share any common lines line TCK? TMS?That sort of error isn't always helpful as it could be from poor clock, data connections (0xFF is the default value) or as you suggested, failed memory. The fact it failed at adress 0x0 indicates it cant' read any memory, so I'm going with a hardware problem - poor programming connections and/or shorts. Also, can you read the fuses? What are they set at?And when you said "tried reprogramming from the hex" what hex file was this? the original firmware? or the one you read from the original chip?I'm sure you've already debugged, but as a sanity check, do a continuity check on all the programming lines, and check for shorts to GND/VDD.Also, a "bigger picture" question: Why are you doing this? Did this unit fail? Are you reparing it? or modifying it?
Multi-port DMA uart library for all STM32 series (f1,f4,h7,etc.) and pic32mk. - Page 1
Forum section: electronics / general

author: Georgy.Moshkin
author_rank: Frequent Contributor
timestamp: September 28, 2023, 07:21:55 am
content: Download:stm32uart.zip- library with two usage examples (stm32cubeide ioc files with main.c for stm32f103c8t6).How-to (using stm32cubeide configurator window):1) Enable 3 uart ports2) Enable global interrupt for each port3) Enable TX and RX dma channels4) Set all RX dma channel modes to circular5) Generate code6) Add uart.h, uart.c to path, include uart.h7) Use COM_Init(handle,buffer,buffer_size,timeout) on each HAL port8) Use COM_Select(), COM_Read(), COM_Write()It is stripped down version of my UART library. Functions removed: CRC32, retry algorithm, PIC32 support, hexadecimal strings parsing, mem2mem, etc. I made this version for my tutorial in STM32. This version may have some bugs, but the method was tested on stm32f103,f407,f446,h750,h7b0. I tried to keep it simple, rs485 support not tested in this version. I'll post PIC32MK version later + add comments from tutorial.3-port usage example (don't forget to enable 3 uarts, their global interrupts and circular mode for RX dma channels):On STM32H7 you need to put uart buffer in DMA memory. Write functions can be modified to send data from non-DMA memory (copy to temporary buffer that can be accessed by dma).

author: Georgy.Moshkin
author_rank: Frequent Contributor
timestamp: December 02, 2023, 09:21:08 am
content: Added video tutorials:1. Step-by-step 5 port Uart DMA on STM32H7502. UART Library on stm32f030 and stm32g030Attached version with little fix for STM32F4. Latest version will be availablehere.

author: bingo600
author_rank: Super Contributor
timestamp: December 03, 2023, 09:39:04 am
content: Thanx for the effort.But I'll have to pass on the new uart lib for the F030.Registering everywhere just to dl. a library is too cubersome , even if it's free (ATM)Nice PDF guide/Bingo

author: Georgy.Moshkin
author_rank: Frequent Contributor
timestamp: December 08, 2023, 07:19:57 am
content: Quote from: bingo600 on December 03, 2023, 09:39:04 amDownloading these files does not require registration (if you came using link from my youtube channel)email-free login link:https://www.thundertronics.com/?sid=8b063142aba00592bb12c338675b3aa4downloadshttps://www.thundertronics.com/STM32_UART_Library/How%20To%20Use%20STM32%20UART.pdfhttps://www.thundertronics.com/STM32_UART_Library/loopback-win32-v1_0.ziphttps://www.thundertronics.com/STM32_UART_Library/stm32uart-v1_0.zip(with fixed define for stm32f4:here)
STM32 ADC Internal Calibration - how reliable is it? - Page 1
Forum section: electronics / general

author: unscripted
author_rank: Contributor
timestamp: April 08, 2022, 05:38:49 pm
content: The STM32L4 ADC includes a calibration step, with HAL it is performed with function HAL_ADCEx_Calibration_Start. When I skip this step I get better accuracy than when including it.. Why could this be?

author: AndyC_772
author_rank: Super Contributor
timestamp: April 08, 2022, 07:27:09 pm
content: IIRC in some devices there's a required time delay between enabling the voltage regulator which powers the ADC, and the ADC actually working correctly. If your code doesn't include a pause, it can end up running the calibration before the power supply to the ADC is stable.This is, not surprisingly, worse than not calibrating at all.

author: unscripted
author_rank: Contributor
timestamp: April 11, 2022, 11:30:30 am
content: Quote from: AndyC_772 on April 08, 2022, 07:27:09 pmI took that time delay into consideration. My micro has an external +VREF pin so I'm using a precise voltage reference. I wonder if even using this external ref I still need to perform the micro internal self-calibration.

author: uer166
author_rank: Super Contributor
timestamp: April 11, 2022, 10:53:56 pm
content: I used HAL for the self-cal routines and always found the results to be better after the calibration, than before. The ADCs aren't terrible, but not great either, so a little extra performance is welcome with the cal. I have no idea what it actually does internally, but it seems to work..

author: raw1
author_rank: Newbie
timestamp: December 01, 2023, 06:44:12 pm
content: Dear Unscripted,I am running into the same issue now on a STM32L471RGT6. did you ever resolve your issue and if so can you share any details?Thanks a lotRAW1

author: wek
author_rank: Frequent Contributor
timestamp: December 01, 2023, 07:33:29 pm
content: If ADC conversions are better without calibration than with calibration, then you either did something incorrectly during calibration, or, more probably, do something incorrectly during the conversions.VREF+ instability is one of the candidates, as said previously; too short sampling times are one of the other possibilities.JW
Automatic Reflashing of the ARM Cortex-M7 Co-processor on i.MX 8M Plus Upon Dete - Page 1
Forum section: electronics / general

author: teleportboy
author_rank: Newbie
timestamp: December 01, 2023, 10:37:53 am
content: Hello everyone,I'm working on a project using thei.MX 8M Plus, which, like theam335x, comes with an integrated co-processor - in this case, theARM Cortex-M7. Although I don't have direct experience with this setup, I am aware that for theam335x, it's possible to automatically reflash thePRU-ICSSco-processor through a Linux system running on the main processor. This system(special driver) monitors a specific directory for new firmware files.My goal is to set up a similar monitoring and automatic reflashing system for theARM Cortex-M7co-processor on thei.MX 8M Plus platform. I am interested in configuring the Linux system so that it automatically detects new or modified firmware in a certain directory and starts the reflashing process for the co-processor. In the case of theam335x, this was done by a special driver, and there was no need to write anything myself.
PHYTEC UBIFS getting ROOT through updates. - Page 1
Forum section: electronics / general

author: Icherkayev
author_rank: Newbie
timestamp: November 29, 2023, 11:49:38 am
content: There is a coffee machine that runs on busybox FS UBIFS OS. Close all ports. The coffee machine can be updated. The update file contains the ubifs imagehttps://drive.google.com/file/d/1p-_zGbGVT4ee5rYpBCRbRboX7SuqKhbW/view?usp=drive_link. If you make changes to the image, replace the password hash and open port 22, I think access will be open, and you can install additional applications for work (VNC, etc.).Who knows and has already worked with this, if it’s not difficult, you can get any advice)))Thank You!
[SOLVED] COMPONENT TESTER WITH LGT8F328P? - Page 1
Forum section: electronics / general

author: DELTA67
author_rank: Regular Contributor
timestamp: November 28, 2023, 09:05:27 am
content: Hi all,The Component Tester of Markus Frejek (maintained by Karl-Heinz Kübbeler and Markus Reschke) is a great project.https://www.mikrocontroller.net/articles/AVR_TransistortesterHow about using an LGT8F328P instead of the ATMEGA328P?Can the 12bit resolution of the ADC in the LGT improve accuracy?Is the differential mode, of the said ADC, of any useful application in measurements?How about the pseudo math coprocessor uDSC, Can it speed some calculations?

author: coromonadalix
author_rank: Super Contributor
timestamp: November 28, 2023, 09:10:33 am
content: you have an huge thread about theses here 20$ lcr tester you should have posted there

author: DELTA67
author_rank: Regular Contributor
timestamp: November 28, 2023, 09:29:27 am
content: Ok, thanks.I'll post these questions on the official thread.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: November 29, 2023, 11:35:11 am
content: This is the thread:https://www.eevblog.com/forum/testgear/$20-lcr-esr-transistor-checker-project/It started on 2023-02-23, has 360 pages and still counting...
Need help disassembling this binary - Page 1
Forum section: electronics / general

author: VooDust
author_rank: Regular Contributor
timestamp: November 27, 2023, 07:58:32 pm
content: I am analyzing the firmware for my heat pump.The main controller software binary is a standard ELF file, I was able to successfully load it into IDA Disassembler as ARM little-endian (thumb), patch some constant to change the heat pump's behavior, and retrieve the master password which was hardcoded into the binary. The firmware for the controller runs on a MCU that I could identify as ATSAMD21G18.However, there is another file from the complete firmware package, and that is simply a generic .LIN file. I believe this file to contain code that runs on another controller board that communicates with the main controller software. However I was not yet able to identify what MCU it runs on.Here is the .LIN file, I was hoping some expert here could jumpstart a noob like me and tell me what kind of binary / CPU architecture that is. I can only see garbage trying to disassemble it as ARM bytecode.

author: bingo600
author_rank: Super Contributor
timestamp: November 27, 2023, 08:48:40 pm
content: If looking at the "Strings in the binary"They seem to match here (google search)Ie:FreeRun forbidden in sleep mode(Line 880)https://android.googlesource.com/platform/external/arduino-ide/+/refs/heads/master/hardware/arduino/sam/system/libsam/source/adc.cThat might indicate it's for anothersam processor/Bingo

author: abyrvalg
author_rank: Frequent Contributor
timestamp: November 27, 2023, 08:56:14 pm
content: The .LIN file is for Cortex-M MCU too, it is a raw binary with load address 0x401800.A quick look shows ADC address 0x40038000, UART address 0x40024000 - this arrangement matches ATSAM4S.

author: VooDust
author_rank: Regular Contributor
timestamp: November 28, 2023, 10:30:54 am
content: Thank you, I'll try to disassemble it again.

author: AVI-crak
author_rank: Regular Contributor
timestamp: November 28, 2023, 02:19:20 pm
content: Ghidra can break any arm code. It's my favorite tool.

author: coppice
author_rank: Super Contributor
timestamp: November 28, 2023, 02:22:43 pm
content: Quote from: AVI-crak on November 28, 2023, 02:19:20 pmGhidra is the best tool I know for pulling apart any binary for an instruction set it supports. It will frequently get you to moderately readable C source code.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: November 28, 2023, 03:28:39 pm
content: arm-none-objdump can break any ARM code too

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 28, 2023, 11:12:25 pm
content: Ghidra + svd viewer plugin.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: November 29, 2023, 02:37:41 am
content: IMO, no point switching to Ghidra from IDA (OP have mentioned some prior success with it).
MPLAB SNAP to Atmega1280&81 Connection? - Page 1
Forum section: electronics / general

author: Rjc987
author_rank: Contributor
timestamp: November 26, 2023, 07:32:50 pm
content: Hey guys, complete newbie with AVR and the snap (used to PIC & Pickit3 so trying to recalibrate my brain…) - the snap user guide is pretty slim and some of the information seems contradictory. Just trying to interface a system I’m working on with mplab x ide and dump the rom etc. My target board has JTAG and ISP headers, jtag is standard atmega pinout, and the ISP is apparently using the AVR ICE pinout standard with rx tx scl sda and icp1 (see diagrams below). The snap guide connection table (included below) says the pinout for the snap is mclr, vdd, ground, PGD, PGC, then “do not connect” for pin 6, and “unused for icsp” for pins 7&8, but the table that translates between different protocols and chip families, under ACR JTAG, shows pins 2-8 all used, with reset on pin 6 vs mclr on pin 1, and I don’t see anything that equates to the ISP header I have on the board, although data stream cdc on the next page shows 7&8 as rx and tx. I also read elsewhere that reset is supposed to be disconnected for debugging but that’s contradictory to the diagram. So for jtag do I follow the table and connect everything, or everything BUT pin 6, or everything up to pin 5 or pin 6? And what do I connect for the ICE version of the ISP connector? Very confused.Also does anyone have any idea what the solder thru holes marked rx tx sdi sck etc are for? Are they able to be used as inputs instead of the header or?Thanks!

author: ataradov
author_rank: Super Contributor
timestamp: November 26, 2023, 09:21:06 pm
content: Connect as described in the table. The text next to the drawing if for MIPS devices.The pins on the SNAP itself are not useful for anything, they are just for debugging of the SNAP itself.
ESP32 Power with 18650 - Page 1
Forum section: electronics / general

author: ats3788
author_rank: Contributor
timestamp: November 25, 2023, 09:05:11 am
content: ESP32 Power with 18650I know it's a common question, I know the best, to use a LiPo Batteries but is in almost 2024, I look for a converter to powera ESP32.
STM32: STM32F411CEU6 Device not showing up on laptop as COMS PORT - Page 1
Forum section: electronics / general

author: TheTechguy
author_rank: Newbie
timestamp: November 21, 2023, 02:33:52 am
content: My goal is to print "hello world" on console. When ST-link v2 is connected to the microcontroller i get the blinking led and there are no errors. However when I'm trying to print "hello world" on tera term connecting to only the microcontroller is not detected as a COM port or as a USB. But I still see the blinking led on microcontroller although it doesnt show up on my laptop. I am following this article to print "hello world"https://www.bennettnotes.com/notes/stm32-blackpill-with-stmcubeide-usb-serial/. I am stuck on this for about 3 days with no answers.

author: darkspr1te
author_rank: Frequent Contributor
timestamp: November 21, 2023, 05:53:40 am
content: This is dev board dependent but if you have one with a built in stm v2 debugger then it is most likely using the stlink timing crystal to provide it's OSC input and when you power the cpu only board then it wont receive this signal, to get around that you have to populate the crystal on the dev board and cut the trace going to the stlink v2darkspr1te

author: wek
author_rank: Frequent Contributor
timestamp: November 21, 2023, 08:41:10 am
content: DFU bootloader works (withthis caveat)?If not, problem is in hardware (cable, connectors, crystal, hubs, host/PC). If yes, problem is in your program;debug itas usually.JW

author: Georgy.Moshkin
author_rank: Frequent Contributor
timestamp: November 25, 2023, 02:35:34 pm
content: Have you tried to reconnect usb cable after flashing the board? To avoid plugging/unplugging, I use gpio configuration similar to this topic:https://community.st.com/t5/stm32-mcus-embedded-software/how-does-usb-reconnect-with-the-pc-without-pull-usb-line/td-p/407423to develop CDC firmware, so no need to unplug usb each time after flashing process.
esp32 and Mac - Page 1
Forum section: electronics / general

author: artag
author_rank: Super Contributor
timestamp: November 24, 2023, 01:46:42 pm
content: I have some ESP32 programmers based on CH340. They work fine from Linux and Windows but not from MacOS (on an M1 laptop). Serial communication is there but it won't connect for program download from the Arduino ISP.I know the ESP32 uses a higher speed connection for download and early Linux CH340 drivers couldn't select it. A later driver fixed the problem. Is there a similar situation for MacOS ? If someone is successfully programming them I'd appreciate a link to a suitable driver or anything else they have found helpful.

author: kripton2035
author_rank: Super Contributor
timestamp: November 24, 2023, 03:12:09 pm
content: https://github.com/FYSETC/CH340-Driver/tree/masterhttps://www.wch-ic.com/downloads/CH341SER_MAC_ZIP.htmlhttps://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all#mac-osxalso don't forget to allow the extension on the newer macoshttps://forum.arduino.cc/t/ch340g-driver-download-on-mac-ventura/1052927
Help! ATMEGA1280&1281 Weird JTAG & ISP Header Pinouts - Page 1
Forum section: electronics / general

author: Rjc987
author_rank: Contributor
timestamp: November 23, 2023, 05:21:00 pm
content: Hi guys, hopefully somebody can help me with us-I’m used to PICs, and that Mel is totally new to me, so this is even more confusing. I am working on a bioteck eon Spectrophotometer that’s giving really weird errors and I was hoping to have a look under the hood to get a feel for what’s going on. The main board and sensor board both use ATmega, the main board 1280 and 1281, and the sensor board 164p. Both have a number of connectors labeled JTAG for each system (motor control, UI control, Sensors), and additionally, the main board has a header labeled ISP. Great, right? Well, not so fast because they all have really bizarre pin outs. The JTAG connectors at least have the correct connections even though they’re in odd places, But the ISP connector only has SDA, SCL, RX, TX, ICP1(??), VCC, and ground. So it’s actually I2C and UART with an extra ICP1? I’ve included a picture of the connectors on the board and my terrible sketch of the different pin outs. I was trying to use a USBASP But obviously that’s not going to work, so I ordered an AVR dragon, but have any of you seen this? Is this normal? And what should I do about connections?Thanks!

author: fchk
author_rank: Frequent Contributor
timestamp: November 23, 2023, 06:25:18 pm
content: Atmel ICE uses these connections. These connectors are the current standard for ARM Cortex A/M/R as mandated by ARM, and ATmel has used them for both the ARM as well as the Atmel connector on the Atmel ICE.https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-ICE_UserGuide.pdf

author: Rjc987
author_rank: Contributor
timestamp: November 23, 2023, 07:32:11 pm
content: Ahhh! Thanks! So is the Mplab snap compatible with that pinout? I really can’t justify spending $200 for the ICE just for this one project

author: bingo600
author_rank: Super Contributor
timestamp: November 24, 2023, 05:30:16 am
content: Maybe you can fix the snaphttps://swharden.com/blog/2022-12-09-avr-programming/http://ww1.microchip.com/downloads/en/DeviceDoc/ETN36_MPLAB%20Snap%20AVR%20Interface%20Modification.pdfSnap UGhttps://ww1.microchip.com/downloads/en/DeviceDoc/50002787C.pdf/Bingo
How to flash co-processor on UCM-iMX8M-Plus? - Page 1
Forum section: electronics / general

author: teleportboy
author_rank: Newbie
timestamp: December 05, 2023, 11:00:51 am
content: I'm looking for instructions on how to flash the Cortex-M7 co-processor on the UCM-iMX8M-Plus. While I've found manuals for Cortex-M4, I'm not sure if the process is the same for M7. Does anyone have experience with this or can point me to the right documentation for the UCM-iMX8M-Plus Cortex-M7 ?
Integrating QtCreator with MCUXpresso IDE Build Tools for ARM Cortex M0 (LPC82x) - Page 1
Forum section: electronics / general

author: teleportboy
author_rank: Newbie
timestamp: November 15, 2023, 02:02:34 pm
content: Hello everyone,I'm working on a project involving theARM Cortex M0series, particularly theLPC82x, and I'm facing a technical challenge. I'd like to useQtCreatoras my primary IDE but need to integrate it with theMCUXpresso IDE'sbuild tools.Main Objective: To write code inQtCreatorand have the compilation and linking handled by theMCUXpresso IDE, specifically for theARM Cortex M0 (LPC82x)series.Key Questions:1.Integration Steps: Has anyone successfully set upQtCreatorto use theMCUXpresso IDE'sbuild tools forARM Cortex M0development? If so, how?2.Configuration Details: What specific settings or configurations are needed within bothQtCreatorandMCUXpresso IDEto achieve this integration?3.Potential Issues: Are there known compatibility issues or challenges when using these tools together forLPC82xdevelopment?Thank you in advance for your time and help!

author: Doctorandus_P
author_rank: Super Contributor
timestamp: November 15, 2023, 02:56:25 pm
content: I have used QT creator with external makefiles for a while to write firmware for AVR controllers. I quite liked the IDE, but the company who makes QT is not very friendly to open source so I ditched the IDE again after a while.
Using Beaglebone cape with RPi - Page 1
Forum section: electronics / general

author: EEEnthusiast
author_rank: Frequent Contributor
timestamp: November 15, 2023, 07:43:10 am
content: FolksI have an existing Beaglebone cape and not enough beaglebone black boards with me. But I have plenty of RPi cards lying around. I need to use the BBB cape with the RPi board.Is there some adapter board readily available to buy, which can help be bridge this problem?That adapter card will sit over the Rpi and provide me with the P8 and P9 connectors of the Beagle Bone Black. RPi will be my host now.regards
Espressif ESP32-S3 volume pricing question - Page 1
Forum section: electronics / general

author: nctnico
author_rank: Super Contributor
timestamp: November 14, 2023, 06:24:32 pm
content: I'm wondering what other people's experiences are with buying ESP32-S3 in volume (10k to 100k units range). From the distributors I see that the pricing for single units is equal to 100k units which strikes me as odd. There has to be better pricing or is this a deliberate strategy from Espressif? Has anyone managed to get better pricing from other places? Maybe getting a quotation from Espressif directly?

author: Smokey
author_rank: Super Contributor
timestamp: November 14, 2023, 07:45:43 pm
content: I've wondered the same thing. There are no price breaks listed.

author: peter-h
author_rank: Super Contributor
timestamp: November 14, 2023, 09:46:10 pm
content: A colleague working for a fairly sizeable company designed some products during covid to use the ESP32 and as a result they were able to deliver some nice orders.It strikes me that Espressif may now be in a position to exploit this
STM32 HAL getstate usage - Page 1
Forum section: electronics / general

author: Veketti
author_rank: Regular Contributor
timestamp: November 12, 2023, 06:18:49 pm
content: Hi,I can't find any information on what is the correct way of using "HAL_TIM_Base_GetState()". It doesn't return boolen nor HAL_TIM_STATE_READY. What might be the correct way?What I'm trying to achieve is, I have timer in interrupt mode which I start and stop in code by "HAL_TIM_Base_Start_IT" or "HAL_TIM_Base_Stop_IT", but I'd need to check whether it is running or stopped first. I could of course set boolean whenever I start it or stop it, but there must be a better way to check this?Thank you in advance.

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 12, 2023, 11:40:13 pm
content: It returns htim->state.State is HAL_TIM_StateTypeDef type:Code:enumHAL_TIM_StateTypeDef {HAL_TIM_STATE_RESET = 0x00U, HAL_TIM_STATE_READY = 0x01U, HAL_TIM_STATE_BUSY = 0x02U, HAL_TIM_STATE_TIMEOUT = 0x03U,HAL_TIM_STATE_ERROR = 0x04U}It's meant for internal use.By default, it's in reset state.When you init the peripheral, it becomes ready.Most HAL functions check this, for example some will instantly return error if state is not ready.Same as if, for example, you start a DMA transfer, the timer handle will be busy until DMA finishes, attempts to use the timer will probably return busy.When the DMA is over, the handle will be unlocked back to ready.This is not 100% accurate, it's been some time since I last used HAL.Navigate the library and see wherehtim->stateis used.

author: Veketti
author_rank: Regular Contributor
timestamp: November 13, 2023, 07:52:38 pm
content: Ok, I don't know what did I do wrong as the HAL_TIM_STATE_READY was not recognized. Here's the correct format:Code:if (HAL_TIM_Base_GetState(&htim6) == HAL_TIM_STATE_BUSY )When timer is in not running:HAL_TIM_STATE_READYWhen timer is running:HAL_TIM_STATE_BUSYJust out of curiosity, I see many doesn't use HAL libraries for some reason, makes me wonder what else do you use if not HAL and why?

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 13, 2023, 08:00:21 pm
content: HAL eats a lot of memory.If you want to run a timer, you can get it in a few lines in "Low level" code.HAL will use ram for the peripheral handlers, do lots of checks required for every possible use...It's OK for starting, also for very fast development, while at low level will need lots of RTFM, debugging, bug fixing...But the result will way a lot smaller and faster.For complicated devices like F4/H7 series, well, it's a good option.A much simpler STM32G0 is a lot easier. I use ST LL libraries for them, providing very compact code.

author: Veketti
author_rank: Regular Contributor
timestamp: November 14, 2023, 06:42:53 pm
content: Oh, it's HAL that's occupying the memory. I was wondering that even though just few lines of code and flash is already 40% full. So for the low end STM32 it is almost a must to not use HAL or otherwise you'll run out of memory very quickly. Well, got also bunch of G070 with 128k memory if ever I'll get in trouble with this G050's 32k memory..
STM32F107 and "dedicated 4k RAM for ETH DMA"? - Page 1
Forum section: electronics / general

author: peter-h
author_rank: Super Contributor
timestamp: November 13, 2023, 04:36:08 pm
content: The description states "10/100 Ethernet MAC with dedicated DMA and SRAM (4Kbytes)".It is curious since the 32F417 doesn't appear to have any "4k RAM" for ETH; the ETH buffers go into main RAM.The 32F107 DS is dated 2017 which probably makes it more recent than the 32F417.I looked at the 107 out of curiosity because it comes up below

author: peter-h
author_rank: Super Contributor
timestamp: November 13, 2023, 06:26:27 pm
content: That's the same as the 32F4 (RM0090) diagram (Fig 350).

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 13, 2023, 07:11:52 pm
content: And there you have your 4KB dedicated RAM, it's the fifo buffers!The DMA will transfer those buffers anywhere into conventional ram.

author: peter-h
author_rank: Super Contributor
timestamp: November 14, 2023, 11:13:06 am
content: OK; FIFO for 1 x MTU. A bit of a con to call it RAM
Help getting around this error Please! - Page 1
Forum section: electronics / general

author: kgavionics
author_rank: Regular Contributor
timestamp: November 12, 2023, 02:19:46 am
content: Hello guysI'm trying to use this library in my project, but I got stuck how to implement the function _putchar (see error screenshot below)https://github.com/mpaland/printfCan someone tell me how to make this library work, please!Thanks in advance!

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 12, 2023, 02:27:34 am
content: If you're not actually using printf(), but string variants of it (like snprintf()), you can just write a stub _putchar() - place it anywhere convenient in a source file - like so:Code:int _putchar(char c){return 1;}Later on, if you also want to use printf() directly and redirect output to anything (UART, your LCD, whatever), you can just fill this stub function with the code that sends one char to the corresponding peripheral. But if you don't even use printf() directly, no need to bother.Btw, you should enable C99 support to get rid of the warnings - "useless" warnings are a pollution and will tend to make you ignore more important ones. I don't know your IDE so can't guide further to set this option, but just look at the compilation options and something like that should be there.

author: kgavionics
author_rank: Regular Contributor
timestamp: November 12, 2023, 01:22:46 pm
content: Merci Beaucoup SiliconWizard it's all sorted out now!
JDY-40 wireless serial port module soft reset? - Page 1
Forum section: electronics / general

author: jesuscf
author_rank: Frequent Contributor
timestamp: November 11, 2023, 11:11:51 pm
content: Hi everybody,Is there an undocumented 'AT' command that would soft reset the JDY-40 wireless serial port module? So far, these are the commands that seem to work:Command: AT+VERResponse: +JDY-40-V2.2Command: AT+BAUDResponse: +BAUD=4Command: AT+RFIDResponse: +RFID=8899Command: AT+DVIDResponse: +DVID=1122Command: AT+RFCResponse: +RFC=001Command: AT+POWEResponse: +POWE=9Command: AT+CLSSResponse: +CLSS=A0I am asking because any changes in the configuration of the module are only reflected after it is power cycled. I've tried 'AT+RST' but it doesn't do anything.
Further issues with UART comms across Maxim SerDes GMSL Link MAX96705 MAX96706 - Page 1
Forum section: electronics / general

author: tbw2
author_rank: Contributor
timestamp: November 15, 2023, 03:40:27 pm
content: Further to this post:https://www.eevblog.com/forum/microcontrollers/pic16-uart-to-analog-devices-max96706-gmsl-chip-(serdes)-comms-issues/Working:Comms between the PIC and MAX96706 (Deserializer), I am able to read & write to the registers OK.Link between both sides, parallel data from a row of switches is being sent from the MAX96705 (Serializer) across the coax into the Des chip, decoded, and displayed on LEDs.GPI/GPO pin is able to send the pin state of GPI (Des side) to the GPO (Ser side).Not working:No ACK is being received by the PIC when addressing the Serializer via UART. example message 0x79, 0x81, 0x04, 0x01....... no replyInvestigated:Confirmed High Immunity mode is set Low on both ends.Cable length is 1mtr coax, signal integrity is expected to be ok.MS/HVEN mode is confirmed to be Base mode for both sides. This is checked by toggling MS at Des side, and nothing appears on TX/RS pins at Ser side.LCCEN is pulled high, setting Ser side TX/RX pins to UART output.Des register 0xCB says Control channel is NOT LOCKED. Unsure why. (reads 0x7B)Am I badly mistaken, and comms is actually NOT possible between Des and Ser sides whilst the link is active?Deserializer datasheet:https://www.analog.com/media/en/technical-documentation/data-sheets/MAX96706.pdfSerializer datasheet:https://www.analog.com/media/en/technical-documentation/data-sheets/MAX96705.pdfThank you for reading.

author: tbw2
author_rank: Contributor
timestamp: November 17, 2023, 10:37:45 am
content: I had mistakenly set the CONF0 and CONF1 jumpers on the Serializer side incorrectly.To make the UART Control-Channel work, I2CSEL needs to be set to 0, which can be achieved by:CONF1=LOW, CONF0=MIDWhich works for my setup which is using CXTP=1 for Coax Output
disassembler for 87C52 - Page 1
Forum section: electronics / general

author: strawberry
author_rank: Super Contributor
timestamp: November 08, 2023, 07:13:33 am
content: How to disassemble hex to asm?is 87C52 compatible with 89S52/89C52

author: Maksims
author_rank: Newbie
timestamp: November 08, 2023, 09:00:03 am
content: Hi.I am not familiar with disassembly, but i think, you should look for something like "MCS-51 disassembler" in google. More likely it will be some DOS-based software.But regarding compatibility between 87C52 and 89S52/89C52. The should be compatible. If I am right, the main difference is the following:87C52 has UV erasable (ceramic package with window) or one time programmable (OTP) memory. Programmed through parallel interface, so special programmer is needed. If memory is UV erasable, it still has very limited amount of write/erase cycles. This is a classic variant, made by Intel.89C52 has FLASH memory with much more write/erase cycles. Also is programmed through parallel interface and requires special programmer. Basically, the same classic variant, but from another manufacturer and with another type of memory.89S52 is similar to 89C52, but has serial interface for programming. In this case much less connections are needed for programming and you can use SPI interface to do this.But, if the program is located in external memory, then, I think, there is no difference at all.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: November 08, 2023, 09:18:08 am
content: https://www.eevblog.com/forum/microcontrollers/8051-disassembler/msg3360002/#msg3360002

author: HwAoRrDk
author_rank: Super Contributor
timestamp: November 08, 2023, 12:53:29 pm
content: Try the Naken assembler/disassembler:https://www.mikekohn.net/micro/naken_asm.phpIt supports MCS-51 and a ton of other architectures.
Request for someone with Microchip Studio installed - Page 1
Forum section: electronics / general

author: rs20
author_rank: Super Contributor
timestamp: November 08, 2023, 04:29:23 am
content: Could someone with a recent version of Microchip Studio installed please send/attach the following files? (Or point me to a publicly accessible place to find them that isn't bundled inside an installer EXE):??/device-specs/specs-attiny824??/avr/io.h??/avr/iotn824.h (I'm guessing this is the right filename, but maybe double-check what avr/io.h pulls in for an ATTiny824)Context:I don't have Windows, and have some code written in Microchip studio for the attiny824. Even though the Microchip Studio project is using gcc rather than xc8; mainline avr-gcc and avr-libc do not have support for the somewhat recently released attiny824 (which is totally different, afaict, to the much much older attiny828 BTW, trying to compile against attiny828 fails badly). It would appear that the avr-gcc and avr-libc bundled within Microchip studio have this support somehow though. I hope the three files mentioned above are the only missing parts.PS. The Wine DB says that installing Microchip Studio with Wine is "garbage"

author: ataradov
author_rank: Super Contributor
timestamp: November 08, 2023, 05:14:05 am
content: Those things are a part of the device pack. You can download all Microchip device packs herehttps://packs.download.microchip.com/The one you want is thishttps://packs.download.microchip.com/Microchip.ATtiny_DFP.3.1.260.atpackatpack is just a zip archive.

author: rs20
author_rank: Super Contributor
timestamp: November 08, 2023, 06:55:17 am
content: I needed to sneak this in to the source code, but apart from that it's compiled and working:#ifndef ADC_TIMEBASE0_bp#define ADC_TIMEBASE0_bp ADC_TIMEBASE_0_bp#endifYou're the best, thanks so much!
Help with digital audio processing project (ALC5616 Codec + STM32F4)  - Page 1
Forum section: electronics / general

author: giovanicauzzi
author_rank: Newbie
timestamp: November 05, 2023, 03:35:43 pm
content: Hello guys,I'm developing a board to process digital audio (see block diagram attached). The board has a STM32F405 and a Realtek ALC5616 audio Codec.Between both ICs, there is a I2C interface for Codec registers configuration and a I2S interface of full-duplex audio data transfering.The I2S is configured as described bellow:- Sampling Frequency: 48kHz- 16bits stereo data- STM32 as master, generating MCLK 12.5MHz (48.828kHz * 256)The problem that I have is that the Codec always return the same audio data via I2S, 9353 for one channel and 28061 for the other.(See the logic analyzer print screen attached)Even if I ground the input, this values doesn't change.I review the audio path inside the Codec several times, making sure that both single ended inputs are reaching the internal ADC.I want to know if some of you already developed something with an audio Codec and could share some common issues or probable causes for this kind of problem.I also attached the circuit schematic for the Codec.
PLL frequency and jitter in TI AM62x processors - Page 1
Forum section: electronics / general

author: hanakp
author_rank: Regular Contributor
timestamp: November 10, 2023, 04:04:19 pm
content: Hi everyone, TI forums are for corporate users only now, so I'm hoping to find the answer here...I wish to generate 38 MHz clock from internal PLL1 or PLL2 in TI Sitara AM62x processors. The reference manual says the VCO frequency must be higher than 1500 MHz and "For best PLL performance, maximize VCO frequency where possible." But what is the maximum reasonable frequency? I used TI AM6X Clock Tree (1.0.1) web-based design tool (part of TI SysConfig) to calculate the necessary PLL config values. But it allows me to set the VCO frequency as high as 80024 MHz, or over 80 GHz, see the screenshot below. That doesn't feel right, isn't that a bug?Also, what clock jitter I can roughly expect from these PLLs? TI doesn't specify it, or at least I couldn't find it anywhere.Thanks.
STM32F401-MEASURE VBAT WITH ADC - Page 1
Forum section: electronics / general

author: kgavionics
author_rank: Regular Contributor
timestamp: November 01, 2023, 11:28:22 pm
content: HelloI have a black pill board (stm32f401) which is a battery powered using 2 AA batteries. I want to monitor the battery voltage through the ADC.Something I noticed before I hook up the VB pin to the VDD (battery pack), is the potential is around .85V, which I don't know why! Anyway, after I connect VB to VDD and flash the MCU with the following code, I'm always getting around 0 in the ADC→DR register.Code:#include <stm32f401xc.h>#include "adc.h"volatile uint16_t adc_value;void adc_init(void){//enable VbatADC->CCR |=ADC_CCR_VBATE;//enable VBat//configure ADC FREQ (MAX 36MHZ FOR 401)devide 84Mhz/4= 21MhzADC->CCR |=(1U<<16);//Enable ADC1RCC->APB2ENR |=RCC_APB2ENR_ADC1EN;//DISBALE ADC1ADC1->CR2 &= ~(ADC_CR2_ADON);//SELECT ADC CHANNEL 18 (vbat)ADC1->SQR3 |=1U<<4 | 1U<<1;//sq1 conversion #18 in sqr3//ENABLE ADC1ADC1->CR2 |=ADC_CR2_ADON;}void adc_read(void){//START ADC CONVERSIONADC1->CR2 |=ADC_CR2_SWSTART;while(!(ADC1->SR & ADC_SR_EOC));adc_value=ADC1->DR;}main functionCode:int main(void){SysClockConfig();Delay_init();adc_init();while(1){adc_read();Delay_ms(1);}}Can someone tell me why I'm getting zero in the data register, knowing that my code is working fine if I measure the voltage hooked to any ADC external channel!Thank you in advance!

author: wek
author_rank: Frequent Contributor
timestamp: November 02, 2023, 08:30:11 am
content: You need to enable ADC clock in RCC *before* writing to any ADC register.JW

author: kgavionics
author_rank: Regular Contributor
timestamp: November 02, 2023, 12:26:55 pm
content: Thank you for the heads-up Wek, now everything is working fine!
Pmod BLE Module with MCU - Page 1
Forum section: electronics / general

author: Razvan1203
author_rank: Newbie
timestamp: November 03, 2023, 11:32:20 am
content: Hello everyone! Does the Pmod BLE Module from Digilent work with Arduino/MSP430 or any other MCU? If I need a bluetooth project involving an FPGA project on the one hand and a MCU on the other hand, is it possible to use two Pmod BLE Modules ?Thanks in advance.
JieLi SOCs - ultra low cost Bluetooh/USB soc available at LCSC - Page 1
Forum section: electronics / general

author: tim_
author_rank: Regular Contributor
timestamp: November 02, 2023, 12:30:31 pm
content: Hi,I just noticed that LCSC is listing some products of JieLi now, e.g. Jieli basically owns the low-end bluetooth audio device market. All these low cost earbuds are powered by their devices.https://www.lcsc.com/product-detail/Microcontroller-Units-MCUs-MPUs-SOCs_JieLi-Tech-AD142A4_C7434398.htmlhttps://www.lcsc.com/product-detail/Microcontroller-Units-MCUs-MPUs-SOCs_JieLi-Tech-AC6329C4_C5440081.htmlThey come in low pin count package at very low prices (eg. $0.3x in single quantity). They may look like yesterdays 8 bitters, but pack quite a punch: Bluetooth, USB, audio functions, 32bit core, integrated flash.- They never mention details about their CPU core. I have seen references to RISC-V, but then you need a proprietary toolchain of theirs.- They have a github where they share some SDKs:https://github.com/Jieli-Tech- I also found deceloper boards on taobao, but it seems that LSCS is not listing those.Has anybody looked into these devices? They look very powerful and extremely affordable.
stm32G474re adc overclocking up to 168 (!) MHz. - Page 1
Forum section: electronics / general

author: MasterT
author_rank: Frequent Contributor
timestamp: November 09, 2023, 07:34:40 pm
content: I do some performance evaluation of the adc, board is nucleo-G474re from ST. My intention mostly for high freq. application, when adc is running in undersampling mode with 20 MHz at the inputs (max so far I could get with Rigol).Changing adc clock from 40 MHz, up to 56 MHz I 've made one mistake, configuring async_1 driven by PLL_P I missed to change P divider to 6, and default was 2. I couldn't believe, but SA application shows correct shift in freq. x3, sampling rate jumps to 11.2 msps w/o any noticeable difference in SNR !!!.To be safe, I verified current consumption by nucleo+TFT+driver module and seen 3 mA only increase, from 217 mA to 220 mAHere is some pictures, two taken with 42 MHz clock /15 = 2.8 msps and two with 168 / 15 = 11.2 msps
AVR- start address for flash in IAR - Page 1
Forum section: electronics / general

author: sanka1p
author_rank: Contributor
timestamp: November 01, 2023, 06:27:47 pm
content: Hi All,I have an Atmega1608 and using IAR for AVR as an IDE to flashy a simple LED blinky firmware. I want to start the address of my blinky firmware from 0x100. How can I do that in IAR? I know in Microchip studio, I can do that by going into "Project Properties (Alt+F7) → Toolchain → AVR/GNU Linker → Memory Settings, by adding .text=0x100 to the FLASH segment". Please someone let me know how can I do the same in IAR.
Generic Development Platform - Page 1
Forum section: electronics / general

author: tridac
author_rank: Regular Contributor
timestamp: November 01, 2023, 05:49:10 pm
content: Have had the need for an all in the box development platform for a while. Have used alix / pc engine type boxes in the past running openocd, which provides network based debugging with gdb. Found a tiny pc at a car boot (was an audio server) a while back. A 386 running Vile Linux at the time, but looked ideal for openocd use. Put Debain 7 386 on it, copied all the openocd files to it, all ok. Untidy, so put it into a salvaged case from elsewhere, added a J-Link debugger and cheap (< $10) Cortex board, which has a serial port as well. Openocd is a real boon in terms of debug from anywhere. Remote host is a makefile, gcc, gdb setup, Debug via command line gdb. A gui gdb i/f may follow, but a keep it simple setup is fine. This should serve well for a variety of whatif projects that are a mix of hardware and software. Here's the box:

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 01, 2023, 09:30:54 pm
content: Yeah, why not. You would get much better performance at lower power consumption and much less volume using a RPi or any of its cheaper variants. A $10 SBC will still be eons faster than a 386-based board.But why not, not trying to deter you.

author: tridac
author_rank: Regular Contributor
timestamp: November 01, 2023, 10:28:57 pm
content: The 386 is in the micro pc running openocd, network in, usb out. The little black square lower right of the enclosure. More than enough to run the openocd remote gdb application. The $10 cortex cpu board is top right, the bare board. The key thing is that is a) accessable from any machine on the network, and b) be all in one box. Plenty of choices, but had all the bits to hand from previous projects, so cost me nothing but a few hours work...