hybridfree/eevblog-posts huggingface dataset:
Arduino DS3121 RTC Battery backup not keeping time. - Page 1
Forum section: electronics / general

author: Flump
author_rank: Frequent Contributor
timestamp: August 14, 2020, 02:59:40 pm
content: Hello All, I am fairly new to Arduinos and programming them so am likely to need some helpwith ongoing projects, is this a good forum to ask for help on or should I find an actual Arduino one ?Project-Make a small box which has an OLED screen that displays current date, time and temperature when a button in pressed.Components-Arduino Nano (clone)DS3231 RTC with onboard temp sensor moduleFull Colour 0.95 inch SPI OLED Display SSD1331 96X64I have it all wired up on a breadboard and when I upload the program it sets the nano's time to my computers time andthe oled displays the correct temp, date and time but when you unplug the USB cable from the nano and plug it back in againit does not show the current time, instead it shows the time the usb cable was unplugged.It does however keep the correct date.I have tried 2 different 3.6v batteries in the RTC clock module, I have also checked for battery voltage on pin14 Vbat and pin15 GND and it's present.So I am not sure if I misunderstand how the battery backup is meant to work or if there a problem I cant find.Here is a few links which might be helpfulhttps://datasheets.maximintegrated.com/en/ds/DS3231.pdfhttps://www.ebay.co.uk/itm/DS3231-High-Accuracy-RTC-Real-time-clock-module-like-DS1307-Arduino-PIC-UK-STOCK/251742357740?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649https://www.ebay.co.uk/itm/Full-Colour-0-95-inch-SPI-OLED-Display-SSD1331-96X64-Arduino-ESP-UK-STOCK/254343546237?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

author: Lindley
author_rank: Regular Contributor
timestamp: August 14, 2020, 04:19:23 pm
content: Hi,When you program your Arduino, your code tells it to use the PCs time to set the DS3231.If you remove the USB lead / PC power and then connect a different PSU, the program starts again, but your instruction is to read the PC time is still in your code.So once you have completed your program on the USB cable and the RTC is running correctly you need to program again but with the line of code telling it to use the PCs time removed.Eg - something similar to this, lots of RTC routines out there, but similar code.Code:// set up, start ds3231 rtcrtc.begin();//USE SEPARATE SETRTC PROGRAM TO SET TIME BEFORE RELOADING THIS PROGRAM// AVOID USING THIS NEXT LINE OF CODE -//rtc.setDateTime(dt); //Adjust date-time as defined 'dt' above

author: Flump
author_rank: Frequent Contributor
timestamp: August 14, 2020, 05:52:14 pm
content: Hello Lindley & thank you!You hit the nail on the head, the code I was using is clock.setDateTime(__DATE__, __TIME__);so I just commented it out and reuploaded and its fine now
Looking for ADPCM and ROM compatible IC - Page 1
Forum section: electronics / general

author: mathan
author_rank: Newbie
timestamp: August 18, 2020, 09:07:26 am
content: Hi,Now I have been working on one application which requirement is store the prerecorded user audio files in the controller and one push button connected to it, whenever we push the button the stored audio file started to play and keep change for every push. meanwhile the controller should be small in size(like 16 to 20-pin QFN) and includes ADPCM codec and EEPROM for store audo file.Please let me know Is there any controller available on above configuration requirement or else any alternative approach to do above task?THANKS IN ADVANCEregards,Mathan Jeeva

author: mathan
author_rank: Newbie
timestamp: August 18, 2020, 10:22:10 am
content: Thank you for suggestion, sure I will go through this
RPi based programmer - Page 1
Forum section: electronics / general

author: rbenamotz
author_rank: Newbie
timestamp: August 12, 2020, 03:01:48 pm
content: HiI am hoping to get some feedback on some hardware / software project I had been busy with lately.It's called LEMPALEanMeanProgramming mAchineThe idea is simple: You know how it is when you want to program some micro controller?While development, you can just use Arduino or other IDE with dev board connected to the computer. But once dev is mostly done, and you place a standalone controller on a prototype board or actual PCB, now you need to program it and that is a bit of a pain - need to find the right adapter (FTDI or similar), drivers, mess with jumper wires etc.It is especially a pain when you need to program a lot of copies.LEMPA helps with his - it's a board that physically connects to Raspberry PI and together with some software and the magic of the cloud, it allows downloading and programming with a single push of a button - no need for computer.It's all open source etc. Will be happy to get some feedbackhttps://github.com/rbenamotz/LEMPA

author: rstofer
author_rank: Super Contributor
timestamp: August 12, 2020, 04:12:50 pm
content: That's a very nice project.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 12, 2020, 04:13:12 pm
content: Whoa, how did you do the misaligned chroma in that first pic? That's trippy!Tim

author: rbenamotz
author_rank: Newbie
timestamp: August 12, 2020, 04:18:36 pm
content: LOL. The original picture is ok. I guess it's a feature of this forum

author: Bud
author_rank: Super Contributor
timestamp: August 13, 2020, 10:26:02 pm
content: Quote from: rbenamotz on August 12, 2020, 03:01:48 pmCloud, eh?That does not induce enthusiasm.

author: rbenamotz
author_rank: Newbie
timestamp: August 13, 2020, 10:41:13 pm
content: Just to be clear - it is not tied to any specific cloud nor do I have a service of my own that is tied to this solution. It’s just about the capability to download firmware from any URL. Local network will also work.
Recovering a Rockchip from the manufacture's firmware update - Page 1
Forum section: electronics / general

author: Yamin
author_rank: Frequent Contributor
timestamp: August 13, 2020, 05:30:05 pm
content: Hi guys,I have posted about a faulty Guitar efx pedal which gets stuck at boot up. It has got a Radxa Rock2 SoM module (its based on the Rockchip RK3288). I thought it had something to do with the power supply but after troubleshooting I couldn’t find any obvious problem with the power rails. I am now assuming that its some kind of a firmware issue.These pedal boards have got a known issue though the manufacture’s don’t acknowledge it. Their only solution is to replace the main board. I have done so and the second board have become faulty.I would like to try and recover the Rockchip as instructed in this videoIn the video he mentions about the image file which needs to be flashed on to the device.I apologise in advance for the noob question I am about to ask:So I have downloaded the firmware update from the Guitar pedal board’s website. The bundle contains a software which is needed to update the pedal board. Anyway opening up the contents of the downloaded package I can find a file named ‘update.img’. Could I use this image file and follow the instructions in the video?Thanks in advance for the helpRadaxa Rock2 SoMhttps://wiki.radxa.com/Rock2/som

author: Yamin
author_rank: Frequent Contributor
timestamp: August 13, 2020, 05:33:39 pm
content: Here is a photo of the contents in the file
convert variable unsigned char string to float and int in keil 5 - Page 1
Forum section: electronics / general

author: tariq
author_rank: Contributor
timestamp: August 12, 2020, 11:52:13 am
content: hii want to convert array of strings to int and floatfor example my string data is :unsigned char a="24.5";float f;i want to put characters as a float to f .and Similarly for int.what should i do?and in opposite what should i do to convert int or float into unsigned char.what is their functions?Thank you very much.

author: greenpossum
author_rank: Frequent Contributor
timestamp: August 12, 2020, 11:59:14 am
content: Is the 24.5 a constant string or could it be read in as a variable. Because I'm wondering why you don't just initialise f directly, i.e. float f = 24.5f.

author: tariq
author_rank: Contributor
timestamp: August 12, 2020, 12:20:27 pm
content: no i receive my data as characters from uart unit of stm32 microcontroller by this commandHAL_UART_Receive(&huart1,data,5,1000) ;my data is variable and it is numbers in character is there any command to convert data into float?

author: MosherIV
author_rank: Super Contributor
timestamp: August 12, 2020, 01:01:48 pm
content: Look in string.h library for your compiler.Standard string library does have text number to int functions.The float version depends on your compiler implementation.

author: greenpossum
author_rank: Frequent Contributor
timestamp: August 12, 2020, 01:09:24 pm
content: Look up the strtof and strtol functions and don't forget to check for errors.

author: Howardlong
author_rank: Super Contributor
timestamp: August 12, 2020, 01:17:55 pm
content: I recommend you make the string a or a[] so it can allocate an implicit ‘\0’ termination for use with C libraries.

author: oPossum
author_rank: Super Contributor
timestamp: August 13, 2020, 08:17:52 am
content: sscanf and sprintffloat/double may not be supported or require compiler flags to enable supportThe functions used by sscanf/sprintf may be accessible (check the headers) for a more efficient implementation.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 13, 2020, 09:48:53 am
content: atof() if you have that available. Doing exactly what you ask for, and nothing more, it's more lightweight and simpler than sscanf(). sscanf() is more capable/versatile. On some targets, atof() isn't available.Good embedded compilers should have atoi, itoa, utoa, atof, ftoa etc. available because full printf/scanf family are quite big for many microcontroller targets, while just fine on general purpose desktop/mobile computing.

author: newbrain
author_rank: Super Contributor
timestamp: August 13, 2020, 02:58:11 pm
content: The drawback I can see with the atox() family is the lack of error reporting.Worse: if the string contains a value that cannot be represented in the target type, the behaviour is undefined.As the string is coming from an UART, there's no guarantee it will be correct.In this case, the strtox() functions provide a better way to check for errors.
What is state-of-the-art for driving an LED from a low voltage MCU in 2020? - Page 1
Forum section: electronics / general

author: jnz
author_rank: Frequent Contributor
timestamp: August 12, 2020, 05:31:11 pm
content: What are the modern favored methods of driving LEDs with 1.8-3.3V micros that you put into production?I have looked at almost every option I can think of. 3.3V micros, applications with one red led, or RGB, or need 10 leds with different colors at the same time. At 3.3V, blue and green become slight pain.I see pros and cons... but not really a consensus on anything.For instance, I see this chip from 2014....http://www.issi.com/WW/pdf/31FL3193.pdfIt looks fine, linear, 42mA per LED, i2c, and has a nifty "breath" function that handles the fading/pulsing for you with 4 included timers, not bad. But... I have a micro that can do that, I know C well enough to do nice LED effects at 200Hz without the rest of my program ever noticing. I don't "need" this but might if I had a far more limited chip and was using I2C anyhow. Even if I'm not using I2C currently, a part like this uses 2 micro pins if I don't use hardware standby, where an RGB uses three, in some cases it might be worth it right there.PWM with transistors, I2C chips with linear or constant current, 2-pin constant current regulators to replace series resistors, completely integrated solutions like these below.Enthusiast crowd is all over the WS2812 series, where a single 5050 package has RGB and a driving IC with a single-wire serial connection. They come up with goofball solutions to hit the 300ns short pulse. I tried some, they all seem questionable. The datasheets are INSANELY wrong. All of them. They all seem to be private branding of the same chinese LED or at least IP reselling. All the datasheets use the same pictures, and when they show a low pulse, it implies min/max with tolerance but it's actually just min, you can hold a 900ns low pulse for like 10x that long and be fine. They say it can't accept 3.3V data, it does just fine (at room temp at least). The usually don't mention quiescent current - and for good reason - they're like 2.8mA without any LEDs on. The construction with the IC inside the LED doing constant current and the serial is pretty cool though.Ex of IP or datasheet reuse... and generally nonsense values:https://optoelectronics.liteon.com/en-global/Led/LED-Component/Detail/1075https://www.mouser.com/datasheet/2/180/IN-PI554FCH_v2.4-1665238.pdfhttps://www.mouser.com/catalog/specsheets/Lumex-03-27-2020-SMD-LX5050RGB-TR.pdfSide topic, but I would guess that even 5 years ago driving blue LEDs with 3.3V was rare, and now it's definitely possible (although a little risky when you're talking 5ohm series resistor). So it seems that thereWhat are the methods you are finding most effective for pins/cost/size/complexity?
TouchGFX would stuck with SPI LCD and NO RTOS - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: August 12, 2020, 12:04:08 pm
content: Hi,I have made this very simple project, when I step into code and just change thevsync_semin debuge to 1 to force a render, The code would just call this functionCode:HAL::getInstance()->backPorchExited();and never would return, it would stuck in there, How should I resolve this issue?I expect this force a call of this functionCode:void TouchGFXHAL::flushFrameBuffer(const touchgfx::Rect& rect)Any Ideas or experience with TouchGFX with no RTOS and SPI LCD?

author: Mecanix
author_rank: Frequent Contributor
timestamp: August 12, 2020, 12:59:22 pm
content: Assuming drawing/rendering the ili9488 using a simple SPI driver works fine? Ruled out?Not yet familiar with TouchGFX myself, I still mostly draw GUIs programatically, have you tried the folks over at STM Community? Lots of advanced users/staffers there who could get you to debug this real quick. That would be the first venue I'd go for customer support (as for what TouchGfx is concerned anyway).

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: August 12, 2020, 01:17:01 pm
content: Thanks, The SPI driver is working fine, also I have asked them there, No answer yet. I hope someone here could help too.

author: Mecanix
author_rank: Frequent Contributor
timestamp: August 12, 2020, 02:37:15 pm
content: Good luck.On a side note; you aren't alone. Not that I've done a whole lot of TouchGFX but it wasn't exactly a good start and a rather miserable implementation, to a point where I've ditched it and went diy GUI. Rather new solution I understand so I'll revisit the following year when the implementations are a bit more stable, that's the hope/idea anyway.Wish I could help, although sure you or someone at STM will figure it out soon. gl again
clocking SPI for SD cards - Page 1
Forum section: electronics / general

author: Dan Moos
author_rank: Frequent Contributor
timestamp: August 09, 2020, 01:37:00 am
content: A lot of the tutorials on using SPI to talk to SD cards seem to show code that sends a 8 or so "reads" to the device before writing data.Almost always anyway. I have gotten the beginnings of an explanation here and there, but nothing really descriptive.The best I can gather is that you need to do some fake reads just to get the device a look at the clock so it can be ready when the writes come in.First, is that about right?Second, should I precede EVERY write operation with some of these pretend reads?Third, 8 reads seems common. Is that a good rule of thumb?Finally, if I'm completely wrong about the whole thing, care to set me straight?

author: fchk
author_rank: Frequent Contributor
timestamp: August 09, 2020, 03:41:20 pm
content: Just get the official standard document and look it up for yourself:https://www.sdcard.org/downloads/pls/You will need the first document "Physical Layer Simplified Specification", and SPI mode is described in section 7.fchk

author: Dan Moos
author_rank: Frequent Contributor
timestamp: August 09, 2020, 04:14:11 pm
content: Already have, and have been reading said doc. Maybe it's in there, but I can't find it. I thought maybe it was an SPI thing rather than just an SD card specific thing, but who knows.
SAMD + MPLABX - Page 1
Forum section: electronics / general

author: Evan.Cornell
author_rank: Regular Contributor
timestamp: March 27, 2020, 08:23:42 pm
content: I have MPLAB X v5.35, XC32 v2.40 installed on Win10, 64-bit.I am making a New Project -> Standalone Project -> ATSAMD21J18A -> SAM D21 Xplained Pro (EDBG) -> XC32 (v2.40) -> ProjectName. Great, project created.I make a new C main file. I add #include <xc.h>. I can CTRL+click on <xc.h>, and it opens that file ("C:\Program Files (x86)\Microchip\MPLABX\v5.35\packs\Microchip\SAMD21_DFP\3.2.90\samd21a\xc32\include\xc.h").The problem is this - when I then Ctrl+click on <samd21j18a.h> within xc.h to look at the device-specific header file, I get an error in the bottom left corner of MPLAB X that says: "Cannot open element "<samd21j18a.h>" ".Does anyone know why this is happening? I am new to Microchip world, so it may just be something easy.I have searched the xc32 install directory, and find two different samd21j18a.h files, one at "C:\Program Files\Microchip\xc32\v2.40\pic32c\include\proc\SAMD21A\pio" and another at "C:\Program Files\Microchip\xc32\v2.40\pic32c\include\proc\SAMD21A".If I manually put #define <samd21j18a.h>, the one at the not-\pio subfolder comes up when I Ctrl-click, but I believe the \pio\samd21j18a.h is the one I want for register definitions and such.

author: higheredundead
author_rank: Newbie
timestamp: August 05, 2020, 03:35:37 pm
content: Hi,did you ever find a solution to this? I just discovered that I've got the same problem since moving from XC32 v2.10 to v2.40. I've posted to the Microchip forum but haven't heard back.thanks1James

author: Evan.Cornell
author_rank: Regular Contributor
timestamp: August 05, 2020, 03:39:58 pm
content: Quote from: higheredundead on August 05, 2020, 03:35:37 pmSorry, no. The project shifted to a different, non-Microchip target.
SPI  clock phase/polarity mode for SD  cards - Page 1
Forum section: electronics / general

author: Dan Moos
author_rank: Frequent Contributor
timestamp: August 10, 2020, 03:38:19 am
content: Yes, I've been reading the documentation. Can't find any info on whatCPHA and CPOL settings to use with SD cards.

author: mikerj
author_rank: Super Contributor
timestamp: August 10, 2020, 10:20:42 am
content: SD cards use SPI mode 0 (CPHA=0, CPOL=0).
LEDs on ICD4 - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: August 05, 2020, 09:24:19 am
content: Hi,couple of questions:1) do you see any LEDs on if you plug the ICD4 ONLY to its power supply (i.e. NOT to the PC NOR to the target board)?2) any idea why an ICD4 would have the purple LEDs on constantly when connected to a PC (whether MPLAB is running or not)?Thank you

author: oPossum
author_rank: Super Contributor
timestamp: August 05, 2020, 09:45:46 am
content: 1) No2) I think it is waiting for the initial firmware download. Should change to blue in about 5 seconds if the drivers have been installed.
XC32 Compiler installation files - Which one? - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: August 02, 2020, 10:01:44 pm
content: Hi,I downloaded the following XC32 installation files:- xc32-v2.40-part-support-windows-installer.exe- xc32-v2.41-full-install-windows-installer.exeI already installed the second one "..full-install-windows-installer.exe" and it works but what is the other one for?Do I need to install that one too?Thank you

author: andersm
author_rank: Super Contributor
timestamp: August 02, 2020, 10:50:35 pm
content: As it says on the download page, the part support package "dds new device-specific information to a compiler, but does not update the base compiler."

author: ricko_uk
author_rank: Super Contributor
timestamp: August 03, 2020, 02:40:28 am
content: Thank you Andersm,It is confusing because the "part-support-windows-installer" is Version 2.40 while the one I installed is version 2.41 (i.e. newer)Does that mean that it already includes all the device specific infos of the "V2.40-part-support-windows-installer"?And in either case do I need to install what appears to be slightly older "V2.40-part-support-windows-installer"? Still confused about that part.Thank you

author: andersm
author_rank: Super Contributor
timestamp: August 03, 2020, 05:25:02 am
content: The part support installer 2.40 adds support for new parts to version 2.40 of the compiler.

author: ricko_uk
author_rank: Super Contributor
timestamp: August 03, 2020, 06:27:35 pm
content: Thank you Andersm
stm32f4 problem in fft function - Page 1
Forum section: electronics / general

author: mem2mem
author_rank: Newbie
timestamp: August 03, 2020, 06:09:35 am
content: I'm using my stm32f429 to sample 80khz of signal and implement fft by arm dsp lib. I set the dma to transfer 1024 data to adcBuffer and I plan to use this as the input of the fft function like this.arm_rfft_fast_f32(&S, adcBuffer, FFTOutput, 0);The problem is that the dma transfer data in uint16 format, but the input of the fft needs to be float. So, I'm using a loop to convert the uint16 to float, and send the converted array into the fft function.for(i=0;i<1024;i++)adcValue=(float)adcBuffer;However, this loop takes a lot of time and I'm currently sampling at 200khz. Is there any way to send uint16 array directly into the fft function, or can convert the uint16 faster than the loop?

author: Berni
author_rank: Super Contributor
timestamp: August 03, 2020, 06:34:41 am
content: The same CMSIS DSP library also has functions for doing this conversion:https://www.keil.com/pack/doc/CMSIS/DSP/html/group__q15__to__x.htmlThe actual implementation of it inside is probably the same as your code with perhaps some loop unrolling to speed it up (There are no useful SIMD instructions for this as far as i know).A bigger speed boost is using DFT symmetry to pack two real input FFTs into one complex FFT. It doesn't take much longer to compute but does compute two real FFTs in parallel.

author: mem2mem
author_rank: Newbie
timestamp: August 03, 2020, 07:55:05 am
content: Quote from: Berni on August 03, 2020, 06:34:41 amThanks, l look at the source code of the function, it did just a loop unrolling. l guess I can just unrolling my own loop.
MPLAB Harmony remote install - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: August 02, 2020, 09:37:22 pm
content: Hi,I am trying to install harmony on a PC with no internet connection at a client's place but it does not work.1) How can I install it?2) I could not find any offline installer? I could not find anyThank you
What is this IC U503? (QFN16) - Page 1
Forum section: electronics / general

author: cheon7886
author_rank: Newbie
timestamp: July 28, 2020, 08:40:40 am
content: This is the image of the part of the NVLink Bridge PCB.I recognized that U504 is STM32L031, but have no idea about U503. What is the part number of the IC?

author: Labrat101
author_rank: Unknown
timestamp: July 28, 2020, 02:05:13 pm
content: Does this helpIts hard to see from your photo how many pins ..??

author: gamalot
author_rank: Super Contributor
timestamp: July 28, 2020, 02:23:12 pm
content: STM32L031G6U6https://www.st.com/en/microcontrollers-microprocessors/stm32l031g6.html

author: thm_w
author_rank: Super Contributor
timestamp: July 28, 2020, 09:04:30 pm
content: Quote from: Labrat101 on July 28, 2020, 02:05:13 pmClose but "2003 15B2V" not 8.16 pin QFN.25MHz xtal on pins 6 and 7.MSP430 has a 2003 marking 16-VQFN, but the crystal pins don't match up:https://www.ti.com/packaging/docs/partlookup.tsp?parent=pf&partNumber=MSP430F2003TRSAT#divlineso its not that.

author: Labrat101
author_rank: Unknown
timestamp: July 28, 2020, 09:12:50 pm
content: Quote from: thm_w on July 28, 2020, 09:04:30 pmYour right. Sorry it did look like an '8' .. A better photo would have been good as well ..15B2V would make more sense ..

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 29, 2020, 05:58:33 am
content: The pairs of chips (resistors?) nearby look suspiciously like a diff pair bias/decoupling network. Perhaps it's a PCIe interface, perhaps to serial for the humble STM to talk with?25MHz is suggestive of Ethernet, but I highly doubt that little chip is a PHY, or that Ethernet would find its way here in the first place. May just be a coincidence.Wonder what they need anything on there for, but at the same time I kind of wonder how it's not exponentially more (e.g. very wide, high bandwidth bus bridges?). Presumably they've done their homework so it's not the latter, at least. Nothing on the other side, just connectors..?Tim

author: newbrain
author_rank: Super Contributor
timestamp: July 29, 2020, 08:33:08 am
content: I think it could be this one:Microchip SM802Thanks to T3sl4co1l for putting me on the right path (crystal and differential output).We all focused on the bold marking, but the chip number is below: 802356.
Would somebody be kind enough to review my STM32L476 schematic? :)  - Page 1
Forum section: electronics / general

author: 4flyer
author_rank: Contributor
timestamp: July 28, 2020, 02:26:34 pm
content: I am currently designing my first board to include a microcontroller. After referencing the hardware reference manual, the Nucleo board schematics, and other resources, this is how I got the layout. If can somebody can take a look at my schematic and make sure that I setup the MCU right, that would be very helpful! Thank you!

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 28, 2020, 03:50:54 pm
content: Could you post a larger resolution picture? Because even at full size, this one is still hard to read.From what I *could* see, there doesn't seem to be anything wrong though, except VDD decoupling. There is only one bypass cap that I could see, and (but it's hard to read) it looks like it's 15 pF?? You typically need like 100 nF. Also, you should put one bypass cap per VDD pin on the MCU (and layed out close to said pin), also including VDDA, and ideally VBAT and VDDUSB as well.Another point, less problematic, but that I still suggest: add a 100 nF cap (to ground) to the NRST pin. This pin has an internal pull-up, but adding an external cap helps making this more robust to external perturbations.

author: phil from seattle
author_rank: Super Contributor
timestamp: July 28, 2020, 04:37:08 pm
content: Agree on the bypass caps - 1 per Vdd connection. That is, I believe, an ST Microsystems recommendation.Also 32.768 MHz? The nucleo board has a socket for an 8 MHz crystal and uses a 32.768kHzcrystal.

author: asmi
author_rank: Super Contributor
timestamp: July 28, 2020, 06:01:22 pm
content: When creating a symbol for chip, I prefer to group pins by function so that I won't have Vcc or GND pins scattered all over the place. It also makes easy to ensure none of power pins are missed. Imagine 200+ pins part with power pins all around the symbol!
Defining a symbol in the MPLAB X project settings - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: July 26, 2020, 11:04:28 pm
content: Hi,In a Microchip note it says:"To suppress this warning, define the preprocessor macro _SUPPRESS_PLIB_WARNING before #include'ing a plib header file.You can define this symbol in your MPLAB X project settingsor you can use a #define _SUPPRESS_PLIB_WARNING 1 in your code before the #include directive."I looked everywhere in the settings but in the only two places where it seemed I could add a define it added 3 exclamation marks and highlighted the input in red suggesting that is not correct or possible.How/where do I define a symbol in the MPLAB X project settings?

author: DrG
author_rank: Super Contributor
timestamp: July 26, 2020, 11:58:45 pm
content: Quote from: ricko_uk on July 26, 2020, 11:04:28 pm

author: ricko_uk
author_rank: Super Contributor
timestamp: July 27, 2020, 04:30:36 am
content: Thank you DrG !:)that's where I was adding them but I was also addint " 1" at the end because that's what the documentation was saying. Now it works!Thank you
PLIB installed but not being found by MPLAB  - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: July 26, 2020, 08:54:29 pm
content: Hi,I installed MPLAB, harmony and also the lgacy PLIB on a new PC. But when I compile it gives the error below and plenty more all implying it cannot find PLIB. That is from a brand new project with not a single line written, just code generated by MPLAB.This is from ANY brand new project created by MPLAB selecting "Pic32MX C Template" and it repeats for every file generated by MPLAB which has in includes directive for the PLIBIn file included from interrupts.c:9:0:c:\program files (x86)\microchip\xc32\v2.30\pic32mx\include\lega-c\plib.h:41:30: fatal error: peripheral/adc10.h: No such file or directory#include <peripheral/adc10.h>This is from ANY brand new project created by MPLAB selecting "Pic32MX CPP Template" (instad of a C one) and it repeats for every file generated by MPLAB which has in includes directive for the PLIBexceptions.cpp:9:81: fatal error: plib.h: No such file or directory#include <plib.h> /* Include to use PIC32 peripheral libraries */How can I fix it?Thank you

author: ricko_uk
author_rank: Super Contributor
timestamp: July 26, 2020, 10:16:29 pm
content: Solved...I just had to select the latest installation folder for the compiler instead of the default one
ST32H745ZI ADC samplerate - Page 1
Forum section: electronics / general

author: paul002
author_rank: Regular Contributor
timestamp: July 25, 2020, 02:09:38 pm
content: I am busy with porting a sdr example to the stm32h745zi (https://www.i2phd.org/armradio/index.html) the source code cannot be used one on one because of HAL changes and the specifics of the stm32h745zi which is multicore. I have now more or less all the peripherals working and use freertos for background processing. But when I use cubemx the set the ADC clock I cannot relate the clock frequency to the sample rate. The datasheet tells me that 12bits gives you 6.5 clock cycles + 1.5 clock cycle for the channel. (The prescaler is set to 1) but then I expect the sample rate to be Fadc / 8. But I don't get near that rate. I have now a 30 Mhz ADC clock giving me about 1.88 MPS (on a nucleo 144) the chip is LQFP144 so it maximimum rate is reduced max 3.5 MPS and a max clock of 29Mhz (single adc). I have configured the adc to use pll3 generating 30Mhz

author: iMo
author_rank: Super Contributor
timestamp: July 25, 2020, 03:50:47 pm
content: Could it be related to this?https://www.eevblog.com/forum/microcontrollers/stm32h7-adc-performance-ya-gotta-read-the-fine-print!/

author: paul002
author_rank: Regular Contributor
timestamp: July 25, 2020, 04:11:19 pm
content: Yes there is a relation, but I have read the, app note AN5354, there is where my information on the number of clock cycles come from and the stm32h745 datasheet. But they all tell me (at least what I belief) that you have to divide by 8 (for 12 bits ADC config) keep in mind the prescaler. I found one item which i did not take care of. That is that the nucleo board HSE clock is set to 8 Mhz and in CubeMX you have to conigure this, bit strange because the default value is 8 Mhz. But that did not make any difference. So I am still a bit puzzled how to exact know the sample rate I am using. I now toggle a bit after the DMA of 512 samples are delivered by DMA with a ADC clock speed of 33.3333 Mhz I have a time of 245 uS for 512 12 bits samples give me about 2.084 M/ps. But I need to know exact to be able to decimate to the right sample rate for audio later.

author: iMo
author_rank: Super Contributor
timestamp: July 25, 2020, 05:46:08 pm
content: Load the input of the ADC with a voltage, ie 1-2V through a resistor divider, ie 100ohm/100ohm and look at the ADC input with an oscilloscope.You could see small ripples at the ADC's input when the ADC's Sample/Hold connects the internal S/H capacitor to the resistor..The period of the ripples gives you the ADC_sampling_frequency..

author: paul002
author_rank: Regular Contributor
timestamp: July 25, 2020, 08:01:40 pm
content: Good idea, will try

author: iMo
author_rank: Super Contributor
timestamp: July 26, 2020, 12:44:50 pm
content: I would expect something like this (+/- 100%):
Are STM STR751 / STR912 still good for anything? - Page 1
Forum section: electronics / general

author: Unixon
author_rank: Frequent Contributor
timestamp: July 27, 2020, 06:30:11 pm
content: Since long time ago I have a few pieces of STR751FR2T6 (ARM7TDMI) and STR912FAW46X6 (ARM966E-S) laying around.I've bought these in a sale out of pure curiosity but never got my hands around to actually make any hardware.I wonder if it worth building something with them or would it be a complete waste of time now when there's whole lineage of STM32 series and CubeMX/HAL support?I know that ARM966E-S is another league in terms of architecture to C-Mx and it is probably wrong to make a direct comparison to latest STM32F/H MCUs.Any ideas? Maybe some useful OSHW project worth building?MCUs themselves are pretty beefy, but I'm kind of afraid that writing firmware for them without libraries like STM32HAL will be a nightmare.

author: ataradov
author_rank: Super Contributor
timestamp: July 27, 2020, 07:53:03 pm
content: It would be a waste of time even if software support was there. It just makes no sense to use those old devices in new projects unless they have some specific feature you don't have with modern devices (but that's unlikely).

author: Unixon
author_rank: Frequent Contributor
timestamp: July 28, 2020, 09:00:12 am
content: Quote from: ataradov on July 27, 2020, 07:53:03 pmBy the way, original firmware library sources look very much like ancestors of SPL or modern HAL, so maybe it is not all that hard to get these MCUs running.However, you're totally right about their age. I just thought it might me better to finally put them into work rather than just trowing them away or forgetting of their existence.

author: ataradov
author_rank: Super Contributor
timestamp: July 28, 2020, 09:03:36 am
content: Sometimes it is easier and cheaper to throw them away and cut your loses.

author: Unixon
author_rank: Frequent Contributor
timestamp: July 28, 2020, 09:10:06 am
content: Quote from: ataradov on July 28, 2020, 09:03:36 amAgree. Sad, but true.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: July 29, 2020, 09:48:59 am
content: you can open them and take a loot at their dies
ADC 7921 - Page 1
Forum section: electronics / general

author: lorenrus
author_rank: Regular Contributor
timestamp: July 24, 2020, 08:44:45 am
content: Hello everyoneI have to use ADC AD7921.It is manageable through the SPI device. It is equipped with two analog inputs that can be selected by manipulating a MUX, through SPI.By default, the Vin0 signal is enabled on the exit from the MUX, which I read correctly with the code I attach.One thing I noticed is that if I decrease the freq I read incorrect values, and this thing is not clear to me since on the datasheet, p. 7, I find a Freq rage from 10 khz to 5 Mhz. What am I wrong?Further, he goes to sample in and out on the fall.On my uC which is a SAMD21 I selected mode 3.The data that he sends me I receive correctly with mode 3 because, even looking at the time digram, page 7, he samples the DOUT on the falling and I on the uC I read it on the first positive front.But instead when I send from the uC, always with mode 3, they field on the FALLING and also the ADC on the DIN samples on the FALLING. Could that be the problem?I attach the code separately to send the channel value.Ulteriore cosa è che guardando il diagramma temporale di pagina 8 si vede che richiede 16 colpi di clock per eseguire tutta la comunicazione; come faccio a far risultare esattamente questo numero di colpi di clock ?Thank youCode:SPISettings SPI_Settings_Test_14(5000000, MSBFIRST, SPI_MODE3);void setup() {Serial.begin(115200);}void loop() {// SPI ACTIVEDSPI.begin();// BUS SPI ACTIVEDSPI.beginTransaction(SPI_Settings_Test_14);// SLAVE ACTIVEDdigitalWrite(FPGA_CS_VOLT_NEG, LOW);SPI_Received_Value_BATT_480_VOLT = SPI.transfer16(0);// SLAVE DISABLEDdigitalWrite(FPGA_CS_VOLT_NEG, HIGH);Serial.println(SPI_Received_Value_BATT_480_VOLT, BIN);// BUS SPI DISABLEDSPI.endTransaction();// SPISPI.end();float Voltage = SPI_Received_Value_BATT_480_VOLT * (5.2/4096);}Code:// SEND DATA -- CHANNEL VALUE// ABILITO LA COMUNICAZIIONE SPISPI.begin();// ABILITO IL BUS SPISPI.beginTransaction(SPI_Settings_Test_14);// ATTIVO LO SLAVEdigitalWrite(FPGA_CS_VOLT_NEG, LOW);SPI.transfer16(001000000000000); pag 17// DISATTIVO LO SLAVEdigitalWrite(FPGA_CS_VOLT_NEG, HIGH);SPI.endTransaction();SPI.end();
STM32F1 USB Not Working - Page 1
Forum section: electronics / general

author: ipek.grgc
author_rank: Contributor
timestamp: June 28, 2020, 10:31:05 am
content: Hello,I am currently working on my own stm32f103C8 board. I am using it with arduino ide, stm32duino.I can upload and run codes with a serial port, using USB to TTL converter. But when I try the same with the USB, its not working, my laptop's USB port cant see the board. To figure out if i am doing anything wrong with the boot loading, connections, cables etc I have tried the same steps with a blue pill board and it works fine over USB.I attached the usb schematic and layout.Thanks a lot.Additional Notes:*I tried 10K, 5K and 1K resistors for the USBD_P pullup resistor R13.*I accidentally fed the circuit through its 3V3 power input with a 5V, for a little long time, serial works but maybe the stm32's USB pins burned?*USBD_N is connected to PA11 and USBD_P is connected to PA12

author: phil from seattle
author_rank: Super Contributor
timestamp: June 29, 2020, 12:02:59 am
content: I don't know if this matters but generally the ID pin is connected to ground.

author: eliocor
author_rank: Unknown
timestamp: June 29, 2020, 06:00:02 am
content: As a working example, take a look at the Maple Mini schematics:https://github.com/leaflabs/maplemini/blob/master/maplemini.pdfsee also:https://kwagjj.wordpress.com/2016/10/18/maple-ministm32f103cbt6-usb-example-not-working-not-even-recognized/https://os.mbed.com/users/hudakz/code/MapleMini_USBSerial/

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 23, 2020, 08:22:16 pm
content: Quote from: ipek.grgc on June 28, 2020, 10:31:05 amThis resistor is not "optional". It should be 1k5 (from memory) according to the USB specification.Do you've got some "Blue Pill" boards? Apart from the wrong value for that resistor (often it's 10k on the PCB) they do seem to work for me, inclusive USB.My knowledge of USB is ... pretty limited. I did run:https://github.com/satoshinm/pill_serialon it. and it adds 3 serial ports to USB. Fun test program, and can be put to other uses too.

author: Macbeth
author_rank: Super Contributor
timestamp: July 23, 2020, 08:35:45 pm
content: It's a complete fake. Do not bother with it anymore and just get a non-fake "Bluepill" instead. (Easier said than done).It is fucking amazing how the CHY-NA go to such ludicrous levels of fakery, but there you go.

author: profdc9
author_rank: Frequent Contributor
timestamp: July 23, 2020, 08:57:06 pm
content: You need a crystal with the STM32F1 to get reliable enough timing for USB, for example, a 8 MHz crystal from which the 48 MHz USB clock is derived by a 6X PLL. The built-in RC oscillator isn't stable enough for USB.
ST Advanced Timer input multiplexer handicap rant - Page 1
Forum section: electronics / general

author: uer166
author_rank: Super Contributor
timestamp: July 22, 2020, 10:42:36 pm
content: Why oh why did you guys route internal comparator outputs to only channel1 (see attachment).What I need is a simple cycle-by-cycle limited PWM on channel 1 of Advanced Timer 1. And when it's cycle is reset short via the clear input, I want to capture the point where that happened. Somehow this is possible with basic timers, but not the advanced timers where the input capture multiplexors aren't connected to anything but external pins. Good job on plopping some nice IP and forgetting to connect it to on-chip peripherals.

author: uer166
author_rank: Super Contributor
timestamp: July 22, 2020, 10:47:25 pm
content: Doing something like the following, essentially re-routing input capture from CCR1 to CCR2 while keeping CCR1 in PWM output mode would work as well. Unfortunately Cube doesn't allow that, so not sure if their software limitation or there is some hardware mutual exclusion that makes this impossible..
[SOLVED] USART0 on Arduino Uno just sending garbage - Page 1
Forum section: electronics / general

author: ksoviero
author_rank: Contributor
timestamp: July 18, 2020, 04:57:22 pm
content: Hi all,I've been using the Arduino libraries for a while now, but I want to start making my own projects that use MCUs directly rather than relying on the Arduino libraries. The first thing I'm trying to do is get USART0 up and running so that I can use it to debug everything else.Here's the code I have so far:Code:#include <avr/io.h>#include <util/delay.h>#define BAUD 9600#define UBRR ((F_CPU / (16UL * BAUD)) - 1)int main() {UBRR0H = UBRR >> 8;UBRR0L = UBRR;UCSR0B = 1 << TXEN0;while (true) {unsigned char data[] = "Hello\r\n";for (int i; data != 0; ++i) {while (!( UCSR0A & (1 << UDRE0)));UDR0 = data;}}}And (a truncated version of) what I'm getting back:Code:o��M�y�_�ӏ�a����'��%�~��{['�P�L�␋�Dx���}�����|c␎��Things I've tried so far:- I've tried implementing a delay per some forum posts I found, but I still get garbage, just... slower.- Tried explicitly setting UCSR0C to 0x06, same result.- Also tried explicit setting F_CPU to 16000000, no dice.I'm also developing this using PlatformIO on VS Code, just in case that affects things.Any help would be greatly appreciated.Oh, and just to be clear, this is an Arduino Uno, connected over USB.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 18, 2020, 05:06:05 pm
content: You are not initializing i to 0. You are over- or underindexing data, reading from random memory locations.

author: ksoviero
author_rank: Contributor
timestamp: July 18, 2020, 05:14:06 pm
content: Quote from: Siwastaja on July 18, 2020, 05:06:05 pmWell... shit. It works now. That was obvious in hindsight.Thanks for the help!

author: Siwastaja
author_rank: Super Contributor
timestamp: July 19, 2020, 07:44:33 am
content: Add -Wall to the compiler command line (assuming GCC). You will get compiler warning from this kind of obvious mistake. It happens even to more experienced.

author: newbrain
author_rank: Super Contributor
timestamp: July 21, 2020, 12:23:49 pm
content: Quote from: Siwastaja on July 19, 2020, 07:44:33 amThis is good advice, and I would also add-Wextrato get warning for some more sublte traps for young (and old) players, such signed/unisgned compares.
EXTREMELY long time to compile - MPLAB XC32 - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: August 04, 2020, 05:01:10 pm
content: Hi,I downloaded and installed the latest MPLAB (V 5.40) and XC32 compiler just yesterday on a client's PC which has no internet connection (not sure if it is relevant).When compiling an empty project (standard microchip generated C++ project withNO code added at all, just an empty main()) it takes 1:14 minutes to compile and the PC is quite a fast one so it cannot be the PC itself. On any other machine that I have installed it onto it takes anything between 10 seconds and 14 seconds. So the difference is massive.That happens whether I do a clean and build or whether I add nothing more than a single line like asm("NOP") in the main(). So it makes it impossible to write any code whatsoever.I have not touched any MPLAB or compiler parameters at all. I just installed it and at the first compile of a brand new empty project (MPLAB generated) that happened.I don't think it is that there is no internet connection. What can it be?Thank you for any help!!

author: andersm
author_rank: Super Contributor
timestamp: August 04, 2020, 05:15:45 pm
content: On Microchip's forums, there have been occasional reports of extreme delays caused by the license manager malfunctioning, IIRC somehow related to networking. I haven't seen it myself, and I don't remember if a definitive solution was found. You can try contacting their tech support, especially if you have a paid license.

author: JPortici
author_rank: Super Contributor
timestamp: August 04, 2020, 05:55:12 pm
content: Or antivirus continuosly scanning the compiler / project directory, or even looking for the A: drive (man that was hilarioushttps://www.microchip.com/forums/m1015934.aspx)
STM32F446: External Oscillator vs. STOP mode? - Page 1
Forum section: electronics / general

author: Jay1011
author_rank: Contributor
timestamp: July 20, 2020, 06:32:11 pm
content: STM32F446 project. I'd prefer to use an external oscillator for HSE instead of the usual crystal. I'd setup HSE in the RCC to be in bypass, and my understanding is that this will work fine in normal (RUN) mode.However, for power savings, I want to disable (power-down) the HSE oscillator, via the oscillator's enable pin, when in STOP mode.Is there any way to achieve this? I could connect the HSE oscillator's enable pin to an STM32 GPIO and negate the GPIO just before entering STOP mode and then re-assert the GPIO on exit from STOP mode, but there seems to be a chicken-and-egg problem here:I'd be stopping the HSE oscillator as the STM32 is entering STOP mode, and thus possibly preventing the STM32 from actually reaching STOP modeI'd be unable to restart the HSE oscillator until the STM32 fully exits STOP mode, but if the STM32 needs HSE to be running to exit STOP mode, then the STM32 would never exit STOP mode.Has anyone used an HSE oscillator in combination with STOP mode and would be willing to share their approach?

author: ataradov
author_rank: Super Contributor
timestamp: July 20, 2020, 08:31:49 pm
content: A typical approach for this is to switch the system to the internal RC before the sleep and switch back after wake up.