hybridfree/eevblog-posts huggingface dataset:
Cortex-M0+ Hard Fault handler porting - Page 1
Forum section: electronics / general

author: jsilva
author_rank: Newbie
timestamp: January 31, 2021, 02:58:00 am
content: Hello everyone,I am porting a Hard Fault handler code I have been using for a while. It was originally written for a Cortex-M3, and has worked so far for M3, M4 and M7:Code:void __attribute__ ((naked)) _hardfault_isr(){__asm__ volatile(" tst lr, #4 \n"" ite eq \n"" mrseq r0, msp \n"" mrsne r0, psp \n"" ldr r1, [r0, #24] \n"" ldr r2, hardfault_trace_stack_addr \n"" bx r2 \n"" hardfault_trace_stack_addr: .word hardfault_trace_stack \n");}But now I am working with a Cortex-M0+, and it wouldn't compile. After a close look, one quickly realises some of the instructions are not supported by the poor M0+.After some head scratching, I came up with a solution that I think should implement the same algorithm, in an M0+ compatible way, but I am not sure:Code:void __attribute__ ((naked)) _hardfault_isr(){__asm__ volatile(" movs r0, #4 \n"" movs r1, lr \n"" tst r1, r0 \n"" mrs r0, msp \n"" beq not_psp \n"" mrs r0, psp \n"" nop \n"" nop \n"" nop \n"" not_psp: \n"" ldr r1, [r0, #24] \n"" ldr r2, hardfault_trace_stack_addr \n"" bx r2 \n"" hardfault_trace_stack_addr: .word hardfault_trace_stack \n");}I would like someone who is more experienced to give some input, please.It should determine whether the program was running off the PSP or MSP when the fault happened, determine the address of the stack frame and then call a C routine that will use that information.Thank you,João

author: westfw
author_rank: Super Contributor
timestamp: January 31, 2021, 11:13:45 am
content: The M0+ also saves considerably less information on hard faults than the "bigger" Cortex CPUs.From the ARM ARM:QuoteI'm not sure whether the info you're trying to collect is even there. (I'm not sure it's NOT, either, but ... investigate carefully.)(and yeah, it can come as a big shock how many instructions are "just not there" in v6m vs v7m. :-( )

author: bson
author_rank: Unknown
timestamp: February 01, 2021, 07:18:43 pm
content: Can't gas automatically convert some of the nonexistent instructions? If so it might be sufficient to use the correct compiler options for the target architecture. (If nothing else, they should produce errors and fail to compiler/assemble.)But of course it can't make up for missing fault status or other CSRs.

author: jsilva
author_rank: Newbie
timestamp: February 02, 2021, 03:41:07 am
content: Quote from: bson on February 01, 2021, 07:18:43 pmNope, I did port the rest of the code, including all the compiler/linker options, and then tried to build to check if I missed anything, and it complained about that inline asm, so clearly the asmer didn't convert that.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 05, 2021, 12:15:32 pm
content: An interesting article about fault handling on Cortex-M0.https://dmitry.gr/?r=05.Projects&proj=27.%20m0FaultDispatchIt should also be applicable to M0+,
MCU with PCIe endpoint pretend to be USB port with device connected - Page 1
Forum section: electronics / general

author: Miyuki
author_rank: Frequent Contributor
timestamp: February 02, 2021, 08:51:34 pm
content: HiI want to ask if you have some experience with PCIe devices.I want to emulate USB port with the device plugged in to avoid the need for a custom driver. As I can easily use default USB classes (Mass Storage and UVC).I am looking if I can find some examples or solutions I can modify.I read about this way of emulation in the documentation for USB3380, which can use its internal processor for this.

author: mon2
author_rank: Frequent Contributor
timestamp: February 04, 2021, 04:32:46 pm
content: This is a complex task.Are you looking to build a commercial device?If yes, the PLX / Avago / Broadcom USB3380 is EOL and the kits that were by Bplus (Taiwan) are no longer shipping. Asked them yesterday and they do not have even a single -RC board for development.You may want to consider to use the Cypress USB 3.0 FX3 controller with an FPGA and RTL code.Have designed hundreds of PCIe adapters and the first PCIe i/o adapters for the PC industry. Do not have direct experience with the USB3380 but recall that it started with Anchorchips -> Netchip -> PLX -> Avago -> Broadcom -> killed by this firm.If the end product is not a conflict of interest, may be able to assist further but as noted, do not have direct experience with the USB3380. For now, there are some documents and SDK on the Broadcom website linked to this controller. You may want to download them asap before they erase any history of this device.

author: Miyuki
author_rank: Frequent Contributor
timestamp: February 04, 2021, 05:03:36 pm
content: It's not intended as a commercial product, just some experimentation, and learningI want to use an NXP processor and they recommended running Linux with PCI Endpoint Framework to what I expect can be added virtual xHCI deviceCode for USB devive I have it can run on a native port, so shouldn't be that big deal to direct it to the virtual port.Just wonder how much overhead and possible performance penalty it will bring

author: Foxxz
author_rank: Regular Contributor
timestamp: February 04, 2021, 10:32:45 pm
content: Quote from: mon2 on February 04, 2021, 04:32:46 pmI second the Cypress USB 3.0 FX3. I believe this (or a similar one by Cypress) is what is used in the USB Ettus SDR platforms.
Keil SNMP and solarwinds  - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: February 01, 2021, 11:10:14 am
content: Hi,This is the first time a client requested me to do an SNMP agent project, so basically I have run the sample app with keil and it's working with it's windows test program,Also solarwinds software can detect it as an snmp agent, my problem for now is How can I see the OID's for KeyIn,LedOut , lcd_text in the keil original program in solarwinds?Has any one in here done this job with solarwinds ?
atm90e26 UART problem  - Page 1
Forum section: electronics / general

author: andrejTB
author_rank: Newbie
timestamp: November 05, 2020, 08:18:20 pm
content: Hello!please help me, i having a big issue with my project based on atm90e26 + arduino due ( only chip )i connected atm90e26 with uart and 6n137 optocoupler and for testing im using esp8266 board and from software side -https://github.com/whatnick/ATM90E26_Arduinoi checked data on osciloscope - on recciver pin i have nice not distorted signal from optocopuler isolation , but no signal on transmit pin. so it looks like deffective chip - but ZQ is working, crystal too and Vref is OKi tryed to replace chip but new one dont work too.. i dont know what to do because its a very important project for me and i i had no idea i could come across such a problem...and one more problem - his code doesent work with arduino dueThanks a lot and stay safe and healthy

author: pepesanches
author_rank: Newbie
timestamp: February 10, 2021, 09:16:19 pm
content: Hello AndrejTB, I'm starting to use the same IC (ATM90E26) and I have encounter the same problem. The IC doesn't respond to any uart command.Have you found what was the cause to the problem?I have tried looking the transmit pin with a logic analyzer and i see no responses from the IC.Another thing, I am using a SAMR34 and not ESP with arduino.Thank you.
MCUXpresso, Program, Erase - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: January 31, 2021, 09:33:50 am
content: Hi.I want to program or erase a microcontroller from MCUXpresso, not run a Debug session, just program or erase the chip (Kinetis or i.MX RT).I see that in the left column are the three programmers that I have, NXP Link Server board, PEMicro and SEGGER Jlink, and in each of them there are four options forDebug, Attach to a running target, Program Flash and Erase Flash.I have tried all four options on each of the three programmers, but a Debug session always runs, I can't program or erase the chip. I also tried running the second option "attach to a running target" and then trying to run Program or Erase, but it doesn't work either.I attach a screenshot of the options that come out for each programmer. For my final product I want to program the microcontrollers with read protection by modifying the Flash_Config in the Startup file and I would also like to test that once the Read protection and not allow Erase bits are enabled, the chip can no longer be read or erased .Used the SEGGER Jlink programmer with the Jflash software I can program, read and erase, but I would like to do it from MCUXpresso and with any of the three programmers that I use.Regards
AD7190 continuous conv using stm32 - Page 1
Forum section: electronics / general

author: mem2mem
author_rank: Newbie
timestamp: January 30, 2021, 06:50:43 pm
content: Hi,I'm using AD7190 with STM32F103 for data logging. The datasheet of the ad7190 said that the DOUT/RDY falling edge can be used as an interrupt to a processor since it will go low to indicate the completion of a conversion. I'm using the continuous conversion mode of the ad7190, so I need to continuously monitor this pin.How can I set the MISO pin of the stm32 as an external interrupt pin to detect the falling edge while it was set as MISO pin?

author: iMo
author_rank: Super Contributor
timestamp: January 30, 2021, 07:51:34 pm
content: Quote from: mem2mem on January 30, 2021, 06:50:43 pmWhy do you need to use the "MISO set" pin for firing an interrupt?

author: mem2mem
author_rank: Newbie
timestamp: January 31, 2021, 02:13:17 am
content: Quote from: imo on January 30, 2021, 07:51:34 pmBecause MISO pin is connected to the DOUT/RDY pin

author: julian1
author_rank: Frequent Contributor
timestamp: January 31, 2021, 03:31:33 am
content: Feed the DOUT/RDY signal to the stm32 spi MISO as well as a gpio pin. Then configure the interrupt on the gpio pin.

author: mem2mem
author_rank: Newbie
timestamp: January 31, 2021, 06:25:32 am
content: Quote from: julian1 on January 31, 2021, 03:31:33 amI config the external interrupt on the pin near MISO pin and connect it to MISO pin, it work well, THANKS.
AsProgrammer - flash memory chips (SPI, I2C, Microwire) via USBasp - Page 1
Forum section: electronics / general

author: iMo
author_rank: Super Contributor
timestamp: December 31, 2019, 05:36:30 pm
content: FYI - people are sometimes looking for a cheapo flash memory chips programmer - I've been using the cheapo USBasp for programming xxxkB and XXMB flash chips.The GUI is the AsProgrammer (SPI, I2C, Microwire flash chips).Chip list:https://github.com/nofeletru/UsbAsp-flash/blob/master/chiplist.xmlSource:https://github.com/nofeletru/UsbAsp-flashBin (Win):https://github.com/nofeletru/UsbAsp-flash/releases/download/v1.4.1/AsProgrammer_1.4.1.zipForum:http://forum.easyelectronics.ru/viewtopic.php?f=17&t=10947You have to flash a fw update into the USBasp. It adds the flash memory chips programming.Works fine here, it allows some scripting too.

author: coromonadalix
author_rank: Super Contributor
timestamp: January 01, 2020, 06:25:39 am
content: Neat projectI would love to program dallas one-wire eeproms with this projectasprogrammer_v2.1.0.9.zip is out on their forums

author: lpc32
author_rank: Frequent Contributor
timestamp: January 29, 2021, 01:02:52 pm
content: Any idea why they abandoned GitHub at v1.4?I think v2 was carried on by someone else, but not sure why not just fork.There's also NeoProgrammer, which I think is a continuation of AsProgrammer 2:https://4pda.ru/forum/index.php?showtopic=884713&st=3780#entry96411343
[Solved] Can I copy this PIC 16C57C? - Page 1
Forum section: electronics / general

author: tppc
author_rank: Regular Contributor
timestamp: January 28, 2021, 11:15:47 pm
content: Hi there,I found a Lan cable tester in the dumpster.Of course, it is defective (indicates short circuit between pin 7 and ground, even with no cable connected).This tester uses a MICROCHIP CF775 which seems to be a low cost version of PIC 16C57C-04P.I read it somewhere, but I can't find the link anymoreEdit : I eventually found it againhttps://www.microchip.com/forums/FindPost/266213After 2 min investigation, I found out that pin 7 is directly connected to pin 24 of the microcontroller.I pulled it from its socket and tested directly on the chip -> measured 4 Ohms between Pin 24 (RC6) and pin 4 (Vss).This I/O port is fried.I put this supposedly PIC16C57C on my TL866II and could read some information.The problem is that I know almost nothing about PIC controllers.Can anyone have a look at the 2 screenshots and tell me if there is any chance that I can burn a new PIC16C57C with this information?I have no PIC16C57C and before ordering a few, I wanted to know if this will work.Thank you guys!

author: amyk
author_rank: Super Contributor
timestamp: January 29, 2021, 01:29:34 am
content: You are lucky as that does appear to not have the readout protection enabled. You should be able to dump and copy the code to a new one.

author: oPossum
author_rank: Super Contributor
timestamp: January 29, 2021, 03:36:30 am
content: It is code protected. On the older PICs the first 64 words are readable (and programmable) when code protect is set, the following words will all be zero.https://ww1.microchip.com/downloads/en/DeviceDoc/30190h.pdfPage 7 Section 3.0 Code Protect

author: tppc
author_rank: Regular Contributor
timestamp: January 29, 2021, 01:56:41 pm
content: Hi there,As I understood, this controller is code protected and there is no way to get a reliable dump to burn a new one.So, the best solution might be to bring this tester back to where it belongs...the dumpster!Thanks for your time and your expertise.Kind Regards.

author: TomS_
author_rank: Frequent Contributor
timestamp: February 03, 2021, 08:01:38 am
content: Or find a pin compatible PIC and write your own new software and bring it back to life.Depends how adventurous you are I suppose.

author: tppc
author_rank: Regular Contributor
timestamp: February 03, 2021, 01:28:27 pm
content: Well, the PIN compatible PIC is not a problem : PIC 16C57C-04P available for less than 2 $.The point is that I did never program any controller.Although I did program large Windows applications in ANSI C (25 years experience with LabWindows CVI), VBA, VBS, I never ever did anyting with microcontrollers (except dump and flash).Writing this thing from scratch would take ages (for me)Futhermore, I would have to reverse engineer the HWNot sure I am that adventurous...Kind Regards
RT1064, BGA, crystal on top or bottom side - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: January 27, 2021, 03:16:21 pm
content: Hi.I am going to make my first PCB with BGA, 4 layers of course. I have chosen a NXP i.MX RT1064 BGA microcontroller with a pitch 0.8mm of 196 balls.The decoupling capacitors I understand that I should put them on the bottom side, just under the microcontroller. I already did double-sided welding tests with other boards, in my infrared oven and everything went well.My question is where to put the 24Mhz crystal for the oscillator, on the top side with tracks or on the bottom side with vias so that the tracks are as short as possible.On the other hand, I have not yet tested whether my Neoden4 will be able to recognize BGAs, if someone did and can confirm it.Any advice for the first board with BGA ?.I have yet to check what should be the size of the vias, and the thickness of the tracks for this chip, and that JLCPCB can do it.Regards

author: bugnate
author_rank: Regular Contributor
timestamp: January 27, 2021, 06:41:14 pm
content: Haven't used this particular chip, but the XTAL pins look to be on perimeter (outer and one row in). So you can have "both" by placing the crystal on top side close to the chip with short traces and no vias. Ideally, at least.

author: phil from seattle
author_rank: Super Contributor
timestamp: January 27, 2021, 08:19:09 pm
content: Teensy 4.1 (1062) puts the crystal on top. Seems pretty solid.
Search for Abatron BDI2000 firmware for MPC8xx - Page 1
Forum section: electronics / general

author: Wallacious
author_rank: Newbie
timestamp: October 29, 2018, 01:13:38 pm
content: Hi all,I have a BDI2000 and I'd like to debug a Freescale MPC852T but the firmware I have is for PPC(6xx,7xx,5200,82xx,83xx). If someone needs it, I can send the firmware.I saw in other topic that the websitehttps://wiki.ntb.ch/infoportal/embedded_systems/abatron_bdi/device_listhas the firmware I need (B20PPCGD.exe).But it's only a local download!If someone can give me this firmware, I'll be glad.Cheers.Yves

author: sicco
author_rank: Regular Contributor
timestamp: December 05, 2020, 03:16:39 pm
content: Check this thread:https://www.eevblog.com/forum/microcontrollers/bdi2000-firmware/msg3349760/#msg3349760

author: highfreq
author_rank: Newbie
timestamp: January 28, 2021, 01:39:07 am
content: If you still have them, I'd very much appreciate the PPC6xx etc firmware files.
A tip for those writing STM8 inline assembler with SDCC - Page 1
Forum section: electronics / general

author: HwAoRrDk
author_rank: Super Contributor
timestamp: February 07, 2020, 06:25:20 pm
content: I just got done banging my head against the wall trying to figure out a problem with my code, so I thought I would share this tip for anyone in the future writing some inline assembler code for the STM8 and compiling with SDCC.When compiling with the option--model-large(for chips with more than 32KB of flash), and you have some inline assembly code within a function that accesses the function's parameters, don't forget to increase the offset from the stack pointer by an extra byte! This is because the function call's return address takes up an extra byte on the stack.I had been attempting to write an accurate delay function, and needed a cycle-exact delay loop, so I decided to use inline assembly so I had control over exactly how many cycles the instructions would take (so it wasn't affected by optimisation level, etc). The delay loop function would take a single uint16_t argument that specified how many loop iterations, so my assembly code needed to load that argument's value from the stack (args are passed on the stack on STM8). So I had the following code:Code:ldw x, (0x03, sp)It seemed to be working fine, but then at some point it stopped working and my delay timings were incorrect. I wondered what the hell was going on. It didn't occur to me that this happened after I had been fiddling with the build options and turned on--model-large(because I am using a 128KB chip)...What I think had been occurring was that instead of reading the 2-byte function argument, it was reading one byte of the return address and one byte of the function argument, which resulted in an incorrect loop iteration count.What I actually needed was to add one to the offset, making it 0x04.Hard-coding the offset isn't very portable though, so what I did instead is check whether the 'large' memory model is in effect (SDCC helpfully provides a define for that) and set the offset value with a preprocessor macro, like so:Code:#ifdef __SDCC_MODEL_LARGE#define STACK_ARG_OFFSET 0x04#else#define STACK_ARG_OFFSET 0x03#endifP.S. if counting assembly code cycles, one also needs to take into account RETF is used instead of RET with 'large' model, which takes 5 cycles instead of 4.

author: rhodges
author_rank: Frequent Contributor
timestamp: February 07, 2020, 06:48:04 pm
content: Thanks, that's good to know. I only use the standard model and have been tempted to write macros for accessing the SP arguments. I probably will if I start using the large model.

author: mrflibble
author_rank: Super Contributor
timestamp: January 27, 2021, 06:28:02 am
content: Thanks! That is indeed good to know. Figuring that out sounds like a fun way to spend an evening. Or two. Or three.Just got started with stm8 + sdcc, and so far I've only used the standard model. But good to be forewarned in case of large model.Quote from: HwAoRrDk on February 07, 2020, 06:25:20 pmHey, I have this very problem (accurate delay loop) on the todo-list.What code did you end up using for your delay function?
On-chip LCD Driver pins - Page 1
Forum section: electronics / general

author: @rt
author_rank: Super Contributor
timestamp: January 19, 2021, 06:17:31 am
content: Hi, I have a Radio Shack/ Realistic/ Sangean radio with a dim LCD.LCD is currently best viewed from a shelf above head height.It has uPD75308 microcontroller with built in LCD driver, and I have identified these pins, and matched the to the radio schematic.It it as I think, where LCD Bias is an AC output which is divided and fed back into the controller for column voltages?I’m thinking I should be able to lower the value of R417 from 33K, to supply a higher voltage to the entire display.Is this correct? Cheers!

author: Miti
author_rank: Super Contributor
timestamp: January 23, 2021, 10:06:24 am
content: You can try that, or you can use higher external bias.Edit: I should have read your entire post. No, LCD bias is not AC, it is DC.

author: @rt
author_rank: Super Contributor
timestamp: January 26, 2021, 06:15:24 pm
content: Quote from: Miti on January 23, 2021, 10:06:24 amThanks for the replybut it took so long to get any reply at all, and I went ahead.I found a Microchip document on it, and it appears this resistor divider arrangement is common.The variable resistor is typically added to the top, and it changes the voltage of every tap.Only issue is the 3 inputs are limited in the data sheet to the chip’s supply rail.When I opened the device, the 33K resistor never existed. It was a 0 ohm link, which was already feeding the top of the divider with Vdd.So I took the risk and applied a much higher voltage, about 5.5V in place of 3.7V, which fixes the display, but runs the microcontroller out of spec.Any thought on this?

author: Miti
author_rank: Super Contributor
timestamp: January 26, 2021, 08:19:55 pm
content: Quote from: @rt on January 26, 2021, 06:15:24 pmThat is never a good idea.Edit: The operating voltage range is 2.7 to 6V and the absolute maximum Vdd is 7V, so I think the uC is safe. I'm not sure what other ICs are on the same supply line and are pushed over their limits. Are you sure that the supply voltage should be 3.7V? It doesn't seem like a standard value to me. Maybe it was supposed to be 5V but it lost few volts over time.

author: @rt
author_rank: Super Contributor
timestamp: January 26, 2021, 09:35:25 pm
content: Quote from: Miti on January 26, 2021, 08:19:55 pmThe schematic says it’s a 3V reg, but the data sheet of the reg quotes 3.7V.I didn’t run the chip at a higher voltage, I fed the 5.5V into the top of the resistor ladder for the LCD voltage.Still out of spec because the data sheet for the chip I posted above quoted Vdd (3.7V in this case) is the maximum voltage that should be input to the LCD supply pins VLCD0 - VLCD2.

author: Miti
author_rank: Super Contributor
timestamp: January 27, 2021, 04:00:47 am
content: Did you measure the supply voltage after the mod? It may have gone up through the clamp diode of the VLC0 pin, if it has one.
ESP32-C3 - Page 1
Forum section: electronics / general

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 26, 2021, 11:18:11 pm
content: Not sure it has already been announced here so...Looks like a new RISC-V buddy is coming:https://www.espressif.com/en/news/ESP32_C3

author: coppice
author_rank: Super Contributor
timestamp: January 26, 2021, 11:47:00 pm
content: That's a fairly predictable direction for them to go in, but it seems very confusing to call it the ESP32.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 27, 2021, 12:22:38 am
content: Note that they have also recently released the ESP32-S3, based on an Xtensa LX7 core. The ESP32 series was initially only based on Xtensa cores, but I don't think that was set in stone in the ESP32 name. ESP32 was not the name of the underlying architecture.Looks like now the naming will be ESP32-S for Xtensa-based MCUs, and ESP32-C for RISC-V-based ones.And that said, the latest ESP32-S3 looks like quite a beast and is much more powerful (in terms of processing power) than the -C3. It will be interesting to see what the pricing is.

author: kjw
author_rank: Newbie
timestamp: January 27, 2021, 12:52:09 am
content: Let's all pray for a decent ADC.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 27, 2021, 01:11:27 am
content: Quote from: kjw on January 27, 2021, 12:52:09 amFrom the DS, it embeds two 12-bit, 2 Msps SAR ADCs, with the following characteristics:DNL = +/- 7 LSBINL = +/- 12 LSBI don't know how that compares to the older ESP32.

author: lucazader
author_rank: Regular Contributor
timestamp: January 27, 2021, 01:53:43 am
content: The new chip interests me for sure.We use the ESP32 original in our current products and the biggest issue we have with it is low power support in BLE and in WiFi AP mode.Part of this i think stems from the original chip supporting Standard BT as well as BLE.From what i can see/understand/infer the new chip only supports BLE?So hopefully at least the power consumption with only BLE running will be lower.Quite useful for our development in that this new chip will be supported by their current development framework, so should make it much easier to port our code across to this new product.As well as them offering the chip in a module with the same footprint as their current modules.
[SOLVED] STM32F103 CubeIDE HAL setting variable deadtime PWMN - Page 1
Forum section: electronics / general

author: Amper
author_rank: Frequent Contributor
timestamp: January 26, 2021, 03:57:31 pm
content: Hi,i really dont like asking questions about programming but on this one im a bit out of ideas.Im trying to learn about forward converters and to stay flexible i wan to control ist by a micro controller. Also getting into STM for the first time.I have set up my controller to put out complimentary PWM by HAL with deadtime and this worked fine so far, just followed what other people have posted before. Sadly any examples i coud find stop at this point and im completely without a clue on how to change the deadtime without restarting the timer (which really sucks for the CC and CV closed loops for obvious reasons).I expected it to work by just changing the timers compare value__HAL_TIM_SET_COMPARE(&htim1,TIM_CHANNEL_1,value);but for some reason this function seems to turn off the N channel and turn the pwm on te regular pin to a normal pwm with no regard to the desired deadtime.What am i missing out on? Do i really have to start bitbanging registers after there is such a comfortable way of setting it up and using normal pwm?thanks for all help i can get

author: Amper
author_rank: Frequent Contributor
timestamp: January 26, 2021, 04:56:23 pm
content: Ok, i have the suspition that i didnt understand the timer right, my goal is a 1:1 turn on ratio for both channels and a variable deadtime. Seems like changing the compare value will only shift the ratio between channels but not the duty cycle as i intended.So is there a way of changing the duty on the fly or is it fixed after initializing the timer?

author: Amper
author_rank: Frequent Contributor
timestamp: January 26, 2021, 09:16:55 pm
content: Aaaaand i solved it. Looks like asking helps thinking about problems better (also i had some help).Turns out its the case as i said in my last post, it wont work with the advanced timer and dead time.In the end i just took timer2 channels 1 and 2, the timer set so phase correct mode 2 so the signals are centered on each other, ten inverted one signal and added/subtracted the dead time in my program feeding the two compare values separately. Next all try getting the preload to work to prevent glitches and then find my hardware mistakes. Those converters seem to be a bit difficult when not running full duty it oscillates...Still thanks for everyone who considered reading, maybe this will be a help to someone some day.
[ATMega 0 series] - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: January 24, 2021, 09:58:18 am
content: I have done a design where I have used 0 ohm resistors to select between my PWM going to one pin or another on a H-Bridge chip. But it occurs to me that the event system may enable me to control the output pin of the PWM by re-routing it. So if I connect nothing to my PWM pins and set another pin to via the event system to follow that pin I assume it would work?Not sure where my dev board is right now. I previously put a square wave into one pin and got it back out of another but this time I am coming from inside the chip so really I guess the question is does the event signal come from the pin itself or from deeper inside on the pin's state register so that I can do this with an input or output.If this works it will be very handy later when I want to select any of several HB channels to a PWM channel.

author: cv007
author_rank: Frequent Contributor
timestamp: January 24, 2021, 03:13:01 pm
content: For mega0, you already have a total of 3 16bit pwm outputs that you can route to any port- for a mega4809 you have 6 ports so you have 3 pwm outputs that can be on one of 6 ports- 18 pins to choose from if you use only 1 pwm.You can also use the EVSYS to use any pin as a generator and an EVOUT pin as a user, where you can use the pwm output pin to be the generator pin, but there are only 3 evout pins that are not already pwm output capable.

author: Simon
author_rank: Unknown
timestamp: January 24, 2021, 03:20:02 pm
content: Hm, yes that is true although I have to setup entire configurations of all pins rather than be able to play with individual pins. The other option I have is to just use interrupts and then access whichever pin I want as not much else is happening.
PIC32MX270F256B, USB-I2S, in Harmony 3 - Page 1
Forum section: electronics / general

author: tryandgo
author_rank: Newbie
timestamp: January 24, 2021, 09:59:34 pm
content: Hi, I tried to create an USB-I2S device with PIC32MX270F256B in Harmony 3. (this MCU because of DIP package)The MCU is not recognized in USB, not a sign of connected device, just dead.Burned hex file from internet works, the MCU is initialized in USB - so the basic connection and 12MHz crystal works (PIC32MX270F256B_firmware_v2.9.1.X.production.hex)https://postimg.cc/gallery/B8YRmypCan anyone help me to find a mistake, please? Or is the MPLAB Harmony 3 buggy and useless for this kind of project?Thank you.

author: woofy
author_rank: Frequent Contributor
timestamp: January 25, 2021, 08:51:35 am
content: I don't know about harmony, but when using MCC to generate USB code for the PIC16's, it generates the drivers but no application code. Only if a checkbox is ticked will it generated an example application code, and even then you have to select the interrupts required.Check your start-up code to make sure you have at least a test application and it is being initialised fully,

author: tryandgo
author_rank: Newbie
timestamp: January 25, 2021, 09:08:11 am
content: You are correct, the app.c is empty
Writing on Padauk microcontrollers - Page 1
Forum section: electronics / general

author: takeda
author_rank: Newbie
timestamp: November 02, 2020, 11:42:57 pm
content: I recently saw Dave's great videos on Padauk.I asked JLCPCB if the can program Padauk micros during assembly and saidthey wont.Not sure but I think the programming is high voltage for programming the OTP.Maybe I could somehow program them directly in the target board?

author: retiredfeline
author_rank: Frequent Contributor
timestamp: November 02, 2020, 11:55:50 pm
content: Follow this epic thread for info on programming Padauk yourself:https://www.eevblog.com/forum/blog/eevblog-1144-padauk-programmer-reverse-engineering/msg3120676/#msg3120676

author: pastaclub
author_rank: Regular Contributor
timestamp: January 22, 2021, 01:48:26 pm
content: The Padauk datasheets state (usually on the 2nd last page) which pins of a particular chip are used for programming and what voltages the writer applies. Usually those are PA3..6 (and of course VDD which will be higher than normal).That means you can program them on the board, but you have to make sure that- the programming doesn't destroy other components- other components don't cause the programming to failSo it's safe to connect the programming pins to things like switches or external connectors, since you can be sure that those are open during the programming. Of course you can also take a package with more pins and dedicate some only to the programming. If VDD is a problem, you could have a jumper on that line which is open during programming and will be permanently closed afterwards.What I haven't found out yet is whether and how connected components will affect the programming. Since that is not documented, one will have to experiment.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: January 22, 2021, 11:15:30 pm
content: Are these controllers so good at the price that they will eventually abandon the use of ATtiny?Yes, a meager price for the case, but this is not the only price of their use.
Sourcing NXP µC (fs32k142hat0mlht) - Page 1
Forum section: electronics / general

author: Big_Mike
author_rank: Newbie
timestamp: January 20, 2021, 12:03:16 am
content: I am working on a project that uses the fs32k142hat0mlht µC as a motor controller. Unfortunately, it seems like that µC is completely out of stock. The current lead times are roughly 1-2 years.I'm wondering if I can buy a board that uses the µC and desolder the µC from the board. The most obvious board to attempt that on is the eval board, which is priced at $89 USD. Another board is the motor control eval board, priced at ~$300 USD. Does anyone know if there are any commercial boards with said µC on it for cheaper? Or if not does anyone know any other ways to get the µC?Unfortunately the project is based around the use of the NXP chip so substituting is not an option.Cheers!µC board link and availability:https://www.nxp.com/part/FS32K142HAT0MLHT#/Eval Board:https://www.nxp.com/design/development-boards/automotive-development-platforms/s32k-mcu-platforms/s32k144-evaluation-board:S32K144EVB

author: stevelup
author_rank: Regular Contributor
timestamp: January 20, 2021, 09:23:50 am
content: This company claims to have 116 on hand:-https://www.iodparts.com/part/fs32k142hat0mlht

author: S. Petrukhin
author_rank: Super Contributor
timestamp: January 20, 2021, 09:42:28 pm
content: LCSC "Available To Order" - inquire from, often the date of the order there is a 3-7 days.https://lcsc.com/product-detail/NXP-MCU_NXP-Semicon-FS32K142HAT0MLHT_C414048.html

author: Big_Mike
author_rank: Newbie
timestamp: January 20, 2021, 09:49:10 pm
content: Quote from: stevelup on January 20, 2021, 09:23:50 amThank you for the info! Unfortunately after I put in a quote request the site started selling a min quantity of 80 @ 7.27 each. I then got an email saying that they did not have the parts in stock anymore. It's crazy how fast this chip went, in the time it took to respond to my quote they changed their entire pricing scheme. I'll attempt to call but I'm not too hopeful.Again, thank you for the find even though it didn't pan out, I appreciate it!

author: Big_Mike
author_rank: Newbie
timestamp: January 20, 2021, 09:50:31 pm
content: Quote from: S. Petrukhin on January 20, 2021, 09:42:28 pmI put in a backorder, and have fingers crossed, thank you for the site.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: January 20, 2021, 11:39:21 pm
content: Quote from: Big_Mike on January 20, 2021, 09:49:10 pmI have an idea that the MPU market has been attacked by huckster and is creating a agiotage.Or management got a new (old) idea as a viral infection of how to raise prices.A similar situation is with the STM32 MPU.
Atmel micros with Qtouch on MPLAB IDE - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: January 20, 2021, 08:23:20 pm
content: Hi,now that Microchip bought Atmel, does anybody know if you can program and do full development for Atmel micro in MPLAB, especially:- especially QTouch and- pin configuration graphicallyThank you
Alinx AX309 - Page 1
Forum section: electronics / general

author: Pluscrafter
author_rank: Regular Contributor
timestamp: February 21, 2019, 04:07:34 pm
content: Is this ahttps://www.ebay.ch/itm/Xilinx-Spartan-6-XC6SLX9-2FTG256C-FPGA-development-board-256Mbit-SDRAM/273708221401?hash=item3fba4803d9:g:sPMAAOSwZttbpI87Alinx AX309 board? It sees very similar. And whitch pakage is it TQG144?

author: tsman
author_rank: Frequent Contributor
timestamp: February 21, 2019, 04:19:20 pm
content: Looks like an unbranded clone. It says BGA in the description and XC6SLX9-2FTG256C is a 256-FTBGA part.

author: Pluscrafter
author_rank: Regular Contributor
timestamp: February 21, 2019, 04:23:00 pm
content: ThanksOversee that in the description.

author: Pluscrafter
author_rank: Regular Contributor
timestamp: February 24, 2019, 06:35:11 pm
content: Can you program the FPGA and SPI Flash directly from Xilinx ISE or do you need any other programs. I can't find any information or examples only the user manualhttps://kupdf.net/download/ax309-xilinx-spartan-6-development-board-users-manual_59ed04de08bbc5d83ceb8972_pdf.

author: kdupreez
author_rank: Newbie
timestamp: January 19, 2021, 07:49:55 am
content: Quote from: Pluscrafter on February 24, 2019, 06:35:11 pmI struggled a LOOONG time to figure this out and stumbled on this site.. I was able to eventually figure it out and got my AX309's SPI flash attached to a Spartan6 programmed. You have to jump through a few hoops.1. You have to program HDL into the FPGA to act as an SPI bridge.2. You have to generate the PROM file via Xilinx iMPACT (I only have old Xilinx ISE 14.7)3. Program it via XC3SPROG using the "connected SPI Flash (ISF Mode)"For step 1 - you can find Verilog code for Spartan6 to do the boundary scan SPI bridge programming here..https://svn.code.sf.net/p/xc3sprog/code/trunk/bscan_spi/Use the relevant Verilog codes for Spartan6 platform, then modify the UCF file with your specific SPI flash pin connections, create the .bit file and program the FPGA.(I have attached an ISE project file ready if you need one)Then go over to the actual .bit file you want to program to the SPI flash and open iMPACT and create the PROM file.Finally use XC3SPROG to validate, erase and program your flash by using ISF Mode.Drop me a msg if you need help.
Arduino: Case for use with a "Screw Shield" needed - Page 1
Forum section: electronics / general

author: nightfire
author_rank: Frequent Contributor
timestamp: January 17, 2021, 08:29:23 pm
content: As I am beginning to have some thoughts about an upcoming project involving illumination management of some LED, I thought about using an Arduino as some cheap alternative to a "real" PLC (well, maybe some small PLC like the Siemens Logo series, or Moeller Easy).As I really prefer some sturdy screw connectors or clamps, I don't like that flimsy Dupont breadboard stuff.A possible solution is here:https://www.seeedstudio.com/Screw-Shield.htmlNext problem: I want to put that all into some case, so that all that stuff is neat and tidy on my workbench, but I failed in finding a case for that stuff where all that screw connectors are also put in nicely...Ideas or suggestions? Maybe there is an Arduino variant/clone that already has this stuff onboard instead of Dupont connectors?

author: ledtester
author_rank: Super Contributor
timestamp: January 17, 2021, 10:23:22 pm
content: Another idea is to attach the terminal blocks to the case itself like in this video:

author: drvtech
author_rank: Regular Contributor
timestamp: January 18, 2021, 12:32:22 am
content: Is this the sort of thing you're after?https://www.controllino.com/shop/

author: nightfire
author_rank: Frequent Contributor
timestamp: January 18, 2021, 10:00:29 am
content: Quote from: drvtech on January 18, 2021, 12:32:22 amYes- thats better that what I originally dreamt of ;-)(But also somewhat more expensive...)For me, somewhat in the middle would be my dream- like a simple case in the price range of maybe 20 €, that could accomodate say, an Arduino Uno (the standard starter model) and a screw shield as simple solution.Yes, some screw terminals could also be equipped on a case and wired internally, but I would rather like to avoid that becaus every joint in those fragile things is one too many, given mechanical stability etc. If nothing else comes up, I will think about it ;-)
help with pic16f88 comparator - Page 1
Forum section: electronics / general

author: gatoulisss
author_rank: Contributor
timestamp: January 17, 2021, 04:55:04 pm
content: hello i need help on programming a pic16f88 comparatori have a programm running on pic16f628a using comparator and i want to upgrade now my hardware using pic16f88the thing is that using same code as pic16f628a to pic16f88 the comparator doesnt seem to workany help what might be wrong?im using mikro c pro and pic kit 3thank you!
Read Mcu MC68HC908AZ60 problems - Page 1
Forum section: electronics / general

author: aronfields
author_rank: Newbie
timestamp: January 16, 2021, 10:02:11 pm
content: Hello, this is my first post so go easy lolI supply and program vehicle keys for a living. I currently have an immobiliser module and i am lead to believe that the key data is held in the mcu, im using a tool called vvdi prog to read the mcu. The software i have states that i need to read Motorola MC68HC908AZ60 / AZ32 - 64 pin QFP, however in my circuit i have MCU:Freescale logoVDOs681A2ZC000323142L52HQQCC0614.I am unable to read this and im thinking i may be doing something wrong can anyone give me any help or tips

author: amyk
author_rank: Super Contributor
timestamp: January 17, 2021, 12:13:00 am
content: 2L52H is a mask ID for MC68HC08AZ32, not a '908...
watchdog in stop mode  - Page 1
Forum section: electronics / general

author: tariq
author_rank: Contributor
timestamp: January 15, 2021, 11:58:14 am
content: hiI'm using stm32 F103RBT8 i want to set my watchdog time out to 15 seconds. in IWDG i have no problem to configure 15 sec time out but the problem is i cant turn off IWDG once i turned it on and in my code i can't reset each time before stop mode.in WWDG it's clock source stops in stop mode but the problem is that my timeout is in ms because the frequency APB1 which is in Mega hz is too high and i can't make it in kilo hz because of other peripherals clocks so i can't make 15 seconds time out.is there a way to stop IWDG before stop mode or a way to set wwdg time out 15 second and other peripherals frequencies keep their values?thank you.
PIC18 timer help - Page 1
Forum section: electronics / general

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: January 11, 2021, 07:17:21 pm
content: I'm trying to use a timer in a PIC18F27Q10. It looks like registers TMRxL and TMRxH store the period value for the timer according to the MCC setup page. However, the data sheet says these registers are used for the accumulated value. I need to set specific accumulated values (reset the count to zero) without altering the overall period value. I don't see how to accomplish that or understand how the timer operates if the registers are one in the same. Please help.

author: Ian.M
author_rank: Super Contributor
timestamp: January 11, 2021, 08:17:38 pm
content: Odd numbered timers don't even *HAVE* a period register. They roll over from 0xFFFF to 0x0000. However it is possible to configure a CCP module to clear its odd numbered timer on compare match, effectively using its CCPRx SFRs a the limit register for the timer.In general you should always believe the datasheet (as corrected by any applicable errata) over MCC, unless you have specific evidence to the contrary.

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: January 11, 2021, 09:29:35 pm
content: Yea, I figured out the roll over part. I decided to set it up as a self interrupting timer with timer 3 as the clock source, that stops on roll over and is then externally restarted. It's not elegant, but it works for my purposes.
Atmega 328p external crystal problem - Page 1
Forum section: electronics / general

author: sidlauskas
author_rank: Contributor
timestamp: January 11, 2021, 09:12:49 pm
content: Hello,I'm just trying to figure out why this particular external crystal is not working with Atmega 328phttps://datasheet.lcsc.com/szlcsc/Seiko-Epson-X1G004451000200_C16171.pdf(SG5032CAN) whilehttps://eu.mouser.com/ProductDetail/TXC-Corporation/7B-16000MAAJ-T/?qs=65dIHZNch5veu5KSRnAmyw%3D%3Dworks perfectly

author: wraper
author_rank: Unknown
timestamp: January 11, 2021, 09:24:10 pm
content: Because you use oscillator instead of crystal.

author: retrolefty
author_rank: Super Contributor
timestamp: January 11, 2021, 09:27:43 pm
content: They are two different components, first is an active quartz crystal oscillator the second is a passive quartz crystal resonator. Either can be made to work with your Atmel but requires proper wiring and perhaps different lock bit requirements.
ZeroDMA SPI RX/TX - Page 1
Forum section: electronics / general

author: Aiy
author_rank: Regular Contributor
timestamp: January 23, 2021, 09:09:59 pm
content: Hello Everyone,I recently tried to get simultanous SPI receive and transmit working on the Atmel SAMD21 with ZeroDMA on the Arduino platform with an Adafruit Trinket M0. Adafruit provides two TX arduino examples, but none with RX/TX simultanously.I struggled with it for a few hours but could not get it to work correctly..The arduino SPI uses a for-loop to feed the SPI TX register and off-load the TX register and is only 8/9-bit wide. On the oscilloscope I saw that the communications were not "back-to-back" between bytes which annoyed me as I was communicating with an SAR-ADC (TI ADC128) whose datasheet specifies that there should not be any interruptions during ADC conversions as the ADC is balancing a measurement Cap inside it..Has anybody got ZeroDMA SPI RX/TX working on these processors or is it intentional from Adafruit not to include it because it does not work reliably ?Best regards

author: ataradov
author_rank: Super Contributor
timestamp: January 23, 2021, 10:36:45 pm
content: I have no idea what ZeroDMA is, but simultaneous RX/TX on SPI with DMA works on D21.But because DMAC needs to switch descriptors for each byte, it limits practical SPI clock to about 4 MHz. If you go higher, it does not have enough time to switch the channels.If blocking code is acceptable, them a more closely optimized version of the polling code could go much faster.
Using HAL_SPI_Transmit_DMA() from STM32duino? - Page 1
Forum section: electronics / general

author: Rudolph Riedel
author_rank: Regular Contributor
timestamp: January 04, 2021, 03:38:13 pm
content: Hello,after playing with my code for a couple of days now, on and off,, I used PlatformIO to build a "stm32cube" project for the Nucleo-64 board with STM32F446RE I have.I added the necessary extra code like SystemClock_Config() that STM32CubeMX generated and the SPI and DMA functions that I implemented for the STM32duino and that are using HAL and LL functions.And damn, it works, sending data over LL_SPI_TransmitData8(), HAL_SPI_Transmit() and HAL_SPI_Transmit_DMA()just works.To finally come to a question, what is failing with STM32duino is the DMA interrupt.HAL_SPI_Transmit_DMA() needs the associated IRQHandler to call HAL_DMA_IRQHandler().So I am using this now:void DMA2_Stream3_IRQHandler(void){HAL_DMA_IRQHandler(&eve_dma_handle);}And this works just fine in the stm32cube" project.But on the STM32duino side this IRQ handler never gets called.What extra steps do I need to make this interrupt handler work on the STM32duino side?

author: ozcar
author_rank: Frequent Contributor
timestamp: January 04, 2021, 05:46:40 pm
content: Perhaps you have to addextern "C"to your interrupt routine definition.If that does not work, you may be better off asking onwww.stm32duino.com.

author: Rudolph Riedel
author_rank: Regular Contributor
timestamp: January 04, 2021, 06:10:43 pm
content: That was exactly what was missing, thanks!extern "C" void DMA2_Stream3_IRQHandler(void){HAL_DMA_IRQHandler(&eve_dma_handle);}This is only required for this one, the callback function HAL_SPI_TxCpltCallback() is fine without it.And I am not even using C++, the file is named .cpp since the Arduino classes require it.Or well, maybe there is annother way to use for example the SPI class from a .c file but it has been a while since I lookedfor a solution to this.