hybridfree/eevblog-posts huggingface dataset:
STM32 DMA Transmission Paralleling - Page 1
Forum section: electronics / general

author: syntax333
author_rank: Regular Contributor
timestamp: July 18, 2020, 12:34:19 pm
content: Hi, I am trying to understand how the Bus Matrix work and how can I use the DMA most efficient way possible in STM32G431KB microcontroller.In AN2548 Application Note Section 5.2, it says that " For example when using STM32L486, a DMA1 transfer from SRAM1 to AES can access the bus matrix simultaneously with DMA2 transfer from Flash memory to any APB communication interface. No conflict and arbitration occurs."So does this mean that I can transfer the data I want in parallel, as long as I don't use the same bus?For example:In the Datasheet memory diagram it shows the ADCs connected to AHB2 Bus and USART1 is connected AHB1 Bus.In the Reference Manual Bus matrix diagram it shows that DMA1 is connected to SRAM1 and AHB1 and DMA2 is connected to SRAM2 and AHB2.So can I use the DMA2 to store ADC values to SRAM2 while transferring data from SRAM1 to USART1 using DMA1 simultaneously inparallelfashion?Is this the most efficient way to do this kind of stuff?Also does this mean that when I try to send data from SPI2 while receiving data from USART 1 (Same AHB1 bus), the data will be transferred inserialfashion from/to memory?

author: uer166
author_rank: Super Contributor
timestamp: July 19, 2020, 09:10:06 pm
content: Quote from: syntax333 on July 18, 2020, 12:34:19 pmSomeone correct me if I'm wrong..There is a round-robin scheduler that schedules transfers with all bus masters being equal priority. In that example, if two bus masters (say DMA1 and DMA2) want to transfer through AHB1, they just alternate: DMA1,DMA2,DMA1,DMA2.... etc. If CPU was also using AHB1, then it would be DMA1,DMA2,CPU,DMA1.. etc. This means it won't be serial (i.e. DMA1 transfers a big chunk, then DMA2 transfers a big chunk), but interleaved instead. I think each atomic transfer is 32 bits of data?

author: uer166
author_rank: Super Contributor
timestamp: July 19, 2020, 09:12:44 pm
content: Quote from: syntax333 on July 18, 2020, 12:34:19 pmI believe that is correct, it would be parallel transfers assuming no common bus is used. Does this matter at all though? USART doesn't generate a lot of data, so even if you share a bus with another master (CPU or another DMA), who cares?
LPC4078 - flashing bootloader - Page 1
Forum section: electronics / general

author: kamtar
author_rank: Regular Contributor
timestamp: July 16, 2020, 01:42:13 am
content: Hello,I have issues when writing into the first 512 bytes in LPC4078 flash memory.I write into a flash through IAP after it I read the first bank through SWD and everything is as it should be.After I reset the MCU first 512bytes of flash are rewritten by some data and I have no idea what's doing it. (data after those first 512bytes are as they should be)1. bootloader isn't doing it, it's happening even if I write there dummy data.2. fw isn't rewriting anything too.I'm left with that for some reason boot ROM of LPC4078, is rewriting that memory?Or maybe some sort of caching in a flash accelerator?

author: mikerj
author_rank: Super Contributor
timestamp: July 17, 2020, 11:04:21 am
content: The device automatically remaps the boot ROM to address 0x00000000 after a reset, and after the boot kernel is executed the Flash memory is mapped back in. However if you use a basic debugger (i.e. not one aware of this) to halt execution immediately after a reset then the boot ROM remain mapped in.The bottom line is your code is NOT being overwritten by anything, it just appears that way.Read the LPC407x user manual, section39.8 Debug memory re-mappingfor more details.

author: kamtar
author_rank: Regular Contributor
timestamp: July 17, 2020, 03:52:22 pm
content: Thanks, I found the real issue, some of the NXP MCUs are looking for checksum on address 0x1C.
Beken BK3231 - Page 1
Forum section: electronics / general

author: brainstorm
author_rank: Regular Contributor
timestamp: July 18, 2020, 02:22:47 am
content: Sorry for the cross posting, but I wonder if somebody over the EEVBlog community has ever poked this ~$2 Bluetooth HID IC a bit further than just the UART:https://mitxela.com/forum/topic/beken-bk3231It's relatively old (ca 2014?) but it's inside a bunch of cheap HID gadgets, ARM968 core... if anybody has good pointers about poking it via SPI (to dump its flash section), I'm all ears
328PB Output Compare Modulator - Page 1
Forum section: electronics / general

author: rpetitho
author_rank: Contributor
timestamp: July 12, 2020, 06:40:51 pm
content: One of the projects I'm currently working led me deep into the datasheet of the AVR 328PB. Has anyone used the Output Compare Modulator? Can you do any cool unique things with this, RF or otherwise. What are normal uses for it? Attached is the info from the datasheet.-Bob

author: bingo600
author_rank: Super Contributor
timestamp: July 15, 2020, 07:47:42 pm
content: Would fit a 38KHz modulated IR signal quite nicely.IR remote xmitter/Bingo
Board error on STM8S103F3 from ebay. Programming header pin GND not connected. - Page 1
Forum section: electronics / general

author: rhodges
author_rank: Frequent Contributor
timestamp: July 15, 2020, 07:14:38 pm
content: I just today received another batch of STM8S103F3 boards from ebay. Usually, the boards come with the programming header pins soldered on, but these had no pins. So I grab two and solder the 4-pin headers on.I plugged one into my STMLINK-V2 USB programmer, and it won't program. In fact, the power LED did not come on, but it flickered when I tried to program. Loose wire? They seem fine. Ignoring that, I figured maybe they locked their "precious blinky code". But the unlock fails, too.I go back to a board that I have been using recently, and it programs just fine.I connect a micro-USB power cable to the board, and now the power LED comes on. And I can program it now. But nothing works with just the 4-pin programming cable.I finally find that the programming header GND pin is not connected to anything. If I connect that wire to one of the other ground pins, I can program the board normally. Okay, this is inconvenient, but I have a workaround. I won't be using these boards for development.On the board between D3 and the positive pads is silkscreened "HW-177". And the ebay seller is "czb6721960". There is probably nothing he can do, but I sent him a message about the board error, in case someone complains about programming failures.
PCB Buttons -Help to Understand it - Page 1
Forum section: electronics / general

author: almamater
author_rank: Regular Contributor
timestamp: July 12, 2020, 02:43:57 pm
content: Hello, I'm trying to understand the operation of this small board with 5 buttons, but the tricky part is in 4 of them.It is a (broken) system of BUZZ commands from Plastation:I wanted to use the buttons to connect them to a micro controller (arduino) but I'm not quite sure how the configuration was made to know which button was pressed, the circuit of the 4 buttons is this:The buttons converge in pairs for 2 components of these: "A7"From what I researched and tested it must be aBAV99(2 diodes in series), the scheme of everything is like this:I think the PD7 must be VCC (+) and I notice that when we press buttons B and C the PD1 and PD2 are HIGH (+) respectively, but I cannot understand what happens when the other 2 buttons are pressed (D and E)..

author: madires
author_rank: Super Contributor
timestamp: July 12, 2020, 03:27:01 pm
content: Based on the use of the diodes I think it works like this:- buttons D and E : PD7 is HiZ (input), PD1 and 2 are high- buttons B and C: PD7 is high, PD1 and 2 are HiZ (input)

author: mikerj
author_rank: Super Contributor
timestamp: July 14, 2020, 09:24:26 am
content: Looks like a type of charlieplexing. I suspect PD1 and PD2 will be driven high/low/tristate by a micro, and PD7 will read back. Additionally PD7 will need a selectable pull up and pull down, which may be a fourth pin on the micro.

author: almamater
author_rank: Regular Contributor
timestamp: July 14, 2020, 11:03:27 am
content: Thanks, i appreciate the answers!!
Help Programming a Soldered in PLC44 - Page 1
Forum section: electronics / general

author: falcom
author_rank: Contributor
timestamp: July 13, 2020, 06:34:20 pm
content: I have a board that has a soldered on PLC44 HN27C4096 EPROM.Questions:What are the minimum pins needed for programming?What are they?Can I use an upside down PLC44 socket (wired appropriately) instead of buying and expensive Pomona test clip?Thanks in AdvanceDave

author: mikerj
author_rank: Super Contributor
timestamp: July 14, 2020, 07:07:31 am
content: This won't be easy, you will need pretty much all the pins on the device to program and verify it. You will also need to ensure that any other parts the EEPROM is connected on the PCBA (e.g. microcontroller or address and data bus latches) are tri-stated so that the programmer can manipulate all the pins without bus collisions and this will likely require additional connections to other points on the board.

author: coromonadalix
author_rank: Super Contributor
timestamp: July 14, 2020, 07:53:54 am
content: +1While trying to read it in the circuit you may end with wrong data values ... you would need to remove control or isolate any control pinssometimes you have some buffer control chips / address decoder ic / an mcu on the data bus ??Tried in the past with clips, the read data wasn't goodThe best would be to remove it with an hot air station ...

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 14, 2020, 08:44:31 am
content: Quote from: falcom on July 13, 2020, 06:34:20 pmYes, you can physically use an inverted PLCC, and we have done that....However we only did it onFLASHparts, your part is anEPROMso unless it has a window, there is no erase possible.You need to find a MTP or FLASH version ...

author: abyrvalg
author_rank: Frequent Contributor
timestamp: July 14, 2020, 09:23:54 am
content: Check where the Vpp pin is connected. Sometimes it is tied to Vcc on board and it is impossible to supply high voltage in-circuit (you need 12.5V on Vpp for programming).
OV7670 Camera + LPC54114 - Page 1
Forum section: electronics / general

author: george.manson.69
author_rank: Newbie
timestamp: July 06, 2020, 06:30:31 pm
content: Hello Everyone,Recently I have been working with the camera ov7670 for ARM microcontrollers, I have been using the microcontroller LPC54114, since I want to implement it for a dual core, and if possible put some AI.What I have is:-I2C communication-Receiving commands-Writing commands-Development of software in labview for acquisitionIf any of you have worked with this camera that can provide some manual to decode the frame types would be of great help, of course I have the data sheet, the problem is how to decode the image in the software.

author: george.manson.69
author_rank: Newbie
timestamp: July 10, 2020, 03:19:03 am
content: Hi All!I tried in some days to decode the image and I got it, this is the result, well I don't know if it is the best method but I used labview with their libraries but it's worked!I did the video how to implement the communication and other stuff that needs to run the camera, (the video is in spanish maybe I will try to put some subtitle in english)

author: nctnico
author_rank: Super Contributor
timestamp: July 12, 2020, 03:56:08 pm
content: You likely receive the data in Bayer (YUV) format from the camera.

author: Scrts
author_rank: Frequent Contributor
timestamp: July 13, 2020, 02:29:58 am
content: Quote from: nctnico on July 12, 2020, 03:56:08 pmBayer is RGBG afaik, so if it's YUV, then most likely YUV422 and data comes as YUYV. If you take only Y pixels - you get greyscale image.

author: ehughes
author_rank: Frequent Contributor
timestamp: July 13, 2020, 01:19:20 pm
content: Great Job with the LPC54114! It is a nice little dual core part.

author: ehughes
author_rank: Frequent Contributor
timestamp: July 13, 2020, 01:20:28 pm
content: Also, I have a *ton* of the LPC54114 Xpresso boards. If you are willing to cover shipping I can send them your way. Probably have 40.

author: george.manson.69
author_rank: Newbie
timestamp: July 14, 2020, 02:51:21 am
content: Yes,But When I sent the command COM4 with the value 0x40 (CCIF656 format) worked, but if not I send that command only I had a very dark image.Regards!
Any known traps for Xilinx Ultrascale+ XUsbPsu - Page 1
Forum section: electronics / general

author: rounin
author_rank: Regular Contributor
timestamp: July 13, 2020, 07:01:19 pm
content: Been working on a USB HS driver/wrapper for the Xilinx Ultrascale+ XUsbPsu lower level driver (running code on the A53 core), fairly immediatly ran in to two major issuesEvent TRB is not aligned for EP != 0, which means the callback doesn't know how many bytes were transferredUnder high load with simultaneous OUT and IN traffic, OUT reads lock up and the event handler stopsIt looks like these are known issues, link #1 is a confirmed fix, about to try #2.https://forums.xilinx.com/t5/Xilinx-Evaluation-Boards/ZynqMP-USB-Bare-Metal-Driver-Sharing-a-solution-to-the-problem/td-p/998056https://forums.xilinx.com/t5/Processor-System-Design-and-AXI/XUsbPsu-EpBufferSend-quits-sending-when-unrelated-interrupts-are/td-p/1079134Anyone else know of a major bug they could share?

author: rounin
author_rank: Regular Contributor
timestamp: July 13, 2020, 07:21:08 pm
content: Link#2 (masking USB ISR while calling XUsbPsu_EpBufferSend/XUsbPsu_EpBufferRecv) does seem to help. Still having a buffer corruption issue but its not hanging anymore.
stm32g0 weird spi pinout - Page 1
Forum section: electronics / general

author: exe
author_rank: Unknown
timestamp: July 08, 2020, 04:12:44 pm
content: Hi!I wonder why spi1 and spi2 pins are interleaved (see attachment). I have peripherical ICs communicated via spi on opposite sides of the stm32g072 chip and I expect this will make my routing messier. Older L0 series have a different pinout without this problem.UP: added the picture showing the problem

author: Scrts
author_rank: Frequent Contributor
timestamp: July 08, 2020, 05:39:20 pm
content: I understand that G series STM32's are more sensor/analog oriented and therefore, they're in a perfect sequence for the ADC inputs. I guess SPI is a secondary option in such case.

author: exe
author_rank: Unknown
timestamp: July 08, 2020, 07:30:30 pm
content: Looking further in the datasheet, it seems that different pins can do the same function. Like, SPI1_SCK can be assigned to PA1, PA5 and PB3 pins (see screenshot). If so, this is great as this gives me flexibility how to route the board. I can't find much info about that except a brief mentioning in a press release that the MCU has "user-assignable I/O", whatever that means.If it really lets flexibly assigning functions to pins, then it's super cool as I can use smaller packages with less pins.

author: lucazader
author_rank: Regular Contributor
timestamp: July 08, 2020, 07:43:01 pm
content: The stmcubemx is the perfect tool for this task.Allows to to enable all the peripherals you are wanting to use with a certain chip, check and manage conflicts etc.Really great for this task.(you dont have to use the generate project or anything, can just use it to check pin out and then close it again)

author: ataradov
author_rank: Super Contributor
timestamp: July 08, 2020, 07:46:50 pm
content: Yes, each pin can have up to 8 different signals/peripherals assigned to it. The multiplexing is configured via GPIOx_AFRL/GPIOx_AFRH registers.
Cypress EZ-USB Dead - Page 1
Forum section: electronics / general

author: ssashton
author_rank: Frequent Contributor
timestamp: July 09, 2020, 11:24:55 am
content: Hi,I have two EZ-USB programmer boards (cheap Ali-Express). Both have both stopped being able to communicate with slave devices over I2C. However they still show up as working in device manager.I'm wondering if the EEPROM has been corrupted.I know it's cheap but I can't wait for China delivery as I'm in the middle of a project.Any chance someone here knows how I could re-flash the EEPROM over the USB connection? I see there are quite a few software tools from Cypress for this chip, but I've never touched them before.On the other hand I guess the Cypress chip itself could be dead. There is no pull-up voltage on SCL, although there is on SDA.https://www.aliexpress.com/item/1907907422.html

author: MarkMLl
author_rank: Frequent Contributor
timestamp: July 09, 2020, 04:47:14 pm
content: Check eBay, there's people in the UK who claim to have them in stock. Once you're back on track investigate Github etc. for chip loaders.MarkMLl

author: Bassman59
author_rank: Super Contributor
timestamp: July 09, 2020, 08:19:49 pm
content: Quote from: ssashton on July 09, 2020, 11:24:55 amI thought that from your headline, you meant that Cypress' new owners, Infineon, shitcanned the EZ-USB series.Ah, well, your problem is that you bought cheap shit from AliExpress.

author: ssashton
author_rank: Frequent Contributor
timestamp: July 10, 2020, 01:27:52 pm
content: Hey guys I got this sorted.Firstly I did manage to get a new programmer from Hobby Components on eBay and it literally arrived next day (today).However, as it turns out the problem was corrupt EEPOM on the slave device. SCL was being held low as the slave wasn't responding.All's well that ends well!
I rainbowed 300 Neopixels with a PMS150C :D - Page 1
Forum section: electronics / general

author: abnielsen
author_rank: Contributor
timestamp: April 25, 2019, 08:36:36 pm
content: Just want to share - some source code included.Managed to drive 300 WS2812B's with a 3 cent Padauk PMS150C in a sot23-6 package... On a SOIC8 breakout.Worth noting I used the Padauk IDE and tools - it's not as bad as you might thinkhttps://abnielsen.com/2019/04/24/driving-300-ws2812b-rgb-leds-with-a-3-cent-microcontroller-pms150c/

author: kizmit99
author_rank: Regular Contributor
timestamp: April 25, 2019, 09:31:28 pm
content: Just out of morbid curiosity - since they're OTP how many chips did you have to go through to get it working?Thanks for sharing!

author: abnielsen
author_rank: Contributor
timestamp: April 25, 2019, 09:33:52 pm
content: First tryThe ICE (emulator/debugger) helped A LOT

author: kizmit99
author_rank: Regular Contributor
timestamp: April 25, 2019, 11:03:02 pm
content: Very nice!

author: gaganchd2000
author_rank: Newbie
timestamp: July 28, 2019, 02:36:06 am
content: I have ordered the writer and chips. When i try to burn chips its ask for .PDK file. But my FPPA compiler only generates .PRE file. How to generate .PDK file to upload to chip.

author: zitt
author_rank: Regular Contributor
timestamp: February 18, 2020, 11:32:09 pm
content: Abnielsen,Are you planning on porting this to the new SDDC toolset? IE true C code?Is anyone?I haven't even started looking at this but thought that your project was very interesting; but I didn't want to try and find a programmer/emulator to start development. Looks like the eevblog forum has made great progress in opensourcing everything needed to be marginally successful:https://www.eevblog.com/forum/blog/eevblog-1144-padauk-programmer-reverse-engineering/750/I'm curious if this project would be a great addition to code examples area on github.I'm also curious if you could post a schematic of how you connected the neopixels. I assume I could figure it out from the source; but it be nice to have an actual confirmation.

author: js_12345678_55AA
author_rank: Frequent Contributor
timestamp: July 08, 2020, 02:38:39 pm
content: Quote from: zitt on February 18, 2020, 11:32:09 pmHi,I implemented / ported another WS2812B project using a 16x16 matrix to Easy-PDK / SDCC toolchain:https://github.com/free-pdk/easy-pdk-showcase-projects/tree/master/ws2812animation16x16Best part, it comes with a emulator which can be used to compile/run the exact same source code on your computer (Linux/MacOS/Windows). It emulates the WS2812B 16x16 matrix in form of a graphics window.JS
TI F280041C PGA analog input - Page 1
Forum section: electronics / general

author: stoyanoff
author_rank: Contributor
timestamp: July 04, 2020, 05:54:08 am
content: Greetings! There is no answer from TI, so I need a little bit of help here! How can I select and convert data from one of the PGA inputs of F280041C? There is only 1 example into the lib -> pga_ex1_dac_adc_ext_loopback. So I`m using similar code, but I can`t get where I can change the read PGA input from. Here are parts my code:Code:#define MY_ADC_BASE ADCB_BASE/*PGA enable I suppos*/void initPGA(void){//// Set a gain of 3 to PGA2//PGA_setGain(PGA2_BASE, PGA_GAIN_3);//// No filter resistor for output//PGA_setFilterResistor(PGA2_BASE, PGA_LOW_PASS_FILTER_DISABLED);//// Enable PGA2//PGA_enable(PGA2_BASE);}/*ADCSOC init*/void initADCSOC(void){//// Configure SOC0. The temperature sensor is internally connected to B14// and requires an acquisition time of at least 450 ns.//ADC_setupSOC(MY_ADC_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM1_SOCA,ADC_CH_ADCIN1, 45);ADC_setupSOC(MY_ADC_BASE, ADC_SOC_NUMBER1,ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN1, 45);//// Set SOC0 to set the interrupt 1 flag. Enable the interrupt and make// sure its flag is cleared.//ADC_setInterruptSource(MY_ADC_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER1);ADC_enableInterrupt(MY_ADC_BASE, ADC_INT_NUMBER1);ADC_clearInterruptStatus(MY_ADC_BASE, ADC_INT_NUMBER1);}/*my main loop*/EPWM_enableADCTrigger(EPWM1_BASE, EPWM_SOC_A);EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP);ADC_forceSOC(MY_ADC_BASE, ADC_SOC_NUMBER0);ADC_forceSOC(MY_ADC_BASE, ADC_SOC_NUMBER1);//// Force ADC conversion//for(;;){if(ADC_getInterruptStatus(MY_ADC_BASE, ADC_INT_NUMBER1)){//// Acknowledge flag//ADC_clearInterruptStatus(MY_ADC_BASE, ADC_INT_NUMBER1);dacResult = ADC_readResult(ADCBRESULT_BASE, ADC_SOC_NUMBER0);pgaResult = ADC_readResult(ADCBRESULT_BASE, ADC_SOC_NUMBER1);//pgaGain = (float)pgaResult / (float)dacResult;//// Force ADC conversion//ADC_forceSOC(MY_ADC_BASE, ADC_SOC_NUMBER0);ADC_forceSOC(MY_ADC_BASE, ADC_SOC_NUMBER1);}}In this case I`m receiving floating value for pgaResult and it doesn`t seem to change acording the value of any PGA input!Any ideas?Thanks!

author: AkiTaiyo
author_rank: Contributor
timestamp: July 06, 2020, 12:25:23 pm
content: I'm by no means a TMS320 expert but having a quick scan through the datasheet it looks like you need to sample the B9 input to get the output from PGA2.From your code it looks like both of your inputs are reading from ADC B1?

author: stoyanoff
author_rank: Contributor
timestamp: July 08, 2020, 12:30:31 pm
content: YEs! I finally got it! It`s very strange. I thought the PGA_OUT are for outputting the measurend sygnal. It`s confusing, but now it makes sence!Thanks!
MC68HC16Z1 troubleshooting - Page 1
Forum section: electronics / general

author: tony359
author_rank: Frequent Contributor
timestamp: February 10, 2020, 06:19:03 pm
content: Hello all,As a fun project I am troubleshooting a system board of an old sound processor which is featuring a MC68HC16Z1 microcontroller. The board seems dead. I have good clock and the reset line is ok but I see no activity whatsoever anywhere.This is a total fun project and it's probably beyond my capabilities but I am just having a go. I'm building some cables to extend the board out of its chassis so I can probe it more easily but does anybody have any troubleshooting tips on this chip? Am I expected to see any activity on the address lines or data lines meaning that the processor is trying to read the program or could a faulty eeprom or RAM result into a completely dead system?Thanks for any tips you could have!Tony

author: ale500
author_rank: Frequent Contributor
timestamp: February 13, 2020, 07:33:42 pm
content: The manual of the microcontroller is still available, have a look at it. It is an "enhanced" HC11/HC12 with true 16 bit registers. The Bus is asynchronous like in the 68k, and not synchronous like in the HC11. Post some pictures of the board.

author: tony359
author_rank: Frequent Contributor
timestamp: June 24, 2020, 09:07:57 pm
content: Hi Ale500,Apologies for not following up. I just wanted to let the community know that I eventually managed to observe some brief data transfer on the data lines at power up so I assumed the CPU was attempting to do something. I realised a memory module was VERY warm and I had 27 Ohm between VCC and ground.Once the memory module was replaces the board came back to life!I now have a digital scope, I'm confident it would have been much easier to spot that activity!Thanks again for your help and sorry for disappearing.

author: Bassman59
author_rank: Super Contributor
timestamp: June 24, 2020, 09:23:50 pm
content: I bet that those two big empty sockets in the middle of that board are EPROMs, and those EPROMs held the program memory for your processor. I think you're dead in the water.

author: tony359
author_rank: Frequent Contributor
timestamp: June 24, 2020, 10:46:34 pm
content: Bassman,Indeed! I just don't have EEPROMS for all my boards so I have been swapping them around. I happened to take a picture of a board that doesn't have the EEPROM but don't worry, I am aware the board won't start without those chips

author: Benta
author_rank: Super Contributor
timestamp: June 27, 2020, 10:44:17 pm
content: The board looks like it's VME format. Looks nicely built too.

author: ale500
author_rank: Frequent Contributor
timestamp: July 05, 2020, 05:17:30 am
content: I'm glad it was that easynice to see the 68HC16 being used somewhere.
DIY I2C fault injection - Page 1
Forum section: electronics / general

author: garethw
author_rank: Regular Contributor
timestamp: July 07, 2020, 11:47:06 am
content: I’m thinking of making a device that can introduce I2C bus errors to test the stability of my projects.Has anyone made their own? I’ve seen an industry tool that can do this but it’s $10k (a smidge out of my price range).

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 08, 2020, 03:55:10 am
content: Quote from: garethw on July 07, 2020, 11:47:06 amYou can build a precise one, with any small MCU and deliberately inject out-of-spec conditions.Also, there are even simpler but less predictable testers ...I recall one tester that was the bare-end of multi-core cable, scraped across a metal file from a tool box.Another was a self-oscillating DPDT relay, wired so the relay continually chatters, and enabled with a toggle switch or push button.

author: DrG
author_rank: Super Contributor
timestamp: July 08, 2020, 02:47:19 pm
content: Quote from: PCB.Wiz on July 08, 2020, 03:55:10 amWhat would be some 'standard' out of spec conditions to emulate? I see some basic 'error' conditions herehttp://www.forward.com.au/pfod/ArduinoProgramming/I2C_ClearBus/index.htmlWhat else would be useful?
Are ADC reference voltages tightly regulated from VCC?  - Page 1
Forum section: electronics / general

author: Kalcifer
author_rank: Regular Contributor
timestamp: July 02, 2020, 03:51:02 am
content: The reason I ask is say your MCU is powered by a battery of some kind, well over time the voltage on those devices will drop. What I'm wondering about is if the value of VCC changes, will the voltage of the ADC fluctuate at all? Likewise will any noise from VCC get injected into the ADC reference voltage?For example, I took a look at the datasheet for an ATmega328p, and I see that the voltage for the ADC reference is 1.1V, so I would guess that it's regulated. I just wanted to make sure.

author: ataradov
author_rank: Super Contributor
timestamp: July 02, 2020, 04:29:51 am
content: That reference voltage is derived from the bandgap reference. It does not depend on the power supply of the device.The datasheet should actually have the characteristics for that reference over voltage and temperature variations.Wow, the datasheet is pretty sparse on characteristics for that reference. This is surprising. ARM datasheets are much more complete.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 02, 2020, 10:27:24 am
content: Yes the whole idea of the reference is that it's regulated.AVR internal reference just isn't anything special. Expect some drift from temperature variations, and yes, likely some drift from the Vcc variation as well. The ADC itself being just 10 bits means it isn't likely a big problem, but if you are expecting numbers to be accurate to 1LSB, not to mention if you are oversampling to get more resolution, you may need an external reference: the reference voltage pin is for this purpose. They are not expensive, but any extra part is of course extra hassle.For good analog performance noise-wise, power rail noise is a problem. That's why there's a separate Avcc pin, which you can filter, for example using a LC filter made of lossy L (ferrite bead) plus a combination of lossy C (say a 4.7uF tantalum) and a non-lossy C (say the standard 100n ceramic cap).Core noise tends to couple to the analog side despite this, that's why they implement the "measure while CPU is in sleep" modes. I have not seen these mitigations on many modern microcontrollers with higher resolution ADCs; they do better job these days than the AVR folks did.

author: Kleinstein
author_rank: Super Contributor
timestamp: July 02, 2020, 01:24:28 pm
content: At least with the more modern AVRs the coupling from the core to the ADC is relatively weak, if the decoupling is OK.It may have been an issue with the very early ones with supply on opposite corners of a DIP40. For the supply filtering a resistor in the 10 Ohms range can be a good alternative to the inductor, if there is no heavy load on the AVCC powered pins. In critical cases also add some resistance / ferrite to the digital VCC side to keep interference away from the supply.
Enabling FPU in STM32 - Page 1
Forum section: electronics / general

author: uer166
author_rank: Super Contributor
timestamp: June 26, 2020, 11:40:34 pm
content: How do I enable FPU in STM32 without resorting to assembly. Currently I have this from the ARM site which works:Code:void enable_FPU(void){__asm volatile(// CPACR is located at address 0xE000ED88"LDR.W R0, =0xE000ED88 \n\t"// Read CPACR"LDR R1,  \n\t"// Set bits 20-23 to enable CP10 and CP11 coprocessors"ORR R1, R1, #0xF << 20 \n\t"// Write back the modified value to the CPACR"STR R1,  \n\t": // No outputs: // No input operands: "r0", "r1");}But I don't care for assembly, and considering there are proponents here claiming Cortex-M can be programmed entirely in C, someone ought to know how to do it more easily..

author: uer166
author_rank: Super Contributor
timestamp: June 26, 2020, 11:43:48 pm
content: Nevermind, should have googled harder, for other passerbys it's:Code:// Enable hardware FPUSCB->CPACR |= ((3UL << 10*2) | /* set CP10 Full Access */(3UL << 11*2) ); /* set CP11 Full Access */I'm slowly warming up to the idea of bare-metal development with no HAL or Cube..

author: thm_w
author_rank: Super Contributor
timestamp: June 27, 2020, 12:06:13 am
content: Did you figure out the compiler flags as well?This is for another micro but looks useful:https://www.silabs.com/community/mcu/32-bit/knowledge-base.entry.html/2014/04/16/how_to_enable_hardwa-vM9u

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: June 27, 2020, 12:26:00 am
content: Quote from: uer166 on June 26, 2020, 11:40:34 pmWhat's wrong with assembly, or perhaps I should be asking why you don't care for it? Knowing assembly can be a big help when debugging when you need to know exactly what the CPU is doing at the lowest level.

author: Monkeh
author_rank: Super Contributor
timestamp: June 27, 2020, 01:17:39 am
content: Dare I ask why you needed to Google a solution to changing a couple bits in a register, when the bits and the register name and address you already knew?

author: uer166
author_rank: Super Contributor
timestamp: June 29, 2020, 03:47:02 am
content: Quote from: Monkeh on June 27, 2020, 01:17:39 amI didn't? I got a warning on a bare-metal STM32Cube project saying basically "please enable FPU, it is not enabled automatically", or something, and it would hardfault on any floating-point instructions, that is all I knew, and it took a while to figure out the right queryI also assumed you couldn't access the FPU enable bits directly in C easily, just like the R0, R1, etc registers.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 29, 2020, 03:17:51 pm
content: Note that if you look at the example projects provided by STM, you'll find out that they (all?) have a system_stm32XXXX.c file, in which the SystemInit() function does enable the FPU:QuoteThis function is itself called from the startup code (which is in assembly, usually in a file called startup_stm32XXXX.s)I for one don't use CubeMX and mostly go baremetal with STM32 MCUs, but I still have taken inspiration for my "baremetal" projects on STM's example projects, so the startup code is essentially the same.
PIC: the internal oscillator is always off by a factor of 4 (PIC16F1789) - Page 1
Forum section: electronics / general

author: bitter_mike
author_rank: Contributor
timestamp: June 27, 2020, 02:49:13 am
content: So this internal oscillator setting for the PIC16F1789 is making me question my sanity. This PIC has an internal oscillator, the frequency of which can be adjusted to a variety of settings by modifying the OSCCON register. I have attached the relevant portion of the datasheet describing the OSCCON register. It seems pretty straightforward: 4 bits of the register control the frequency. 0101 is 125 KHz, 0110 is 250 KHz, etc. The thing is, I set it to 0110, and then I measure the frequency with my scope on the CLK0 pin, and it comes out as 62.5 KHz. If I go up to 0111 (500 KHz), I measure 125 KHz. Same all the way up to 1110 which is 8MHz and I measure as 2MHz. I've also tried enabling the 4x PLL bit, which shouldn't be required, but that also doesn't do anything.I must be missing something stupid here. Can anyone see what it is?Appreciate the help.

author: Buriedcode
author_rank: Super Contributor
timestamp: June 27, 2020, 03:33:16 am
content: The CLOCKOUT pin presents Fosc/4 or I/O. Pg 73 of the datasheet:https://www.microchip.com/wwwproducts/en/PIC16F1789So it's working just fine. THe diagram on PG72 shows the PLL is available when the correct settings set the MUX paths, but I doubt it'll work for such a low frequency.Edit:QuoteThe specs on page 405:Quote

author: bitter_mike
author_rank: Contributor
timestamp: June 27, 2020, 11:34:29 am
content: Well, that was stupid of me. Thank you.

author: David Hess
author_rank: Super Contributor
timestamp: June 27, 2020, 11:21:53 pm
content: Internally PICs use a 4 phase clock so the input clock is divided by 4 to produce the phases which control the instruction timing just like a Z80 or similar processor with a 4 phase clock.

author: Buriedcode
author_rank: Super Contributor
timestamp: June 28, 2020, 12:22:43 am
content: Quote from: bitter_mike on June 27, 2020, 11:34:29 amNot at all, as many microcontrollersdon'tdo this. The 8-bit PIC architecture has always had the Fosc/4 instruction clock. On occasion it has annoyed me that we can't just output the actual Fosc, but more modern peripherals do allow this now - not directly, often you have to clock a peripheral with Fosc, that then uses a pin as an output, like a CLC peripheral. These later devices , like the one you're using, have impressive peripherals and some clever things can be done completely independent of the CPU.

author: bitter_mike
author_rank: Contributor
timestamp: June 28, 2020, 03:11:10 am
content: This is why I like electroplating. Just chemistry. No humans involved to do unexpected things.Thanks.

author: David Hess
author_rank: Super Contributor
timestamp: June 28, 2020, 03:08:58 pm
content: Quote from: Buriedcode on June 28, 2020, 12:22:43 amOften the low impedance output used to drive an external resonator or crystal can be used as a source for Fosc, however it may be difficult to use because of its alignment with the instruction clock.
Firmware for a Micronic MP254 - Page 1
Forum section: electronics / general

author: gnif
author_rank: Unknown
timestamp: June 28, 2020, 10:30:18 am
content: Hi All,I was given an Ericson branded Victor Micronic MP254 that has a custom firmware in it specifically to act as a terminal for some specific telco hardware, I would like to convert it into the base product and make it "useful" again, it would be cool to get this vintage bit of kit working again. If anyone has a ROM dump of the factory firmware it would be a huge step forward in making this thing operational again.It has an interesting micro, a variation of the rca cosmac 1802, it would be nice to make it into something "modern" without replacing its guts.Also looking for the user manual (attached image is not mine) as I don't have one.
Is my bootloader disabled for STORM32 gimbal controller V1.3 ? - Page 1
Forum section: electronics / general

author: ParamDeshpande
author_rank: Newbie
timestamp: April 02, 2020, 04:47:51 pm
content: I have a version 1.3 storm32 gimbal controller, I wish to update it's firmware from V0.9 to V2.4, I have followed the instructions on this pagehttp://www.olliw.eu/storm32bgc-wiki/How_to_flash_v1.x_STorM32_boardsAnd I have the issue where my DOS box shows OK and KO.The above website shows debug issues of wiring connections and other stuff. I have verified all of the connections.When in bootloader mode the MCU's yellow LED should glow, which does not glow in my case. So is boot mode in this board somehow disabled?Do I need to solder/remove some resistor to enable it?

author: oaltxf4o
author_rank: Newbie
timestamp: June 27, 2020, 07:55:04 am
content: the yellow LED is irrelevant, The only thing that matters is that there is no activity on the green and red LEDs.What section are you OK and what section are you KO? Both together with "No response from target..."Have you verified that your ttl adapter works? is it plugged in to the right port on the STorm32(some versions have swapped header locations)For SWD bootloader mode, you need to find the "Boot0" pads, and short them together. Then you need a ST-Link and follow the instructions for the First time flashing method 2. Don't forget to remove the solder bridge on the Boot0 pads when you are done.
Mfg Does not want me to have fun with STM32F0, RDP and SWD pin alt Funct - Page 1
Forum section: electronics / general

author: oaltxf4o
author_rank: Newbie
timestamp: June 27, 2020, 07:34:25 am
content: Well, I have been on here a long time, but I figured I would make my first post.I have been playing with a Shark ION RV750 robot vacuum. I have the important bits of the PCB mapped, and I have started to try and play with the software side.To access the mcu, there is an 8pin header with: nRESET, SWCLK, SWDIO, VDD, GND, USART3_RX, and USART3_TXAttempting to connect an ST-Link to the header quickly reveals a first roadblock... RDP Level 1.No Problem, we know of some good guides on getting the firmware despite this setback.Eh...? Can't assert nRESET (before I mapped out the full nRESET trace), oh an external 10k pull up... gone!Still can't get anything when using the firmware extraction python script. there is nothing else on the SWDIO and SWCLK lines.My assumption is they assigned some alternate function to SWDIO that locks out any SWD connections once the main program starts.Even when using a Jlink with Openocd, I can't seem to get the timing window right.Good news is I did find the USART Bootloader interface, and I extracted the full Bootloader(it seems to be the stock ST bootloader), but still no Flash readout.I think at some point when i was banging my head away at the brick wall, I did get a SWD Main Program connection at some point... Sadly it was one of those moments of throwing so many things in the pot, I don't know what the key was.No real end goal with this rabbit hole I have gotten myself into other than just learning... Maybe some more wise heathens can help guide me?
Interfacing an ESP32 to a HM10 module issue - Page 1
Forum section: electronics / general

author: Dajgoro
author_rank: Frequent Contributor
timestamp: June 23, 2020, 03:02:58 pm
content: HiI'm doing a little project where I have a central device with a ESP32 and a few peripherals around that use the HM10 modules.The idea is that the peripheral modules send data to the main device.This seems like something super trivial to get working, yet I've spent ages trying to get it to work and I can't figure out what's the deal with it.I can get the ESP32 to send data to all devices and the HM10 receives it, but the HM10 can't seem to transmit anything to the ESP32.When I use a ble phone app it works fine.I tried matching the characteristics of the ESP32 to the one the HM10 might expect, but nothing happens.Googling the issue does not get me anywhere.What could I be missing?ESP32 code:Code:#include <BLEDevice.h>#include <BLEServer.h>#include <BLEUtils.h>#include <BLE2902.h>BLEServer *pServer = NULL;BLECharacteristic * pCharacteristic;uint8_t txValue = 'a';#define SERVICE_UUID "0000FFE0-0000-1000-8000-00805f9b34fb"#define CHARACTERISTIC_UUID "0000FFE1-0000-1000-8000-00805f9b34fb"class MyServerCallbacks: public BLEServerCallbacks {void onConnect(BLEServer* pServer) {pServer->startAdvertising(); // restart advertising};void onDisconnect(BLEServer* pServer) {}};class MyCallbacks: public BLECharacteristicCallbacks {void onWrite(BLECharacteristic *pCharacteristic) {std::string rxValue = pCharacteristic->getValue();if (rxValue.length() > 0) {Serial.print("Received Value: ");for (int i = 0; i < rxValue.length(); i++)Serial.print(rxValue);Serial.println();pCharacteristic->setValue(&txValue, 1);pCharacteristic->notify();}}};void setup() {Serial.begin(115200);BLEDevice::init("SERVER");pServer = BLEDevice::createServer();pServer->setCallbacks(new MyServerCallbacks());BLEService *pService = pServer->createService(SERVICE_UUID);pCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_READ|BLECharacteristic::PROPERTY_WRITE|BLECharacteristic::PROPERTY_NOTIFY);pCharacteristic->addDescriptor(new BLE2902());pCharacteristic->setCallbacks(new MyCallbacks());pService->start();pServer->getAdvertising()->start();Serial.println("Waiting a client connection to notify...");}void loop() {}HM10 setup:Code:AT+RENEWAT+POWE3AT+FILT0AT+IMME1AT+ROLE1AT+TYPE0AT+RESETAT+DISC?AT+CONBCDDC2F231ABAT+CONNLAT+STARTHM10 datasheet:https://people.ece.cornell.edu/land/courses/ece4760/PIC32/uart/HM10/DSD%20TECH%20HM-10%20datasheet.pdf
ESPxx and its network stack - Page 1
Forum section: electronics / general

author: ice595
author_rank: Regular Contributor
timestamp: June 20, 2020, 01:32:41 am
content: Hi all, how common is it for a WiFi connected microcontroller that has its TCP/IP and 802.11 stack exposed for developers to tinker with?I am a noob when it comes to networking protocols. The last IoT project I made was about 4 years ago when I was still in college.It wasn't anything fancy, just a generic ESP8266 board connected to a PIC32 and a character LCD.Recently I got myself a couple of ESP32 dev boards to kill time while "working" from home, but this time I am programming it directly instead of using AT commands over UART.I was very surprised that its SDK's network stack was exposed enough to allow devs to transmit arbitrary 802.11 packet frames.Are there anymore WiFi micros or SoC out there that can do the same thing?
Some questions about page 130 of the atmega328p datasheet - Page 1
Forum section: electronics / general

author: ledtester
author_rank: Super Contributor
timestamp: June 18, 2020, 11:35:56 pm
content: I need just a couple of quick sanity checks on the atmega328p docs...1) On page 130 of the atmega328p datasheet:http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdfit says that the WGM22 and CS22 bits of the TCCR2B register are just "R" - presumably read-only. But they really are R/W - correct? so this is just a typo.2) I am using an Arduino library which when I run on my DCcduino UNO (atmega328p) is setting TCCR2A = 0 and TCCR2B = 9. But this means WGM22:0 = 4 which according to Table 17-8 on page 130 of the above datasheet is a "reserved" setting. Am I reading things correctly?

author: Ian.M
author_rank: Super Contributor
timestamp: June 19, 2020, 12:11:04 am
content: 1. In the older version of the datasheet 'Atmel-42735A-ATmega328/P_Datasheet_Complete-06/2016' TCCR2B is on page 206 and *all* implemented bits are clearly marked R/W.2. The older datasheet also says mode 4 is reserved. Note that zero in TCCR2A leaves OC2A and OC2B pin functions disabled (i.e. normal I/O). What Arduino library are you using? Is it possible that it later changes the WGM21, WGM20 bits in TCCR2A to a valid mode before enabling the timer?

author: ledtester
author_rank: Super Contributor
timestamp: June 19, 2020, 01:01:54 am
content: Thanks, guess I'll consult the older datasheet from now on!The library is this one:https://github.com/RobotDynOfficial/RBDDimmerThe product page is here:https://robotdyn.com/ac-light-dimmer-module-1-channel-3-3v-5v-logic-ac-50-60hz-220v-110v.htmland the schematic of the board is here:https://robotdyn.com/pub/media/0G-00005677==Mod-Dimmer-5A-1L/DOCS/Schematic==0G-00005677==Mod-Dimmer-5A-1L.pdfI have a lot of doubts about the library... this comment here doesn't match the code:https://github.com/RobotDynOfficial/RBDDimmer/blob/70087384b04b95bfd57dfc815d8293e1a3e3ac60/src/avr/RBDmcuAVR.h#L60and the TCCRxA_VALUE definition is not used by the library. Instead the TCCRxA register is always set to 0:https://github.com/RobotDynOfficial/RBDDimmer/blob/70087384b04b95bfd57dfc815d8293e1a3e3ac60/src/avr/RBDmcuAVR.cpp#L68Also, I don't see that it is measuring the AC line frequency or taking into consideration F_CPU, so it probably is making some assumptions about these values.
External Flash memory size? - Page 1
Forum section: electronics / general

author: thelearner
author_rank: Contributor
timestamp: June 17, 2020, 04:32:45 am
content: Hello,I am new to LoRa FUOTA and want to implement FUOTA in my SAM R34 based end nodeSAM R34 has an internal memory of 256kB, so I am assuming that the maximum application size is 256kB for SAM R34 and we can use an external flash of 500kB for performing FUOTA.So can I go with a 500kB external flash?Does it cause any problem for FUOTA implementationThe flash I selected is AT25DF041BTIADatasheet of SAM R34http://ww1.microchip.com/downloads/en/DeviceDoc/SAMR34-R35-Low-Power-LoRa-Sub-GHz-SiP-Data-Sheet-DS70005356B.pdf

author: ataradov
author_rank: Super Contributor
timestamp: June 17, 2020, 05:37:17 am
content: Generally you want to have more space because the images stored on the outside device would need to be encrypted, which may make them bigger than raw binary.At the same time, it is not very likely that your application will take up all the device space and at the very least there will be some space taken up by the bootloader, so it will not be present in the application images.Also, if you are not going to implement the protocol yourself, you may want to see what are the requirements in the existing implementations.But yes, as a first approximation 512 kB is a good size for the external flash.

author: Scrts
author_rank: Frequent Contributor
timestamp: June 17, 2020, 02:21:15 pm
content: General advice: use a bigger flash during development and see what's sufficient for the production application. For OTA, it's also good to have 2 images stored: new and old.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: June 17, 2020, 08:48:01 pm
content: A quick search for "lora node flash size" shows numbers in order of 64K for a loosely written firmware (HAL-based). So unless you are planning to include some heavy data like color graphics, it looks like your R34 have more than enough internal flash for an OTA buffer. That would save both material costs and development time (no need to code external flash access).