hybridfree/eevblog-posts huggingface dataset:
Unexplained issue with an ST Microelectronics STM32F100C6T6 MCU - Page 1
Forum section: electronics / general

author: Sheen 78
author_rank: Newbie
timestamp: February 17, 2024, 09:22:16 am
content: Hello All,I have been working on a rather sophisticated switch-mode power supply out of a Crown professional audio amplifier.The STMicroelectronics STM32F100C6T6 is used on the power supply PCB for housekeeping. It is also responsible for turning on/off of the unit.

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 17, 2024, 11:27:54 am
content: Upload the binary file, might give some hints.Before programming, are you checking if the config RDP and WRP protection bits are all off?If PB8 blinks, and it's not the power supply itself, clearly the MCU isn't being erased.Must be the psu somehow. Have you checked the output with a scope? Maybe a slow turn-on or noisy output is triggering it.

author: wek
author_rank: Frequent Contributor
timestamp: February 17, 2024, 11:45:47 am
content: QuoteWhat exactly do you mean by "global erase"?JWPS. There are two bytes for user data storage in the Option Bytes, see Data0 and Data1 in PM0063.PS2. If state is stored in FLASH - or in abovemention Option Bytes - the FLASH cells in question can be "worn out" if endurance limit is exceeded. FLASH cells then may excessively leak charge, not being able to retain their state. The result is unreliability in time and at elevated temperature, not necessarily detectable by simple checks when erasing/programming.
RobotDyn Black Pill STM32F303CCT6 - Page 1
Forum section: electronics / general

author: mojoe
author_rank: Frequent Contributor
timestamp: February 20, 2024, 08:47:17 am
content: It has been quite a while since I fooled around with one of these Black Pill boards, and I couldn't remember how I got them working under the Arduino IDE. I figured it out again, and made some notes for myself. I have attached a PDF, as others may find this useful. Most of you already know this, or you don't use Arduino. Some probably program the chips with tiny tweezers to flip the bitsThe instructions are for Windows. Other STM32 boards should require a similar process to get them working in the Arduino IDE (version 2, now).Let me know if corrections are needed.
espnow (esp32, esp8266) uses wifi broadcast like upnp ? - Page 1
Forum section: electronics / general

author: linux-works
author_rank: Super Contributor
timestamp: February 15, 2024, 06:55:10 pm
content: this was surprising to me. anyone have any experience with 'espnow' so-called direct wifi comms?I'm just trying it out and I'm not super happy with what I'm seeing.I have 2 systems at home that seem to want to talk upnp (and no easy way to turn that crap off!) and when I run espnow as a listener, I'm seeing their broadcast CRAP on my incoming stream. what the holy hell?I'm just trying to send ascii payload from one esp chip to another on my home wifi net. I was doing a serial monitor of the Serial.print() stream and while most data comes across, I'm seeing broadcasts, in pure ascii, IN MY STREAM. like the old ftdi-gate nonsense, but quite different.I wonder if this can be turned off. I'm not finding much info on it.the image shows my rasp pi running 'home assistant' and it seems that also wants to announce itself on raw wifi and its farking with my serial stream. what the hell. this is so wrong on so many levels.the json stream is my stream. its from a voltmeter and its just a json string of a set of measurements. I want that stream and NOT nonsense junk from every charlie on the damned wifi.

author: linux-works
author_rank: Super Contributor
timestamp: February 15, 2024, 07:01:59 pm
content: one more bit of info. it seems that if I run my esp8266 listener and have my term emulator watch the output, the output is silent UNTIL I have a remote side (also esp8266) as an espnow sender. it sends directly to the mac addr of my espnow listener (so I'm NOT using broadcast all FF addr!). when the sender sends enough data packets, it seems to wake up or trigger some other upnp busybodies on the wifi lan and they start announcing themselves.if I stop the sender unit, the channel goes quiet again and I dont see those adverts. so its only when my other peer sends data and others feel they have to join in to the 'party line'.what a messed up scheme. I might have to abandon the espnow idea (just as soon as I tried it).
enabling uart and i2c on zephyr OS - Page 1
Forum section: electronics / general

author: e0ne199
author_rank: Regular Contributor
timestamp: February 12, 2024, 03:06:34 pm
content: Hello everyone, is there anybody here who uses zephyr OS?if there is, do you know how to enable enable cdc-acm uart and i2c on raspberry pico at the same time??
PIC18F252/2320 tool support? - Page 1
Forum section: electronics / general

author: dobsonr741
author_rank: Frequent Contributor
timestamp: February 15, 2024, 05:34:26 pm
content: Are these MCUs still considered supported? I found an old stash about 50 pieces. Installed MPLAB and it says “no MCC content” for them. My interest is to use them them as I2C GPIO extender.

author: woofy
author_rank: Frequent Contributor
timestamp: February 15, 2024, 08:58:33 pm
content: They predate mcc and have never been supported by it.You can still use assembler or c with them, you just have to initialize the registers yourself.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 15, 2024, 09:32:55 pm
content: The PIC18F2320 is still in active production and supported by Microchip XC8 and MPLAB X.https://www.microchip.com/en-us/product/PIC18F2320I don't know what the deal is with MPLAB, I don't currently use it. But for the compiler, I'd be looking for XC8, not "mcc".

author: MarkF
author_rank: Super Contributor
timestamp: February 15, 2024, 11:43:41 pm
content: Here is the xc8 compiler ver2.45 supported devices list.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: February 16, 2024, 02:56:57 pm
content: So far so good, XC8 supports. Have anyone experienced using (and locating) the legacy peripheral libraries? In 2020 it was offered, now I can not find it on the downloads anymore.https://microchip.my.site.com/s/article/Legacy-Peripheral-Libraries

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 16, 2024, 03:09:55 pm
content: In the archived section. Search "Peripheral Libraries" there.https://www.microchip.com/en-us/tools-resources/archives/mplab-ecosystem

author: dobsonr741
author_rank: Frequent Contributor
timestamp: February 16, 2024, 03:43:46 pm
content: Thanks! Legacy libs installed sided by side to the latest XC8. The only caveat it can not be done on a Mac. The legacy library installer way past their expiration date, they are 32 bit. So planted both the libs and XC8 as Windows app in a Crossover bottle.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 16, 2024, 09:32:56 pm
content: Never used their peripheral libraries back when I was using the PIC18. I really suggest doing without it - the datasheets are pretty good overall and peripherals are decently documented. Using registers directly will save you significant code size and a lot of frustration IMO. But just a thought.

author: woofy
author_rank: Frequent Contributor
timestamp: February 16, 2024, 10:26:36 pm
content: I agree, I wouldn't bother with the peripheral libs for this. As I said above, you are better to configure the registers yourself, the datasheets are clear and descriptive. MPLABX will generate the config table too. Go to Window->Target Memory View-> Configuration bits. Click generate code when done and paste into your project.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: February 18, 2024, 01:32:21 am
content: Thanks all. Got the blinky going. To my biggest surprise, the Wisp648 I built 15 years ago, along with the programmer app in .NET worked like a charm.
Implementing FT2232H for JTAG and serial port - Page 1
Forum section: electronics / general

author: Shimonu
author_rank: Regular Contributor
timestamp: February 10, 2024, 05:13:16 pm
content: Hi,First time caller and this should hopefully be a simple question.I'm putting an FTDI FT2232H on a PCB to get a JTAG and serial port connection through USB to an STM32L431 microcontroller. I've followed their example schematic and it seems like no trouble. I'm just wondering now what the procedure is, once I get my board, how to get the JTAG and serial port functional. Is it just going to work out of the box and the programming software will figure it out as long as I have an FTDI driver installed?I'll be using PlatformIO which uses OpenOCD for programming and debugging and from what I can see they seem to support FTDI chips but I'm just not sure how automatic all that is. I've found guides about using the D2XX protocol for configuring MPSEE in the FT-chip but I can't quite get my head around if that's more for using the GPIO, SPI and other stuff.

author: langwadt
author_rank: Super Contributor
timestamp: February 10, 2024, 06:01:36 pm
content: as long as the software can work with the port on the FT2232 you have connected the jtag to and can work with the default ft2232 default vid/pid. It should work out of the box
MAX7219 matrix display smaller “font” - Page 1
Forum section: electronics / general

author: kuzm1nsk1
author_rank: Contributor
timestamp: February 12, 2024, 11:35:16 pm
content: Hello, I’m using Arduino Uno to interface MAX7219 8x8 dot matrix display with 4 modules. Can someone reccomend a way to fit 6 digits on 4 modules that would display clock as for example 12 : 34 : 56. The default “font” using MAX7219 or parola library is to big and I can’t find a way to size it without writing my own code from the beginning.

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 13, 2024, 01:53:41 am
content: Quote from: kuzm1nsk1 on February 12, 2024, 11:35:16 pmSeehttps://arduinoplusplus.wordpress.com/2016/11/08/parola-fonts-a-to-z-defining-fonts/.You have 32 LEDs horizontally. I'd useCode:H H H · h h h h · · · M M M M · m m m m · · · S S S S · s s s s 1 = 0x01H H H · h h h h · · · M M M M · m m m m · · · S S S S · s s s s 2 = 0x02H H H · h h h h · X · M M M M · m m m m · x · S S S S · s s s s 4 = 0x04H H H · h h h h · · · M M M M · m m m m · · · S S S S · s s s s 8 = 0x08H H H · h h h h · · · M M M M · m m m m · · · S S S S · s s s s 16 = 0x10H H H · h h h h · X · M M M M · m m m m · x · S S S S · s s s s 32 = 0x20H H H · h h h h · · · M M M M · m m m m · · · S S S S · s s s s 64 = 0x40H H H · h h h h · · · M M M M · m m m m · · · S S S S · s s s s 128 = 0x80The data displayed on the four MAX7219 modules is formed from 32 bytes, each byte defining one (vertical) column of LEDs. Each LED corresponds to a binary digit, the values shown above on right.You essentially need five 8×3 glyphs –– space, ':', '0', '1', '2' –– and eleven 8×4 glyphs –– space, and '0' through '9'. You need to draw these yourself, I'm afraid.
Unclear how to modify EEPROM hex data in FTDI FT232RL - Page 1
Forum section: electronics / general

author: Hifi Necromancer
author_rank: Contributor
timestamp: February 10, 2024, 01:14:03 am
content: I have a FT232RL and I need to change a couple bytes in the EEPROM data in order to make it interface with a golf cart controller. Using FT_Prog I can change things like VID and PID, etc. but I can't figure out how to directly modify the stored data. Can someone clue me in?Edit: Nevermind, I was able to connect to the controller without modifying the data.
PIC18F97J60 code examples? - Page 1
Forum section: electronics / general

author: Red Squirrel
author_rank: Super Contributor
timestamp: February 09, 2024, 10:15:46 pm
content: Anyone familiar with this micro and have any good resources on coding for it? There are some very brief sample assembly code in the datasheet but not enough to get a full understanding of how to code on it. not really looking for a full library just want to get enough examples so I know how to do basic things like initialize ports, use ports, send ethernet frames, receive ethernet frames, use i2c etc.Ideally I would want to use C if possible but if this chip uses assembly then I've always been kinda tempted to brush up on that more. I've done very brief assembly before so understand it to a very small degree.

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 09, 2024, 10:25:53 pm
content: Try GitHub:https://github.com/search?q=PIC18F97J60&type=repositories

author: woofy
author_rank: Frequent Contributor
timestamp: February 09, 2024, 10:37:34 pm
content: You can use mplabx/mcc to generate a tcp/ip stack for it.
STM32G0 that just won't connect - Page 1
Forum section: electronics / general

author: satyamfifa
author_rank: Regular Contributor
timestamp: February 01, 2024, 02:45:49 am
content: Hey All,I made my first STM32 board using STM32G0B1RE, it arrived today, since it's blank I expected the MCU to jump into bootloader and start the DFU, however this did not happen, MCU was not detected at all by the USB, I checked further and USB DP was not pulled high which was unexpected.To check if the MCU has been entered the bootloader I check the UART TX and I2C SCK pins, and they are indeed high, indicating that MCU was indeed entered the bootloader. However, MCU is again not detected by UART.Finally, I decided use another NUCLEO board as a programmer with the SWD interface, again, the MCU is not detected. I expect the SWD interface to work irrespective of bootloader.Pulling up or down the BOOT0 makes no difference. I probed the board, and everything seems normal, voltages connections etc. I have 220 ohms series resistor on the SWD interface, which is little on the high side, but I don't think that should make a difference.It just seems like MCU enters into bootloader, tries to initialize the peripherals, and just freezes. Only thing that seems to be working it the RESET pin, when it's pulled low all GPIOs go low.Kind Regards,Sparsh

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 01, 2024, 04:42:47 am
content: Schematics?

author: satyamfifa
author_rank: Regular Contributor
timestamp: February 02, 2024, 06:48:46 am
content: Well, I made a blunder, as it turns out STM32G0R1BETx doesn't have the same pinnout as STM32G0B1RETxN even though both are LQFP64 package. Also I learnt that x at the end of part number can sometimes be a little misleading as I learnt the hard way.But fortunately for me, I was able to make my board work by patching just one wire.[ Specified attachment is not available ]

author: Berni
author_rank: Super Contributor
timestamp: February 02, 2024, 06:54:08 am
content: Yep been bitten by that one too before.Seams like ST really loves to make alternative pin outs for a chip designated by a letter way at the end of the partnumber where you might assume it just means a temperature range or reel package type or something irrelevant like that, but nope.At least this one is reasonably consistent, i had a while section of IO pins shifted over due to an extra letter on the end of the partnumber.
VS2022 ClickOnce version - Page 1
Forum section: electronics / general

author: ArCoN
author_rank: Contributor
timestamp: November 06, 2023, 07:08:19 am
content: Hi AllAnyone knows how to get the version from the clickonce into the app somehow?I have this now, and it does not work. dont know where it gets that version fromthis.Text += " " + Assembly.GetEntryAssembly().GetName().Version;B.R.

author: cgroen
author_rank: Unknown
timestamp: November 06, 2023, 12:16:48 pm
content: This works for me:private string getVersion() {Assembly assembly = Assembly.GetExecutingAssembly();FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);return fileVersionInfo.ProductVersion;}

author: ArCoN
author_rank: Contributor
timestamp: November 06, 2023, 12:27:49 pm
content: Thanks for the input. but it still returns 1.0.0

author: cgroen
author_rank: Unknown
timestamp: November 06, 2023, 01:26:14 pm
content: Strange, works in several applications here.Good luck fixing this, sometimes its not clear what's going on behind the curtains...

author: ArCoN
author_rank: Contributor
timestamp: February 02, 2024, 11:58:50 am
content: This is working, when it is publishedstring versionString = Environment.GetEnvironmentVariable("ClickOnce_CurrentVersion") ?? "0.0.0.0";Version version = Version.Parse(versionString);return version;
CH32V003F4P6 I2C port pin Remapping - MounriverStudio (SOLVED) - Page 1
Forum section: electronics / general

author: corgon
author_rank: Contributor
timestamp: January 29, 2024, 04:59:28 pm
content: I'm trying to remap the I2C port on CH32V003F4P6 to the PD0, PD1 pins.I'm using the I2C port for the SSD1306 OLED display.Unfortunately, it's not working. I am using the following config:Code:void IIC_Init(u32 bound, u16 address) {GPIO_InitTypeDef GPIO_InitStructure = { 0 };I2C_InitTypeDef I2C_InitTSturcture = { 0 };RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO, ENABLE );RCC_APB1PeriphClockCmd( RCC_APB1Periph_I2C1, ENABLE );GPIO_PinRemapConfig (GPIO_PartialRemap_I2C1, ENABLE ); // REMAP I2c to Pins: PD0, PD1GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init( GPIOD, &GPIO_InitStructure);I2C_InitTSturcture.I2C_ClockSpeed = bound;I2C_InitTSturcture.I2C_Mode = I2C_Mode_I2C;I2C_InitTSturcture.I2C_DutyCycle = I2C_DutyCycle_2;I2C_InitTSturcture.I2C_OwnAddress1 = address;I2C_InitTSturcture.I2C_Ack = I2C_Ack_Enable;I2C_InitTSturcture.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;I2C_Init( I2C1, &I2C_InitTSturcture);I2C_Cmd( I2C1, ENABLE);I2C_AcknowledgeConfig( I2C1, ENABLE);}I think the problem might be that the PD1 pin is also the programming pin SWDIO.I've been trying to figure it out for two days, but still without success.Can you point me in the right direction?Just so you know, remapping to pin PC5, PC6 is working smoothly without any problems.Thanks, Corgon.
ESP32S3 HX8238D RGB Display - Page 1
Forum section: electronics / general

author: cheeseburger
author_rank: Contributor
timestamp: January 28, 2024, 05:59:04 pm
content: Hello,I'm attempting to interface a HX8238D RGB Display with the ESP32S3. The display supports parallel RGB data with 24 bits (8 bits per color).Since the ESP32S3 only supports 16-bit RGB (RGB565), I intend to configure the remaining pins (Red 0-2, Green 0-1, Blue 0-2) to VSS.For testing purposes, I've connected this display to the ESP32S3 and linked the control signals (HSYNC, VSYNC, DE, and PCLK) to the ESP32S3. Additionally, I've connected Red Bits 3-7 to the ESP32S3.On the software side, I've utilized this example:https://github.com/espressif/esp-idf/tree/482a8fb2d78e3b58eb21b26da8a5bedf90623213/examples/peripherals/lcd/rgb_panelChanges made to the Example:- Adjusted clock to 7MHz- Modified resolution to 320x240- Set .hsync_back_porch to 68- Set .vsync_back_porch to 18Regrettably, despite these adjustments, the screen remains black. Upon resetting the ESP32S3, the screen gradually turns bright white (presumably due to the absence of PCLK).Do you have any suggestions on what I could investigate next? The connections appear to be intact, and there is signal present on all lines (verified with an oscilloscope).

author: Scrts
author_rank: Frequent Contributor
timestamp: January 29, 2024, 03:18:43 pm
content: Can you provide the datasheet in the 1st place? Did you set the setting pins correctly?Trying to do basic math here: (320+68)pixels * (240+18)lines * 60FPS = 6.006240 MHz for pixel clock.Seems like you're trying to get 70FPS out of this panel?

author: Nominal Animal
author_rank: Super Contributor
timestamp: January 29, 2024, 04:30:51 pm
content: Quote from: cheeseburger on January 28, 2024, 05:59:04 pmNo, don't; just connect the inputs cyclically.For example, if your data isR4 R3 R2 R1 R0 G5 G4 G3 G2 G1 G0 B4 B3 B2 B1 B0then connect the highest bits to the lowest so you getR4 R3 R2 R1 R0 R4 R3 R2 G5 G4 G3 G2 G1 G0 G5 G4 B4 B3 B2 B1 B0 B4 B3 B2This way, you get the full dynamic range, with as even intervals as is possible. If you tie the least significant bits to zero, you won't get the full dynamic range.
ST MotorControl Workbench V 5.4.8 or 6.2.1 would fail to generate - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: January 28, 2024, 03:28:32 pm
content: HiI wanted to test ST MotorControl Workbench for experimenting with brushless motors, I have installed and tested the MotorControl Workbench 6.2.1 and MotorControl Workbench 5.4.8 on win 11 and both of them would fail to generate the projects out of box with this error message,I have set them to use keil IDE v5 and my stmcubemx version is 6.10.0you can check the error log hereQuoteWhat's the problem? do you have any Idea what's wrong?
Feedback controlling method understand  - Page 1
Forum section: electronics / general

author: thannara123
author_rank: Newbie
timestamp: January 26, 2024, 07:23:39 am
content: In sinewave inverter like products ,How the feedback control Works ?The feedback sinewave signal properly shaped and connected to the ADC of the controller .Is the ADC reads, the first Half cyle and calculate the RMS of the signal . Then correct the PWM switching to maintain the voltage stable?Oris the instantenious value of the ADC reads is correct the PWM to maintain the voltage stable ?The first one takes more time in 50 Hz system it takes 10 milli second .what is the normal type is there any other logic ?how the settiling time / Response time ?

author: Andy Chee
author_rank: Super Contributor
timestamp: January 26, 2024, 08:21:03 am
content: You need to analyse the inverter in two stages:1) boost 12V DC to 340V DC2) convert 340V DC to 240V AC 50HzThe main feedback loop occurs in stage 1) and usually operates a high frequency PWM push-pull transformer, maybe 30-50kHz. The ADC will read the DC voltage and regulate the 340V DC output. This stage also contains current limiting.A second, H-bridge PWM controller in stage 2) then converts the 340V DC to 240V 50Hz AC. This second H-bridge PWM also works at high frequency. There is no feedback in this stage, this stage is only for sinewave shape generation.

author: thannara123
author_rank: Newbie
timestamp: January 26, 2024, 11:16:24 am
content: Sir , Its not a two stage one ,it is low frequency transformer based

author: Johnny B Good
author_rank: Frequent Contributor
timestamp: January 27, 2024, 06:03:55 pm
content: I'm pretty sure these inverters use a similar technique to that employed by inverter genset designs where a 3 phase permanent magnet alternator is directly driven by a small ICE whose speed can be varied according to the load.For European / UK service, the alternator typically outputs a three phase 350 to 380 peak amplitude sine (or possibly even trapezoidal) voltage around a frequency ranging from a low of 300 to a maximum of 450Hz or so which is fullwave rectified and smoothed to a 350 to 380 vdc level.The controller simply adjusts the ICE's rpm to maintain the voltage level within this range which feeds what is essentially a high voltage "digital" bridged output amplifier being driven by a fixed low level (a volt or two?) xtal controlled 50Hz sine wave reference. Being an amplifier it simply raises that sine wave reference voltage by a fixed gain to the required 230vac 50 Hz output voltage.I should think that the inverter uses the same process. The only difference being that it generates the required 350 to 380 vdc HT supply from a battery using a relatively simple high efficiency 12 (or 24 or 48) volt input to 350 volt output DC-DC boost converter.
LGT8F328P mini EVB problem... - Page 1
Forum section: electronics / general

author: Asxetos
author_rank: Newbie
timestamp: January 23, 2024, 02:06:28 am
content: A little help with a problem guys,I bought a couple of purple lgt8f328p nano clone boards (w/ 16mhz crystal) for some projects, and face this:All sketches run OK right after i upload them from arduino IDE, but (some) will not auto run later on power-on.They run only if i reset the board (press the onboard reset switch).The program for the project i work on now is here:https://github.com/crescentvenus/EF-Lens-CONTROL/tree/masterbut this happens with all programs i tested trying to troubleshoot (mostly programs using an ssd1306 so i get an easy visual).PS1. a simple program such as blynk runs ok without the need for reset.PS2. i run the oled on 5V, so it can't be power shortage on the board's 3.3V line.Is it the code? is it the oled, or the board?I know very little about programming, i am just into projects so any help is welcome.Any ideas?

author: Asxetos
author_rank: Newbie
timestamp: January 25, 2024, 04:31:46 pm
content: Well, looks like they have a crappy bootloader burnt in.I wired one of them as an ISP programmer (LarduinoISP) and programmed the sketch directly ("upload using programmer") overwriting their bootloader.Now the sketch loads fine as it should, without the need for any reset.PS, I haven't been able to program the bootloader back (no need, just for the heck of it) that comes from the known LGT8F328P sources.
CH32V003 ADC interrupt cannot set - Page 1
Forum section: electronics / general

author: Sajeev
author_rank: Contributor
timestamp: January 23, 2024, 03:44:41 am
content: Dear Esteemed forum members,I am trying to do ADC conversion with EOC interrupt but it seems the EOCIE bit in ADC_CTRL1 register never sets. I was successful in polling ADC conversion but the interrupt seems elusive. I tried to print out the ADC registers via UART and found the ADC_CTRL1 register is always 0 even though i had OR it with 1<<5. The attached code only prints a polled result and then waits for an interrupt to fire.Requesting forum members to review the code attached an identify the mistake i made. I only know assembly.Appreciate any help/commentsRegardsSajeevcurrent result, only one polled result and interrupt never fires

author: Sajeev
author_rank: Contributor
timestamp: January 23, 2024, 06:45:17 pm
content: Dear Members,Thanks for the views. I got the problem/bug . Instead of OR ing the EOCIE bit i AND ed it to ADC_CTRL1 register. That was the reason the register was always 0. On OR ing the value the interrupt started working. Please find the attached corrected code if it may help anybody. Also find attached ADC with DMA code. covets 2 inputs PD4 and PD3 and stores in SRAM using DMA.ThanksSajeev
Custom Rp2040 Board Device Descriptor Failed Error on Windows. - Page 1
Forum section: electronics / general

author: atulravi
author_rank: Contributor
timestamp: January 20, 2024, 06:50:02 pm
content: I am working on a RP2040 Board in an UNO form factor as a drop-in replacement for an automation system with unos that are dying and am facing an issue where, I have built a custom RP2040 board. (Photos will be attached) When I plug it into windows, I get the device descriptor failed error code. In another prototype with the same chip that I had assembled before, the issue was due to 2 missing traces under the USB C port. But none of those exist in the current iteration. (Previous board issues here:https://www.eevblog.com/forum/microcontrollers/issue-building-custom-board-with-rp2040/) I have not changed the design much. I have only mapped the non-connected GPIOS to headers in the UNO formfactor. It is to be noted that the RP2040s were perfect since those board were assembled at a fab where they used a hotplate in my first prototype. But here, I am using Hot air instead. Could that cause an issue? Also, one mistake I made was not seeing that kicad did not connect the ground planes properly in the version I had fabricated. I have fixed that issue by adding a Bodge wire. Voltages are near perfect 3.34V on 3V3 pins and 1.08V on 1V1 pins. Oscillator seems to work fine. I have not tried using the debugger so far. The CS Pin on the memory chip goes low when I press the bootsel pin on startup. Can anyone find any issue? (Like mentioned before, pics, scheme, gerbers are attached)

author: SeanB
author_rank: Super Contributor
timestamp: January 20, 2024, 08:24:56 pm
content: Would suggest a Rossman of flux, and reflow the board first, to fix the few suspect dry joints there.

author: atulravi
author_rank: Contributor
timestamp: January 21, 2024, 11:22:55 am
content: Quote from: SeanB on January 20, 2024, 08:24:56 pmRossmann level of flux later, I have a partially working board. Now the issue is, whenever I upload the micropython uf2 to the board, it disconnects but it reappears as a fat drive and not as a RP2040 micropython board. Any idea of a probable solution?Update: I got rid of the BOOTSEL switch and added the micropython uf2. Now the device disconnected. But when I reconnect it, it is not recognised anymore. A flash issue maybe?

author: atulravi
author_rank: Contributor
timestamp: January 21, 2024, 02:00:04 pm
content: Quote from: atulravi on January 21, 2024, 11:22:55 amPicotool shows that micropython was uploaded and the flash size matches the chip that I have soldered. Now windows says unknown device when I flash the board with micropython and when I connect it windows fails to recognise it. Ubuntu as well. Hmm.....

author: atulravi
author_rank: Contributor
timestamp: January 24, 2024, 06:59:21 pm
content: It turns out to have been an issue where the flash was acting up. replaced it and made sure it was not exposed to the heat of the hot-air gun directly and it worked! Thanks a lot for the help.
ASF4:  USB host function driver - how to access the device descriptor? - Page 1
Forum section: electronics / general

author: ubbut
author_rank: Regular Contributor
timestamp: January 23, 2024, 02:14:17 pm
content: Hi,based on the examples provided by ASF4 I wrote my own compatible USB host function driver which is working fine.Now, I would like to access the device descriptor from the function driver. I am however not sure how to do this properly.The "install" function only gets a pointer to the interface descriptor it seems, not the start of the device descriptor.And by the time this function gets called, the control buffer does not contain the device descriptor anymoreSo my questions are:from a host function driver, how can I access the device descriptor?Related question:How can I get the manufacturer and device strings?thank you
ch32v307 - mounriverstudio / openocd seems broken... - Page 1
Forum section: electronics / general

author: wilhe_jo
author_rank: Regular Contributor
timestamp: January 22, 2024, 04:47:28 pm
content: Hi!Just made the mistake to update the IDE.For some reason, I cannot programm any CH32V307.It seems that only the first page (0x0-0xFFF) get written. the rest of the memory seems empty.The generated hex is non-empty, tested with my project, a new template and even a new template in a new workspace!Anyone having the same problem?Regards!My open-ocd cfg:Code:#interface wlinkadapter driver wlinkeadapter speed 6000transport select sdi#wlink_set_address 0x00000000wlink_set_address 0x08000000set _CHIPNAME wch_riscvsdi newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x00001set _TARGETNAME $_CHIPNAME.cputarget create $_TARGETNAME.0 wch_riscv -chain-position $_TARGETNAME$_TARGETNAME.0 configure -work-area-phys 0x20000000 -work-area-size 10000 -work-area-backup 1set _FLASHNAME $_CHIPNAME.flashflash bank $_FLASHNAME wch_riscv 0x00000000 0 0 0 $_TARGETNAME.0echo "Ready for Remote Connections"Edit: After hours of hair pulling, I now just pulled the old 1.5 and it works again... it really seems to be an issue with the openocd supplied.
How does  Modbus  protocol work  - Page 1
Forum section: electronics / general

author: King123
author_rank: Contributor
timestamp: January 19, 2024, 11:49:22 am
content: I'm reaching out to gain a better understanding of the Modbus protocol in a general sense. Although I haven't specified a particular microcontroller or Modbus device, let's consider a scenario.Suppose I have a microcontroller and two Modbus devices - Device A (Relay) with an address of 0x10 and register address 0x11, and Device B (Temperature sensor) with an address of 0x20 and register address 0x21. The communication interface is RS485.My objective is for the microcontroller to read data from the temperature sensor and control the relay using the Modbus protocol. In a basic Modbus RTU frame, there's a start bit, slave address, function code, data, CRC, and a stop bit.Given this general situation, I'm looking a explanation of how the Modbus protocol would function to obtain temperature data and control the relay.

author: gmb42
author_rank: Frequent Contributor
timestamp: January 22, 2024, 11:02:52 am
content: Have a look at this, explains all about Modbus protocol:https://modbus.org/docs/PI_MBUS_300.pdf

author: WattsThat
author_rank: Frequent Contributor
timestamp: January 22, 2024, 02:15:57 pm
content: Here is an easy to digest example based set of explanations (I used this as a reference when writing my own arduino library just for the experience):https://ipc2u.com/articles/knowledge-base/modbus-rtu-made-simple-with-detailed-descriptions-and-examples/
Embedded network programming guide - Page 1
Forum section: electronics / general

author: tellurium
author_rank: Frequent Contributor
timestamp: January 18, 2024, 01:05:16 pm
content: I started to write an embedded network programming guide:https://github.com/cpq/embedded-network-programming-guideIt talks about TCP/IP stack and application in general, and showcases the actual implementation based on Mongoose Library.Feedback is welcome.

author: westfw
author_rank: Super Contributor
timestamp: January 18, 2024, 10:17:12 pm
content: QuoteI don't understand how that can work. The mongoose git repository has an extensive src/ subdirectory, and I can't even find the "built in tcp stack" that is supposed to be there as well. There are comments that refer to using LWIP, which would be a whole separate install as well, wouldn't it?

author: tellurium
author_rank: Frequent Contributor
timestamp: January 18, 2024, 11:41:53 pm
content: mongoose.c and mongoose.h at the top of the repo is just an amalgamation / concatenation of the files in src/. And files in src/ contain a built-in TCP/IP stack, and TLS 1.3 stack, in addition to the protocol-specific API for HTTP, Websocket, MQTT, etc.The built-in TCP/IP stack is here:API:https://github.com/cesanta/mongoose/blob/master/src/net_builtin.hSource:https://github.com/cesanta/mongoose/blob/master/src/net_builtin.cDrivers:https://github.com/cesanta/mongoose/tree/master/src/driversMongoose can work on top of an existing stack (like lwIP, Linux/Windows - anything with BSD API), as well as stand-alone.

author: tellurium
author_rank: Frequent Contributor
timestamp: January 18, 2024, 11:58:08 pm
content: Yeah, there are really just two files. And yes, nothing else is required - provided you use one of the supported chips with implemented driver.Including TLS! (server mode for now, client mode TBD soon).Take a look here:https://mongoose.ws/demo/?board=Nucleo-H743ZI&project=simpleThis is a simple bare metal project on a ST board, just several files.Click on Build button. Firmware size is 54k. Note - it implements HTTPS, too. Test it yourself!The project is download-able and build-able manually, on your own workstation. As you can see, there are really just two files, nothing else.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 19, 2024, 12:21:31 am
content: Yeah, SQLite also provides source code as an amalgamation - makes it easy to add to a project, plus gives more opportunities for compiler optimizations.

author: tellurium
author_rank: Frequent Contributor
timestamp: January 22, 2024, 02:16:53 am
content: I have recorded a helper Youtube video that accompanies several sections of the guide - those that go practical and implement a Web UI on a ST dev board. The Youtube video is linked to the first post.
MODE and nHome pins on DRV8825 motor driver - Page 1
Forum section: electronics / general

author: newtekuser
author_rank: Frequent Contributor
timestamp: January 21, 2024, 07:21:06 pm
content: I intend to use full step configuration in my circuit, so per the DRV8825 data sheet I need to set MODE0, MODE1, MODE2 pins to logic low. I do not want to waste any pins on my MCU, so can I just connect each of these pins to GND via a 10K resistors?Also, if I understand the purpose of the nHome pin, it is used to keep track of steps and useful in motor calibration. Don't think that I care in my project as I'm not looking for perfect accuracy, so can I just connect it to a 10K pull up resistor instead? Or is the drift/step skip really a problem? In my application the motor will only be used sparingly.https://www.ti.com/general/docs/suppproductinfo.tsp?distId=10&gotoUrl=https%3A%2F%2Fwww.ti.com%2Flit%2Fgpn%2Fdrv8825

author: DavidAlfa
author_rank: Super Contributor
timestamp: January 21, 2024, 09:35:05 pm
content: Even better, those pins have internal pulldowns, so just leave them unconnected.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: January 22, 2024, 08:59:00 am
content: Quote from: newtekuser on January 21, 2024, 07:21:06 pmThe nHOME pin is an output. If you're not going to use it, you can leave it unconnected.On any chip, outputs usually never need to be connected to anything when unused.

author: newtekuser
author_rank: Frequent Contributor
timestamp: January 22, 2024, 05:40:09 pm
content: thank you very much folks!
SPC564B70 (Bolero) Power Draw in Standby Mode - Page 1
Forum section: electronics / general

author: wolfchip
author_rank: Newbie
timestamp: January 18, 2024, 07:33:23 am
content: Can anybody offer any knowledge of using STANDBY mode? I am putting the chip in STANDBY and it appears to go there, as the processor goes dormant until I cause a wakeup event. But the current draw on the VDD_LV power-input (2.1v) is ridiculously high (~100ma). I've confirmed that the power is not going out the ports - those are all ok - it appears to be going to core/peripherals (hence VDD_LV). Following the spec carefully, with weeks of scrutiny and experimentation. Can give more details if anybody has experience here... thanks
SPC56EL70L5 and SPC56ELADPT144S mini module - Page 1
Forum section: electronics / general

author: wolfchip
author_rank: Newbie
timestamp: January 18, 2024, 07:32:22 am
content: Hello, i have a doubt. The Daughter/adapter board SPC56ELADPT144S is for SPC56xxEL family. In SPC56ELADPT144S datasheet is written:device supported SPC56EL60L5. But when i search in WEB page for SPC56xxEL family i don't find SPC56EL60L5. WEB page:http://www.st.com/web/en/catalog/sense_power/FM2098/SC963/SS1534in MCU list there are SPC56EL60L3 or SPC56EL70L5. SPC56ELADPT144S support a MCU that it don't exists? i think that's impossible! There is an error? However, error apart, are MCU SPC56EL70L5 compatible with SPC56ELADPT144S?
problem with reciving answer from sim800  - Page 1
Forum section: electronics / general

author: ُSTP.Asghari
author_rank: Newbie
timestamp: January 17, 2024, 02:31:51 pm
content: When I give the AT command to the module. The module should give me the answer AT\r\nOK\r\n but to my surprise it gives the answer AT\r\r\nOOK\r\n. I understood this problem by getting the answer from the code below. While if I delete the wrong lines from the code below, the module does not respond.Code:Send_AT();do{buffer=get_char();}while(buffer!='A');buffer=get_char();if(buffer=='T'){buffer=get_char();if(buffer=='\r'){buffer=get_char();if(buffer=='\r'){buffer=get_char();if(buffer=='\n'){buffer=get_char();if(buffer=='O'){if(buffer=='O'){buffer=get_char();if(buffer=='K'){buffer=get_char();if(buffer=='\r'){buffer=get_char();if(buffer=='\n'){for(i=0;i<5;i++){HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,GPIO_PIN_SET);HAL_Delay(500);HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,GPIO_PIN_RESET);HAL_Delay(500);}}}}}}}}}}

author: Scrts
author_rank: Frequent Contributor
timestamp: January 17, 2024, 05:06:41 pm
content: What do you see as a response when you hook up USB-UART adapter to your PC? Your code seems to be messy. Receive the full command from the module to the buffer and then parse the data.

author: bookaboo
author_rank: Frequent Contributor
timestamp: January 17, 2024, 07:11:36 pm
content: You need to forget the Simcom module for a while. Sharpen your embedded skills firstIoT modules are a world of pain, even if you have embedded experience.Write, or find, a proper uart receive handler function.Test it with an FTDI cable, or even loop a uart tx back from your processor.
ECSPI problem on Cortex-M7 core - Page 1
Forum section: electronics / general

author: teleportboy
author_rank: Newbie
timestamp: January 17, 2024, 04:02:36 pm
content: On the board with Cortex-M7(as coprocessor, the main core is A53. The linux running on a53), ADS8028 is connected via SPI. However, attempts to communicate with the ADS8028 device end in failure. I based my approach on the spi_polling example from the SDK. I configured the multiplexing correctly, according to the .dts file. But after sending a specific sequence of bits according to the ADS8028 datasheet via SPI, the RX buffer only records 0x0 or some garbage, now what I expect. Interestingly, the same behavior occurs even if the multiplexer is deliberately misconfigured or not configured at all.What could be the problem?Configuring ecspi from the .dts file:pinctrl_ecspi2: ecspi2grp {fsl,pins = <MX8MP_IOMUXC_I2C3_SCL__ECSPI2_SCLK 0x82MX8MP_IOMUXC_I2C3_SDA__ECSPI2_MOSI 0x82MX8MP_IOMUXC_I2C4_SCL__ECSPI2_MISO 0x82MX8MP_IOMUXC_ECSPI2_SS0__GPIO5_IO13 0x82MX8MP_IOMUXC_SD2_CD_B__GPIO2_IO12 0x146>;};Initializing ECSPI code:/* Master config:* masterConfig.channel = kECSPI_Channel0;* masterConfig.burstLength = 8;* masterConfig.samplePeriodClock = kECSPI_spiClock;* masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;* masterConfig.chipSelectDelay = 0;* masterConfig.samplePeriod = 0;* masterConfig.txFifoThreshold = 1;* masterConfig.rxFifoThreshold = 0;*/ECSPI_MasterGetDefaultConfig(&masterConfig);masterConfig.channelConfig.phase = kECSPI_ClockPhaseSecondEdge;masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;ECSPI_MasterInit(EXAMPLE_ECSPI_MASTER_BASEADDR, &masterConfig, ECSPI_MASTER_CLK_FREQ);
16x2 LCD no longer works after changing GPIO pin assignment - Page 1
Forum section: electronics / general

author: newtekuser
author_rank: Frequent Contributor
timestamp: October 18, 2023, 04:51:01 am
content: After changing GPIO port assignments on my PIC16F887 (TQFP), my 16x2 LCD no longer works, lights up but displays all blocks. This tells me some issue with data transmission. I am aware that some of the ports chosen ports are typically not used as such like the MCLR, ICSPDAT and ICSPCLK pins, but I did change their direction and also disabled MCLRE in the config. (I always had it disabled even before when things were working)Attached is the before and after diff. TRISA, TRISB and TRISE was also updated accordingly.Code:ANSEL = 0b0000000;ANSELH = 0b0000000;TRISAbits.TRISA0 = 0; // LCD D4TRISAbits.TRISA1 = 0; // LCD D5TRISAbits.TRISA2 = 0; // LCD D6TRISAbits.TRISA3 = 0; // LCD D7TRISBbits.TRISB7 = 0; // LCD RSTRISEbits.TRISE3 = 0; // LCD ENTRISBbits.TRISB0 = 1; // button 1TRISBbits.TRISB1 = 1; // button 2TRISBbits.TRISB2 = 1; // button 3PORTEbits.RE2 = 0; // I1PORTEbits.RE1 = 0; // I2PORTEbits.RE0 = 0; // I3PORTAbits.RA5 = 0; // I4Are there any other gotchas? I have double and triple checked connections go where they say they go.I also know the display still works as I can test it on another breadboard.Many thanks in advance!

author: Kim Christensen
author_rank: Super Contributor
timestamp: October 18, 2023, 05:02:19 am
content: One obvious problem is:TRISEbits.TRISE3 = 0; // LCD ENThis pin cannot be assigned as an output. It'll always be an input no matter what you try to set TRISEbits.TRISE3 to.This is because RE3 (pin 18) also doubles as the MCLR/VPP pin.

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 18, 2023, 01:57:16 pm
content: Read datasheet Page 61.As Kim said, MCLR pin is input-only!

author: newtekuser
author_rank: Frequent Contributor
timestamp: October 18, 2023, 02:46:58 pm
content: Thank you very much all! Two important lessons learned: 1. Don’t make assumptions based on incomplete knowledge, 2 when all else was tried have a look at the datasheet for important clues (limitations, restrictions, recommendations etc)

author: tooki
author_rank: Super Contributor
timestamp: January 20, 2024, 09:27:45 am
content: Quote from: newtekuser on October 18, 2023, 02:46:58 pm”When all else was tried”? No, looking at the datasheet is arguably thefirstthing you should be doing.
Feedback needed - in-browser project demo, for evaluating software - Page 1
Forum section: electronics / general

author: tellurium
author_rank: Frequent Contributor
timestamp: January 14, 2024, 05:14:38 pm
content: I work for company that develops a network library with built-in TCP/IP and TLS stack. We want a simple way to let people evaluate the library and its capabilities. We came up with the evaluation page, that allows to build and flash some pre-selected projects completely in browser (Chrome or Edge). Please take a look:https://mongoose.ws/demo/This is work in progress. We plan to add many more boards to the supported boards list.People who have development boards supported by that demo page, can easily flash their boards and see how things work. No toolchain / IDE / whatever is necessary, just a development board.I would greatly appreciate a feedback on it. Please let me know what you think. Apart from what you have in mind, I'm interested in:1. Do you find such a demo useful at all2. What feature you'd like to see (like, live debugging support?)3. How do you demo your development to prospects / customers ?4. Would you use a similar demo page for your own projects or within your team for internal references ?Side note: a "simple" Web UI demo is only 54k on flash on Nucleo-H743ZI - and that's with TLS. RAM footprint is ~17k idle, and few Kb per connection (even with TLS). TLS handshake is < 200ms, though this H7 is fast, 480 MHz.