hybridfree/eevblog-posts huggingface dataset:
STM32Cube32 SWV Data/Time Line Trace Not Working - Page 1
Forum section: electronics / general

author: imk
author_rank: Regular Contributor
timestamp: March 12, 2021, 07:13:33 pm
content: Hello,I am trying to get the SWV Data and Time Line trace working during and debug session and it just wont show the variable name or value, any idea please.The program is a simply blinking LED where i read a port value LEDPinState = HAL_GPIO_ReadPin( GPIOC , GPIO_PIN_13 );Test the state of LEDPinState and set the opposite state, followed by a delay(100).The program runs fine in the micro and during debug the value of LEDPinState can be seen toggling in Line Expressions View.But no way can i seem to configure the system to display LEDPinState in SWV Data and Time Line trace's.I must have watched half a dozen how to videos and tried just about chk box, variable, clk speed etc , but ZERO results.I am using a STLINKV3 in GDB server mode, SWD interfaceMany thanks in advance imk

author: DavidAlfa
author_rank: Super Contributor
timestamp: March 14, 2021, 09:53:14 pm
content: This might help:https://www.eevblog.com/forum/microcontrollers/stm-cube-ide-tracing-is-not-supported/
STM32CubeIDE HAL Function Prompt/Hint not Working - Page 1
Forum section: electronics / general

author: imk
author_rank: Regular Contributor
timestamp: March 11, 2021, 08:51:29 pm
content: Hello,So i am fairly new to STM32CubeIDE and have noticed in several of the tutorial video that when using the editor and typing in HAL_the system prompts/hints with a popup and list of functions eg HAL_xxx_xxx etc. Similar to MS VS2019However this does not seem to happen on my insulation of SM32CubeIDE, any idea how i turn this feature on please?Many thanks imk

author: dtodorov
author_rank: Contributor
timestamp: March 11, 2021, 08:55:42 pm
content: For starters, make sure you have no syntax errors and the code builds. Also double check your include files.I've had issues at my side due to such mistakes.

author: imk
author_rank: Regular Contributor
timestamp: March 11, 2021, 08:58:02 pm
content: Brand new project just generated with Code Generator, Compiles and Run.Come to edit it to add a HAL_ function and no popup prompt/hint

author: dtodorov
author_rank: Contributor
timestamp: March 11, 2021, 09:02:10 pm
content: Is pressing CTRL+Space of any help?

author: imk
author_rank: Regular Contributor
timestamp: March 11, 2021, 09:06:15 pm
content: CTRL+Space seems to do the trick.Any other STM32CubeIDE tricks i should know please?
Padauk programming - Page 1
Forum section: electronics / general

author: Rob_of_Kincardine
author_rank: Newbie
timestamp: March 11, 2021, 03:56:35 am
content: Hello ALLI just finished my first Padauk micro design and PCB layout, well almost. I would like to add a few test pins on the PCB for programming. Then I would make a fixture that can be plugged into the programmer ZIF socket that has pogo pins to connect to my PCB.The documentation for the programmer suggest only the F series (PFC multiple programming) can support in_circuit programming. If I use a PMS series and isolate pins PA3, PA5, PA6 would this work with my pogo pin adaptor board. The schematic is attached, it's not easy to see but the 1uF cap and LED are isolated by solder jumpers.Thanks for any suggestion or comments.
selecting the right Padauk micro - Page 1
Forum section: electronics / general

author: Rob_of_Kincardine
author_rank: Newbie
timestamp: March 08, 2021, 12:07:02 am
content: Hi FolksI am looking to venture into the land of Padauk micro. I would like to start with a version that I can program multiple times and then move to OTP. Here are a few version I am looking at:PFC151 its not available on LCSC, so its outPFS154, My most expensive pick.PMS150C-S08 SOVA, best choice so far.Now for my questions:PMS vs PMC, The PMC version has high noise immunity. I will be power my project with a good DC power supply. Has anyone had negative experiences with noise and the PMS series?Can anyone tell me the difference between SOVA PMS and PMS series of parts. Does SOVA stand for anything?

author: Rob_of_Kincardine
author_rank: Newbie
timestamp: March 11, 2021, 03:02:27 am
content: I figure out what SOVA stands for : Series of Value and affordable.What the physical/specification differences are still alludes me.I hope LCSC gets these back in stock.
INTOSC madness - Page 1
Forum section: electronics / general

author: PerranOak
author_rank: Frequent Contributor
timestamp: March 11, 2021, 07:10:28 pm
content: I'm using a 12F683 and have been setting FOSC = INTOSCIO and everything is fine.Then I changed things (extra info included, the only other thing I changed was the freq from 4MHz to 1MHz):Code:#include <xc.h>#include <stdio.h>#include <stdlib.h>#define _XTAL_FREQ 1000000#pragma config FOSC = INTOSCThis is so I can output the clock.Now I get this error:683_Shift_Reg.c:14:: error: (1363) unknown configuration setting/register (FOSC = INTOSC) usedCould I please have a clue as to where to look for the right command, cheers.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 11, 2021, 07:57:17 pm
content: Set _XTAL_FREQ back to 4MHz?Or:Use your IDE to seach through the "library" code & header files for "_XTAL_FREQ" and how it is used.It's likely that dependent on different ranges of values different settings are chosen, and the settings for 1MHz apparently do not agree with FOSC = INTOSC.You can of course also search for those macro names.

author: cv007
author_rank: Frequent Contributor
timestamp: March 11, 2021, 08:28:46 pm
content: Look in pic/dat/cfgdata/12f683.cfgdata-INTOSCCLK is probably what you are looking for (or a couple other name variations).

author: hexreader
author_rank: Frequent Contributor
timestamp: March 11, 2021, 09:00:33 pm
content: cv007 is of course correct with INTOSCCLKThe way I would have found this is:From the MPLABX IDE Select:- Production- Set Configuration Bits- to the right of field FOSC select the down arrow- choose from the drop-down listEither "Generate Source Code To Output" and copy/paste the resulting output to your code window, or manually edit as you prefer

author: jpanhalt
author_rank: Super Contributor
timestamp: March 11, 2021, 09:54:17 pm
content: Probably I misunderstand. Do you want intosc out using the internal oscillator or a crystal?The setting for 1MHz is b'0100xxxx' in the OSCCON register if using the internal oscillator. If using a crystal, it doesn't matter. Then in configuration, you need to define INTOSCIO or INTOSC and so forth.

author: PerranOak
author_rank: Frequent Contributor
timestamp: March 13, 2021, 06:20:07 pm
content: Thank you all very much.I wanted to output the internal oscillator. It wasn't the freq that was the problem, thanks, see below.Thank you, the command:INTOSCCLKworked perfectly.I had completely forgotten about the "Set Config Bits" pull-downs. I generally copy all that stuff from previous projects and alter the things I need to, hence myINTOSCerror. I will use that in future, thank you.Interestingly, I looked in the file,12f683.cfgdataand found:CVALUE:5:INTOSCCLK,_INTOSC,_INTRC_OSC_CLKOUT:INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKINOf course,INTOSCCLKworked but, for fun, I tried:_INTOSC.This output the clock at the expected freq but instead of being a nice, sharp square wave, it's edges were curved like you get when there is lots of capacitance around.When I went back toINTOSCCLKit was the nice, sharp wave again.Not a problem, just interesting.
Microchip SAM34R DMA UART drops 3rd Tx char? - Page 1
Forum section: electronics / general

author: cburgess
author_rank: Contributor
timestamp: March 10, 2021, 10:11:20 pm
content: Got something weird going on with a Microchip SAM34 using UART with DMA on transmit only.The 3rd character in the Tx buffer gets skipped. Tried different length strings - same result.Put the Picoscope on the output with serial decoding, and the missing character is not there. No gaps in the transmission, it's as if the DMA is incrementing the address by 2 and simply skipping the 3rd character. Just the 3rd character and nothing else.Tried aligning the buffer on a 32bit boundary - no difference.Don't get me started on Microchip's DMAC implementation. I'm sure it's very clever, but its complexity probably ensures it will never get used fully. I'd much rather have the simpler STM32 system...Any ideas?~ Carl

author: cburgess
author_rank: Contributor
timestamp: March 10, 2021, 10:40:09 pm
content: And the answer was already here, courtesy of Ataradov...Re: SAMD10: Having problems setting up UART with DMA in ASF4/STARTQuote from: ataradov on November 30, 2020, 10:36:48 pmProblem is that the ASF documentation takes you down the route of:dma_start_transfer_job(&example_resource);dma_trigger_transfer(&example_resource);

author: ataradov
author_rank: Super Contributor
timestamp: March 11, 2021, 12:13:57 am
content: The solution to problem like this is to not use frameworks. In all cased it takes more lines of code to fill secondary structures for APIs than to actually fill out the registers directly.
Problem with the circuit? - Page 1
Forum section: electronics / general

author: Gowda1
author_rank: Contributor
timestamp: March 07, 2021, 09:05:01 pm
content: Hello,Could anyone please tell me what is the problem in the following circuit? Thank you.

author: Ian.M
author_rank: Super Contributor
timestamp: March 07, 2021, 09:16:18 pm
content: There's nothing *wrong* with it, its just missing some fairly important stuff, and is *STUPID* unless LED1 has Vf>4V or min. If for acceptable brightness >25mA!

author: Gowda1
author_rank: Contributor
timestamp: March 08, 2021, 08:24:06 pm
content: Thank you for your answer. I mean what could be a problem with that?

author: Ian.M
author_rank: Super Contributor
timestamp: March 08, 2021, 08:35:05 pm
content: Well you've just deleted the circuit diagram, so I'm working from memory.If you want it to be buildable, specify component values.If the LEDs power requirements are significantly under the limits I suggested, why not power it direct from the ATtiny I/O pin (with an appropriate series resistor)?N.B. No-one here is likely to provide full solutions for anything that appears to be a student exercise. You have to do the course work for yourself to learn the skills you will need once qualified and employed. No-one wants to work with colleagues who have the paper certificate but don't have the knowledge or ability to do the job. If you are *NOT* a student undertaking a formal course of instruction, and didn't take it down because you needed to remove it before your lecturer saw it or your college's anti-plagiarism software picked it up. However, in general we are quite happy to guide you towards solving it for yourself, or even check your answers if you don't conceal the fact its a student exercise. I apologize in advance for assuming you are a student, but only *IF* you can provide any evidence of your non-student status!

author: oliviasmithh900
author_rank: Contributor
timestamp: March 08, 2021, 10:51:20 pm
content: Where's the circuit

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: March 08, 2021, 11:15:36 pm
content: Quote from: Gowda1 on March 07, 2021, 09:05:01 pmThere are no components, connections, anything.

author: Ian.M
author_rank: Super Contributor
timestamp: March 08, 2021, 11:18:38 pm
content: IIRC it was an ATtiny 10, with a +5V supply and a pullup resistor on /Reset, with PB0 driving the gate of a BSS123 N-MOSFET, with a LED + series resistor between its drain and +12V. No other components or component values were shown.
Monitor stm32 executable variables in a table in cubemonitor - Page 1
Forum section: electronics / general

author: electrotwelve
author_rank: Contributor
timestamp: March 09, 2021, 09:32:50 am
content: ST is planning to replace its ST-Studio-STM32 software with STM32CubeMonitor (for monitoring runtime variables). This is apparently based on node-red and as with all things ST, there is very sparse documentation on actually how to use this (especially for people like me who do not know node-red). They have a 'basic flow' defined that shows how to monitor variables in a chart. This works if you have just a few variables that you need to watch. With a long list, this interface is very clunky. Would anyone know how to set up a table with the list of variables in cubemonitor?

author: oliviasmithh900
author_rank: Contributor
timestamp: March 10, 2021, 01:31:16 am
content: You will find lot of videos on yout tube, I don't think anyone's going to teach you that here

author: electrotwelve
author_rank: Contributor
timestamp: March 10, 2021, 03:46:18 am
content: Can you post those links? I could find very few and those explain the very basics of setting up CubeMonitor which I'm already able to do.
ARM SOC/A64 boot initilisation. - Page 1
Forum section: electronics / general

author: TransQuinzel
author_rank: Newbie
timestamp: March 04, 2021, 12:44:07 am
content: Hello!Thanks for reading! So I have been trying to make a signal board computer based of the pine64 using the A64 SOC, I am a bit confused about initialization. From what I understand, by connecting storage to the right pins the SOC will read the data from the storage and initialize the boot files. I am not sure if it requires a custom bootloader/ flashing of something. I am kinda new to this whole SOC stuff. Any pointers? Not sure if there is some book to read or something! Also, trying to read the datasheet is a bit much... I have been struggling to understand.Thanks,Harley Godfrey

author: m k
author_rank: Super Contributor
timestamp: March 07, 2021, 09:20:26 am
content: Usually these are sort of empty first, but with bootloader, it doesn't mean they can boot, just that they can read.Like a computer without a BIOS.Then you make it read it's "BIOS" and then it can boot, if your "BIOS" can handle that boot media.
SLOW STM32F103 SPI CLOCK - Page 1
Forum section: electronics / general

author: jeet55
author_rank: Contributor
timestamp: March 06, 2021, 09:40:31 am
content: I am trying to interface a OLED LCD using spi but for some reason, the lcd is updated very slowly. I checked the spi clock its close to 166 Khz but it should be 36 Mhz.I have used mx cube for generating clock code. I am attaching the main and LCD files below.

author: bugnate
author_rank: Regular Contributor
timestamp: March 06, 2021, 07:51:36 pm
content: Quote from: jeet55 on March 06, 2021, 09:40:31 amMaximum SPI clock is 18 MHz.
ST7567 132x65  GLCD  Icon Feature -- SPI Interface - Page 1
Forum section: electronics / general

author: jpanhalt
author_rank: Super Contributor
timestamp: March 03, 2021, 10:12:18 pm
content: I am using an SPI serial LCD graphical display with the ST7567 controller (not ST7567A). It has a 65th, 1-bit row ("page 8").When I address that row, the entire screen turns on. It's called a common, "icon" row. Documentation is sparse. In fact, Google turned up no examples for its use.Does anyone have any experience with it to share?BTW, the ST7567A claims to allow reading in SPI mode. I am also interested in that, but my current project is fixed on the ST7567. An SPI interface that actually allows reading would be great. If you have used that mode, I am anxious to hear about it too.

author: amyk
author_rank: Super Contributor
timestamp: March 04, 2021, 02:27:31 am
content: That is for driving additional predefined icons on the glass, if any. If your display does not have any, and the vast majority of them don't (since these icons would be customised to a specific application), then it won't be useful.

author: jpanhalt
author_rank: Super Contributor
timestamp: March 04, 2021, 10:31:35 am
content: Thank you, now what I was seeing makes sense.Do you have any experience with the ST7567A and reading DDRAM with an SPI interface?That would be a nice combination. I have gotten quite used to the ST7567 and like its speed.
ESP32 and JTAG debugging under Windows - Page 1
Forum section: electronics / general

author: prutser
author_rank: Regular Contributor
timestamp: February 22, 2021, 09:24:30 pm
content: I have an ESP32 with the Espressif JTAG interface and try to get debugging worging using Windows (Lyra-T board with WROVER)Tried it with VSCODE using Espressif plugin, tried it using Eclipse. Both without luck, JTAG detects the device, but openOCD and GDB seem not to like each other.I do not know if I am facing an hardware issue (seems unlikely to me, since device is detected reliably).I wonder if there are any people here who actually use an ESP32 with Windows/JTAG and can confirm that it it least it can work.Any info woul be appreciated.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 24, 2021, 08:40:03 am
content: I couldn't get it working with an official Espressif dev board, talked to another embedded guy who also hadn't been able to get it working, and later another guy who couldn't get it working contacted me later to see if I'd got it working, which I hadn't.We must all be doing something wrong ... there's no way the hardware could be broken, right?

author: balage
author_rank: Regular Contributor
timestamp: February 24, 2021, 12:03:38 pm
content: Are you using the Espressif IDF? Have you made it working?I can't say anything about the JTAG because I couldn't even make the IDF working.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 28, 2021, 04:37:25 am
content: ESP-IDF works ... but even though PlatformIO supposedly provides its own copy, to get extra functionality like idf.py you may need to also install ESP-IDF separately, followingEspressif's guide. Note that this will download and install stuff from Espressif's servers, not just Github ... so probably a good idea to build this development environment in a container (good practice anyway because it lets you keep older copies for when you need to revisit old projects).

author: prutser
author_rank: Regular Contributor
timestamp: March 03, 2021, 07:18:55 pm
content: The ESP IDF I got working. Installed it using the visual studio code plugin (Windows) and I was able to build one of the example projects and flash it.I am using an official Espressif dev board, an Espressif JTAG adapter and I have not been able to get it working. And it seems I am not the only one.Even a simple command line approach (start openOCD then start GDB) did not work. Open OCD detects the device, so JTAG works and there it ends.Behaviour seems unpredictable. It looks to me that the open OCD and GDB from Espressif do not match, or are still very buggy. I could not find anyone confirming this, neither denying it. So far when asking around I only hear people having trouble using the JTAG with ESP, but could not find anyone who confirm it works. (except some Linux users maybe)
Wave Computing Rebrands to MIPS, Embraces RISC-V For Next-Gen Cores - Page 1
Forum section: electronics / general

author: brucehoult
author_rank: Super Contributor
timestamp: March 06, 2021, 01:32:45 am
content: https://abopen.com/news/wave-computing-rebrands-to-mips-risc-v/My head asplode.NanoMIPS is actually a very reasonable competitor to RISC-V, on paper, but they only made one chip using it -- for the exclusive use of Mediatek it seems -- before shutting down. The entire compiler team got laid off and the gcc patches have never been merged. The only thing it really had that RISC-V doesn't is 48 bit instructions, especially ones to load a 32 bit constant with a single instruction. That's likely to be the first 48 bit instruction RISC-V adds if the general mass of implementors can be persuaded the additional complexity of another instruction length is worth it for a pretty minor gain. Huawei, at least, already has that as a custom extension.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 06, 2021, 01:41:55 am
content: Yes, some discussion started here:https://www.eevblog.com/forum/microcontrollers/mips-is-back/
problem in RTC ALARM - Page 1
Forum section: electronics / general

author: tariq
author_rank: Contributor
timestamp: March 01, 2021, 08:35:00 am
content: hi everyoneI'm usig stm32f103 and code below to set rtc alarm every one hourRTC_Alarm_Time.Alarm = 1;RTC_Alarm_Time.AlarmTime.Hours=RTC_Time.Hours+1;if (RTC_Alarm_Time.AlarmTime.Hours>23){RTC_Alarm_Time.AlarmTime.Hours=0;}RTC_Alarm_Time.AlarmTime.Hours=RTC_Time.Hours;RTC_Alarm_Time.AlarmTime.Minutes=RTC_Time.Minutes;RTC_Alarm_Time.AlarmTime.Seconds=RTC_Time.Seconds;HAL_RTC_SetAlarm_IT(&hrtc, &RTC_Alarm_Time, RTC_FORMAT_BIN);my problem is that alarm skips hour zero and after hour 23 it goes to hour 1.I don't know maybe because when i set alarm hour to 0 RTC date is still previous day.I'm using stm32f103 so in my library i can't define alarm Mask that ignores date in alarms.appreciate your help.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 03, 2021, 05:40:40 pm
content: A quick look at your code seems to show there is basic programming problem.If you don't have a debugger at disposal, try to execute "by hand" your code on paper (it's small so it'll be simple and fast to do.)You'll see what your problems are.I can see at least two. But the most obvious one is that you first increment 'TC_Alarm_Time.AlarmTime.Hours' (and wrap it around for 24 hours), but then you set it 'RTC_Time.Hours' (which I assume is the current time?), so your incremented value is just lost.Code:RTC_Alarm_Time.AlarmTime.Hours=RTC_Time.Hours;
I am looking for a simulator to simulate ADC, UART, LCD related codes of PIC32 - Page 1
Forum section: electronics / general

author: abrarbaig
author_rank: Contributor
timestamp: March 06, 2021, 02:08:41 pm
content: I am looking for a simulator, for educational purpose, to simulate ADC, UART, LCD, etc related codes of PIC32MX family microcontrllers. Anyone can help???

author: voltsandjolts
author_rank: Unknown
timestamp: March 06, 2021, 02:15:55 pm
content: Don't bother with simulators.Just buy a development board.

author: abrarbaig
author_rank: Contributor
timestamp: March 06, 2021, 02:25:59 pm
content: Tanks for your reply. I have explorer16 development board. I am an educator. I want to use simulator for students to perform their exercise without the Dev. board

author: abrarbaig
author_rank: Contributor
timestamp: March 06, 2021, 02:32:27 pm
content: Microchip's MpLab XIDE has built-in simulator. I have used to to simulate I/Os Timers, Interrupts,, Output Compare modules of PIC32

author: voltsandjolts
author_rank: Unknown
timestamp: March 06, 2021, 02:34:23 pm
content: How many students = number of development boards requiredSeriously, it's much more engaging seeing real hardware react to your code.Cost? How much does your institution make out of each student?

author: abrarbaig
author_rank: Contributor
timestamp: March 06, 2021, 02:40:49 pm
content: I have no control over it

author: abrarbaig
author_rank: Contributor
timestamp: March 06, 2021, 02:46:21 pm
content: Its Saudi Arabia. Students get free education.

author: voltsandjolts
author_rank: Unknown
timestamp: March 06, 2021, 02:53:16 pm
content: Nice.That's great for them....and great for your institution - guaranteed income from the government.

author: oliviasmithh900
author_rank: Contributor
timestamp: March 07, 2021, 01:10:56 am
content: You should go with Proteus Simulator, its best for simulating codes and it has PIC Microcontrollers in its database.

author: abrarbaig
author_rank: Contributor
timestamp: March 08, 2021, 07:21:52 am
content: I have tried it as well. As of I know, it does not support PIC32 MCUs

author: oliviasmithh900
author_rank: Contributor
timestamp: March 08, 2021, 11:01:30 pm
content: Ahan, I have simulated 8 bit PIC i.e. PIC18f452 etc in Proteus 7, I think if you check for its latest version, you may find support for PIC32.
Forth on the Pico RP2040 board, latest pre-release available - Page 1
Forum section: electronics / general

author: techman-001
author_rank: Frequent Contributor
timestamp: February 22, 2021, 03:27:46 am
content: The latest pre-release is available for Mecrisp-Stellaris-Pico Forth users.https://sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/mecrisp-stellaris-pico-22022021.tar.gzChangelog:----------------Compiletoflash is now persistent.

author: techman-001
author_rank: Frequent Contributor
timestamp: February 27, 2021, 08:38:35 am
content: Mecrisp-Stellaris official release now out:https://sourceforge.net/projects/mecrisp/files/mecrisp-stellaris-2.5.6.tar.gz
Replace the smd oscillator with a crystal. - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: February 26, 2021, 04:28:45 am
content: Hello.Long ago I designed a circuit with the STM32F769 microcontroller based on the EVAL board schematic that uses a 25Mhz crystal for the oscillator.Now I see that the STM32H747 is available, and that it seems pin-to-pin compatible using the same LQFP208 package, so I want to try to replace it directly on the board.However in the Discovery board schematic with the STM32H747 they use an SMD oscillator instead of a crystal.My question is if I can replace the SMD oscillator with a crystal, based on the attached diagrams, and it will work the same without modifying the software configuration. Unfortunately the source I relied on for the STM32CubeIDE examples is not made with Cube to define the oscillator settings, so it won't be that straightforward if I really need to change it.I don't know why ST has not done all the examples using Cube, I also work with NXP using MCUXpresso and always in all sources the oscillator and peripherals can be configured graphically with the ConfigTools integrated in the IDE, but in the ST IDE if the project was not created with Cube everything has to be modified by hand on the sources.

author: bugnate
author_rank: Regular Contributor
timestamp: February 26, 2021, 07:49:00 am
content: There would be a difference in the software configuration. Using the oscillator typically requires the HSE set to bypass mode, but this will not work with the crystal. This ends up being a very minor change but will probably block you or you are at least stuck with HSI clock source until fixed.

author: luiHS
author_rank: Frequent Contributor
timestamp: February 26, 2021, 07:57:00 am
content: Thanks.Since I haven't worked with STM32s for a long time, the only thing I can think of to do is create two projects with Cube, one with crystal and one with external SMD oscillator. And then see how the sources have been created to see what I have to modify in my project.I think the clock setting using Cube is very similar to MCUXpresso for NXPs.

author: luiHS
author_rank: Frequent Contributor
timestamp: February 26, 2021, 08:12:31 am
content: I've been looking at Cube for the clock setting, and I'm assuming it's the HSE seen in the attached screenshots, where it can be set between external clock signal or crystal / resonator.What I don't understand is why it gives me a conflict notice when activating the HSE and also the SD1 card holder. If I activate the SD2 card holder there is no conflict.

author: bugnate
author_rank: Regular Contributor
timestamp: February 26, 2021, 08:18:11 pm
content: Conflict only applies to the portions highlighted in magenta. Presumably they are pin conflicts. (*glances at datasheet, they are*). If you are not using those 2 functions (MCO2 and I2S_CKIN) you don't actually have a problem and can safely ignore. These particular warnings do seem a bit spurious on the part of CubeMX.
CAN on SAMC21J18A ASF4 - Page 1
Forum section: electronics / general

author: chayma
author_rank: Newbie
timestamp: February 26, 2021, 10:23:02 am
content: Hello everyone,I am working on CAN under SAMC21J18A using the asf4.The generated code using Atmel start is not working.Could anyone have an idea?Thank you in advance.Best regards,

author: Simon
author_rank: Unknown
timestamp: February 26, 2021, 05:03:50 pm
content: Please do not double post. it really annoys everyone, and they write in.....I gave up with ASF early on, non of it made sense and you still need to know the chip to understand the code at which point you should be able to just write code for the chip.
Bluetooth problem - Page 1
Forum section: electronics / general

author: sarose
author_rank: Newbie
timestamp: February 17, 2021, 02:27:17 am
content: I have used 5 Oled for displaying 5 different sensor values. It was working fine but when i wanted to use bluetooth, one Oled which is connected to GPIO pins 01 and 03 is not working and other 4 Oled are working. If i keep bluetooth code that oled wont work and if i again dump another code which donot include bluetooth then all oled is working. Why it is happening? What may be the problem?I have shown pins that i have used for Oled(SDA , SCL) and Sensors(S0-S4) in image below.

author: sarose
author_rank: Newbie
timestamp: February 17, 2021, 05:58:45 am
content: Quote from: sarose on February 17, 2021, 02:27:17 am

author: DrG
author_rank: Super Contributor
timestamp: February 28, 2021, 06:12:45 pm
content: That's interesting.Some GPIOs change its state to HIGH or output PWM signals at boot or reset. This means that if you have outputs connected to these GPIOs you may get unexpected results when the ESP32 resets or boots.https://randomnerdtutorials.com/esp32-pinout-reference-gpios/GPIO01 and GPIO03 are in that group. Of course, you are not resetting or booting - but maybe they are changing when you start BLE. Can you remove the affected OLED and monitor those two pins and see if they change when you start BLE? That might yield some good information.Hope it helps...
Raspberry Pi4  3.3V source - Page 1
Forum section: electronics / general

author: IconicPCB
author_rank: Super Contributor
timestamp: February 17, 2021, 12:39:06 am
content: I have no experience with Raspberry Pi4 at all.Have been asked to look into a hat issue.I went to the raspberry resources, had a look at the schematic and I think the ARM chip generates 3.3V onboard as there is no 3.3V regulator on the PCB.Have tried to locate the data sheet for the BCM2711 to ascertain this... but no joy.If there is anyone out there familiar with RPi4 and BCM2711 please enlighten me.

author: langwadt
author_rank: Super Contributor
timestamp: February 17, 2021, 12:52:18 am
content: https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_4b_4p0_reduced.pdfU2

author: IconicPCB
author_rank: Super Contributor
timestamp: February 17, 2021, 12:58:32 am
content: Thanks Langwadt,I had visited this schematic and as noted in the first posting it seems to me that the 3.3V supply is generated onboard the SOC.I hope to get a confirmation of this as well as the specification on the 3.3V supply.

author: Monkeh
author_rank: Super Contributor
timestamp: February 17, 2021, 01:10:21 am
content: Quote from: IconicPCB on February 17, 2021, 12:58:32 amNo, it's.. generated by U2. U2 is not the SoC.https://www.maxlinear.com/ds/mxl7704.pdf

author: IconicPCB
author_rank: Super Contributor
timestamp: February 17, 2021, 01:27:04 am
content: Monkeh,Thank You.This is exactly what I needed.I am in Your debt.
Embedded C++ general purpose "Debug" class? - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: February 09, 2021, 07:11:35 pm
content: Hi,Through the years I have been writing my own debug code when needed but I have been wondering whether there are some general-purpose "debug" classes which implement common debug functionality including things like logging?Just so I can get some ideas of how other people do it and even functionality I might have not thought of.Thank you

author: dkonigs
author_rank: Regular Contributor
timestamp: February 14, 2021, 10:50:29 pm
content: I mostly do embedded work in C, but the needs are likely similar.I tried asking about the logging functionality part once, only to get a lot of people completely misunderstanding the question and offering advice that wasn't entirely helpful:https://www.eevblog.com/forum/microcontrollers/stm32-logging-library-choices/The best choices I've come across there were to port the logging code from the ESP32 ESP-IDF framework:https://github.com/espressif/esp-idf/tree/master/components/logOr this other small project called EasyLogger:https://github.com/armink/EasyLoggerI'm curious about the other items you're thinking of, even if I'm not entirely sure what they are. I love some of the debugging features built into the ESP-IDF framework (such as useful crash messages that often include a backtrace and possibly even core dumps). It would be very useful to port such things to other platforms.

author: ricko_uk
author_rank: Super Contributor
timestamp: February 17, 2021, 12:56:17 am
content: Thank you dkonigs, very useful!
Could not stop Cortex-M device! Please check the JTAG cable error - Page 1
Forum section: electronics / general

author: tariq
author_rank: Contributor
timestamp: February 13, 2021, 12:43:54 pm
content: hi everyoneI'm using stm32F103RBT6 and st-link v2 programmer and keil 5.when i want to program micro i have Could not stop Cortex-M device! Please check the JTAG cable error.in my board I did not have this error and I programmed micro without any problems. this error suddenly appeared and never solved.in my debug setting it finds micro as the photo attached.i tried this steps but still i have same error :checked connection between micro and programmer and it was OK.checked micro power and it was correct. it was 3.36v.tried connect under reset and normal but it was the same error for both.reduced clock in debug tab to 1Mhz.i though my micro was broken and changed micro with the same new one but i still have same error.i dont know why this error came. i have another board like this board and it is programming successfully but this board has this error.can anyone help me?appreciate your help

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 13, 2021, 06:24:11 pm
content: If you don't have a problem with another such board, then obviously you need to look for the problem of tracks and power quality, not toluo 3.3 V, but its reliability.

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 15, 2021, 12:04:06 pm
content: Is debug/SWD enabled in the final firmware? It's a common mistake. Force reset method to software.
PB2 output on ATtiny25 doesn't work - Page 1
Forum section: electronics / general

author: FrankBuss
author_rank: Unknown
timestamp: February 19, 2021, 06:08:51 am
content: I have the following source code, running in Microchip Studio:Code:#include <avr/io.h>// PB2 doesn't work#define TEST_PORT (1 << 2)// PB3 for example works//#define TEST_PORT (1 << 3)int main(void){// set port to outputDDRB |= TEST_PORT;while (1) {// toggle portPINB = TEST_PORT;}return 0;}I can measure a frequency of 165 kHz at PB3 (with (1 << 3)), but when I try this with PB2, the output is constant low. Do I need to set any other register?

author: sleemanj
author_rank: Super Contributor
timestamp: February 19, 2021, 06:45:52 am
content: Disconnected the programmer?

author: FrankBuss
author_rank: Unknown
timestamp: February 19, 2021, 10:02:26 am
content: Programmer was disconnected. I built a special test setup with some pin headers / sockets, so that I can switch from programmer to an Arduino for resetting the fuses, because the PICKit 4 can't do it, and for measuring the sleep current more exactly (is higher with programmer connected). Got confused with all the cables. Works now, I was measuring the wrong pin. Maybe I should use more colors for my breadboard wires

author: Psi
author_rank: Super Contributor
timestamp: February 19, 2021, 10:41:00 am
content: Quote from: FrankBuss on February 19, 2021, 06:08:51 amPIN(X) is for reading an input. It's a read only register. So I don't get what PINB = TEST_PORT is doingPORT(X) is for writing an output (or enabling pullup if the pin is set as input)

author: sleemanj
author_rank: Super Contributor
timestamp: February 19, 2021, 10:42:52 am
content: Quote from: Psi on February 19, 2021, 10:41:00 amWriting to PIN(X) toggles the pin, on most AVR8.Quote from: datasheet

author: Psi
author_rank: Super Contributor
timestamp: February 19, 2021, 11:03:38 am
content: cool, I never knew that.

author: FrankBuss
author_rank: Unknown
timestamp: February 19, 2021, 11:27:16 am
content: PS: current consumption is really low. I measure 5 μA in sleep mode at 4 V, where only the watchdog is running, and some interrupts on pin changes are configured. When the watchdog resets the system (every 8 seconds to keep the system stable), it needs 60 μA, running from the internal 128 kHz clock, with the clock divided by 8, resulting in a 16 kHz CPU clock. I can even let it run slower, the divider can be set up to 256 in software, but then the delay function gets inaccurate and other parts of the program need too much time. Waking up and going to sleep again needs about 2 ms. Enabling the brownout detection (which I don't need for this application), adds about 20 μA in sleep mode, and more when running. With a small 600 mAh accumulator, this can sleep now for years 🛌 💤
Question about 2732A - Page 1
Forum section: electronics / general

author: bastian94
author_rank: Newbie
timestamp: October 12, 2020, 07:36:36 am
content: Hello,.I am loking for 2732A eprom. What i can find on the internet is m2732a and what i can not figuer out if there is any difference betwen them or if i can use the m2732a insted of the 2732a

author: Andy Watson
author_rank: Super Contributor
timestamp: October 12, 2020, 09:56:39 am
content: Should be fine. Is there more information on the chips - for example, a suffix to the part number that gives their speed rating?

author: mon2
author_rank: Frequent Contributor
timestamp: February 12, 2021, 11:10:26 pm
content: Understand this is an old thread but for future readers, it is trivial to purchase an updated of such components to replace the older UV erasable devices.For example, TMS27C64 (UV) can be replaced with the AT28C64 series - just buy watch the access speed of the component. That is, -15 = 150ns access, etc. - buy the faster versions when in doubt.So you will have to READ in the old UV device into your programmer's memory -> select the AT28C64, etc. -> program into the new device and use.
Where does f_write store data - Page 1
Forum section: electronics / general

author: zer0c00l
author_rank: Contributor
timestamp: February 10, 2021, 05:53:38 pm
content: I am using FatFS library with an LPC2368 MCU to store data 8 times per second on an industrial grade 2GB microSD card. I use f_write to store the data with ocassional f_sync every 30 minutes. The file is closed using f_close when the user stops logging. Everything works normally. My question is on the working of f_write. I have read that fwrite (the normal linux equivalent) writes data to a buffer, and only writes to a disk on fsync or fclose. I can understand that model because computer have large amounts of ram and fwrite probably saves data to a buffer in memory and when an fsync is done it stores that data to the harddrive/ssd. But how does this model work with microcontrollers?. Using Elm Chan FatFS library if I keep on writing using f_write, and never f_sync, the file on the sdcard never gets updated with the latest data. Where is the data going in this case?. The MCU don't really have large amounts of RAM to buffer this data. Is it still writing to the sdcard, but not updating the file system to reflect the change?, and only updaing it on f_sync/f_close?. I set up a test where the data being written was also being sent to the terminal, and after recording 200MB of data I stopped but did not f_sync or f_close. The file on the SD card was empty. Where did the 200MB of data go?. Clearly the MCU doesn't have 200MB or ram to buffer it.

author: nctnico
author_rank: Super Contributor
timestamp: February 10, 2021, 06:05:15 pm
content: The data is likely on the SD card but the FAT isn't updated. AFAIK FatFS does no buffering at all and so I have implemented my own buffering when using FatFS to write small chunks of data in order to prevent wear of the SD card. If FatFS uses a buffer then it needs some way to allocate it and IIRC it doesn't have a way to do it. Not updating to the FAT for every write is a good precaution because the FAT area is written often and since SDs cards have no wear levelling the sectors containing the FAT will wear out the soonest.

author: Foxxz
author_rank: Regular Contributor
timestamp: February 10, 2021, 08:03:52 pm
content: Quote from: nctnico on February 10, 2021, 06:05:15 pmI was going to suggest this same approach. Allocate your own buffer and keep track of how full it is and if the next write will overflow it. If so, f_write your buffer, reset it to zero, and put the new data into it.
WZ5500 - Page 1
Forum section: electronics / general

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 08, 2021, 11:56:01 am
content: Hello, friends!Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?

author: nctnico
author_rank: Super Contributor
timestamp: February 08, 2021, 03:10:01 pm
content: Quote from: S. Petrukhin on February 08, 2021, 11:56:01 amIn general: You can't. A port can only be handled by one socket.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 08, 2021, 04:10:59 pm
content: Quote from: nctnico on February 08, 2021, 03:10:01 pmIt's sad... A small web server will not work on it...

author: nctnico
author_rank: Super Contributor
timestamp: February 08, 2021, 04:17:29 pm
content: Quote from: S. Petrukhin on February 08, 2021, 04:10:59 pmOfcourse it will. The way it works that each connection get's in own socket at the time it comes in and the connection will be handled on that (new) socket while the original socket keeps listening for new incoming connections. Just look for out a basic (multi client) telnet server example.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 08, 2021, 04:46:07 pm
content: You just wrote:Quote from: nctnico on February 08, 2021, 03:10:01 pm

author: ejeffrey
author_rank: Super Contributor
timestamp: February 08, 2021, 09:13:34 pm
content: Quote from: S. Petrukhin on February 08, 2021, 11:56:01 amYes. If you configure two or more sockets to listen on the same port they will both work. Incoming connections will be assigned to the first available socket. If they are all full, the client will get a connection refused error.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 08, 2021, 09:19:37 pm
content: Quote from: ejeffrey on February 08, 2021, 09:13:34 pmThank you, Ejeffrey!

author: ejeffrey
author_rank: Super Contributor
timestamp: February 08, 2021, 09:20:20 pm
content: Quote from: nctnico on February 08, 2021, 04:17:29 pmThis is not how the wiznet API works. They have an API that is similar to but not the same as berkley sockets.They do not have a separation between "listen" and "accept" sockets. Rather, you configure a socket in listen mode. When a connection comes in, the listen socket transitions to the accepted state and you use it to communicate. It does not allocate a new socket the way normal listening sockets work. Once the connection ends you put the socket back into listen mode to wait for the next connection. In order to allow multiple simultaneous connections you need to put multiple sockets in the listen state.

author: nctnico
author_rank: Super Contributor
timestamp: February 09, 2021, 12:53:17 am
content: Aha. That is different to the normal way (Berkley) sockets work indeed.
Pi Pico PIO programming. - Page 1
Forum section: electronics / general

author: hamster_nz
author_rank: Super Contributor
timestamp: February 09, 2021, 09:23:38 pm
content: I've made a start at a Raspberry Pi Pico PIO program, and it is pretty nice.My code is sending I2S audio at up to 1/2th the PIO clock rate.Thought others here might be interested in seeing that the code looks like, and how they have decided to integrate it into the wider C SDK.Code:.program pio_i2s; Output stream of bits, and add the CLK and LRCLK signals.side_set 2set x, 15 side 0jmp dropin side 0.wrap_targetleft_start: out pins, 1 side 0set x, 14 side 1left_loop: out pins, 1 side 0dropin: jmp x-- left_loop side 1right_start: out pins, 1 side 2set x, 14 side 3right_loop: out pins, 1 side 2jmp x-- right_loop side 3.wrap% c-sdk {static inline void pio_i2s_program_init(PIO pio, uint sm, uint offset, uint sdat_pin, float clk_div) {uint bclk_pin = sdat_pin+1;uint lrck_pin = sdat_pin+2;pio_gpio_init(pio, sdat_pin);pio_gpio_init(pio, lrck_pin);pio_gpio_init(pio, bclk_pin);pio_sm_set_consecutive_pindirs(pio, sm, sdat_pin, 3, true);pio_sm_config c = pio_i2s_program_get_default_config(offset);sm_config_set_out_pins(&c, sdat_pin, 1);sm_config_set_sideset_pins(&c, bclk_pin);sm_config_set_fifo_join(&c, PIO_FIFO_JOIN_TX);sm_config_set_clkdiv(&c, clk_div);sm_config_set_out_shift(&c, false, true, 32);pio_sm_init(pio, sm, offset, &c);pio_sm_set_enabled(pio, sm, true);}%}The rest of the code that drives this PIO module is from the example here:https://github.com/raspberrypi/pico-examples/blob/master/dma/channel_irq/channel_irq.cEDIT: Updated with tested code.
XC32 Assert output to a console - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: February 09, 2021, 08:36:12 pm
content: Hi,I am using XC32 compiler with a PIC32MZ and in the past I only used Assert() to halt the code because I rarely had a console output.Is it possible to create an assert() with a message to a console output?Thank you
Memory mapped registers not working - Page 1
Forum section: electronics / general

author: fabiodl
author_rank: Frequent Contributor
timestamp: January 31, 2021, 03:43:26 am
content: I am using sdcc on a 8051 compatible microcontroller (CH559).The function blinkDirect works. The function blinkList doesn't.Am I doing something dumb or should I file a bug report?

author: Whales
author_rank: Super Contributor
timestamp: January 31, 2021, 08:59:52 am
content: I'm completely lost. Why is PORT_CFG set in one function but then used in another? Where is it defined? Is SDCC giving you any warnings or errors?EDIT: last time I used SDCC (for 8051 stc parts) I had all my ports defined like this:Code:__sfr __at (0x80) P0;This may not be a standard datatype that you can use "&" on. I can't recall, check SDCC's big manual PDF

author: fabiodl
author_rank: Frequent Contributor
timestamp: January 31, 2021, 09:23:14 am
content: I checkedthisand there's no indication on why I can't take the address (neither there's anything stating that I can though)

author: abyrvalg
author_rank: Frequent Contributor
timestamp: February 01, 2021, 10:00:25 am
content: Could you also post asm/lst/rst intermediate files produced by SDCC to see what’s going on at the asm level?

author: fabiodl
author_rank: Frequent Contributor
timestamp: February 01, 2021, 11:58:02 am
content: It seems to be a common problem/missing featurehttps://github.com/atc1441/CH559sdccUSBHost/issues/3

author: fabiodl
author_rank: Frequent Contributor
timestamp: February 01, 2021, 11:59:41 am
content: I attach the asm as well.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: February 06, 2021, 01:40:54 pm
content: Ah, I see now: yourvolatile uint8_t *pointer type translates to XDATA pointer, resulting in MOVX instruction being used and the write goes to the internal RAM space instead of SFR space (the 0x80-0xFF SFR area overlaps 0x80-0xFF RAM, the difference is in instruction being used, MOVX for RAM and MOV for SFR). try adding the memory type specifier to the type declaration:volatile data uint8_t *