hybridfree/eevblog-posts huggingface dataset:
USB Host Stack for Zephyr - Page 1
Forum section: electronics / general

author: unscripted
author_rank: Contributor
timestamp: November 12, 2024, 02:16:59 pm
content: So Zephyr does not currently support a USB Host stack for Mass Storage Class which I need for my STM32 project. Has anyone worked in porting other stacks like TinyUSB to Zephyr? Or STM32Cube USB Host Library? Any recommendations?

author: voltsandjolts
author_rank: Unknown
timestamp: November 12, 2024, 03:06:28 pm
content: Zephyr has a new experimental usb stack which includes mass storage support.https://docs.zephyrproject.org/latest/connectivity/usb/device_next/usb_device.htmlhttps://docs.zephyrproject.org/latest/samples/subsys/usb/mass/README.html#usb-mass

author: unscripted
author_rank: Contributor
timestamp: November 12, 2024, 03:12:49 pm
content: Quote from: voltsandjolts on November 12, 2024, 03:06:28 pmAFAIK, that's USB Device support, not USB Host.QuoteWhich I think it is not what I'm looking for. I'm looking to enumerate an external USB flash drive.

author: voltsandjolts
author_rank: Unknown
timestamp: November 12, 2024, 03:18:53 pm
content: Sorry, I skim read your first post and missed the keyword 'host'. Twice. My bad.
ch32v003 programming issue - Page 1
Forum section: electronics / general

author: keikai
author_rank: Contributor
timestamp: November 11, 2024, 12:18:45 am
content: In arduino ide 2.3.3 with wch board library (1.0.4) the pins dont work as expected. When i put PC3 pin high all the other pins with the name "PC"go high. if i put PC3 high and PC4 low. both pins become a voltage divider so instead of giving 3.3v it gives 1.5v . There is no short on the adapter board. If i try 1 Pin from PC series and one from PD series they work independently.I know the PC pins are grouped by 1 register but turning on PC1 should not turn on all the PC2- PC7 pins.

author: brucehoult
author_rank: Super Contributor
timestamp: November 11, 2024, 02:41:14 am
content: I don't see how that could happen.Ok, so all pins on the same port going HI and LO together could be a bug in the Arduino library.But a voltage divider effect?That's just got to be a busted chip, Shirley? If it's not happening externally. Whether the chip was faulty when you received it is a different question.

author: keikai
author_rank: Contributor
timestamp: November 11, 2024, 03:15:52 am
content: only these pins work PC0, PD4, PD5, PD6, PD7 without the issue. I will try to see if i can get i2c working on PC1 and PC2 to see if wch just didnt bother updating the pin config for 16 pin version. PD7 had to be changed to io in wch utility to function normally
Fake BME680 (Bosh temp/VOC sensor) ? [SOLVED] - Page 1
Forum section: electronics / general

author: Gabri74
author_rank: Regular Contributor
timestamp: November 08, 2024, 10:21:16 am
content: Hi, I was just wondering if anyone has ever been supplied with fake BME680 sensors.I've just bought two new modules to integrate into an existing project, but the readings are all wrong, to the point they seems fabricated.(link to the modulehttps://it.aliexpress.com/item/1005007312026696.html)(I know that the price was a bit to low for this kind of sensor, but being quite old and superseded by the 688 I risked it )I.e. on the other genuine sensor, those are the readings I get:IAQ: 83static IAQ: 52CO2: 620 (ppm)VOC: 0.8On the fake(?) sensor I get completely different readings:IAQ: 243static IAQ: 814CO2: 8140 (ppm)VOC: 1000Note that on the fake sensor:- IAQ and static IAQ are too far apart- VOC is constant at 1000 (!)- static IAQ is always equal to CO2 / 10 --> this in particular make me think the values are fabricatedI'm using the official Bosch library.Those sensors have a settle/burn in period and admittedly I've just stared using them for a few hours... but the values are two wrong to be a genuine part...Does anyone know if it is possible to detect using some I2C commands if the chip is fake or genuine ?

author: wraper
author_rank: Unknown
timestamp: November 08, 2024, 10:40:16 am
content: I would not be surprised if sensor is genuine but screwed up during PCB production.

author: Gabri74
author_rank: Regular Contributor
timestamp: November 09, 2024, 04:26:42 pm
content: Thanks for the reply.I turned out it was my fault all along... I forgot that I did implement calibration saving when full accuracy was reached.When I swapped the old sensor with the new on my test unit, I forgot to clear the calibration.It appears that calibration parameters for those sensor could be quite different from one another, and the oldcalibration loaded at power up was screwing up the algorithm and giving me saturated values for some parameters.
Using STM32 FSMC with FTDI FT232/FT2232 CPU FIFO mode - Page 1
Forum section: electronics / general

author: powerfeatherdev
author_rank: Newbie
timestamp: November 08, 2024, 10:23:57 pm
content: Hi, anybody here have experience connecting an FT232/FT2232 chip to an STM32 using the FSMC peripheral (or another MCU with maybe similar peripheral, like PIC32 PMP or ATSAM EBI)? Have you managed to get it to work, and if so, how was the performance?
AVR- Reading Fuses through pymcuprog - Page 1
Forum section: electronics / general

author: sanka1p
author_rank: Contributor
timestamp: November 04, 2024, 03:14:38 pm
content: Hi All,I am flashing Firmware on my Atmega1608 usingpymcuprog. When I read the flash after programming, I can see that the hex file is there, but the Fuses are not being changed i.e all the fuse bits have default values. My question is what is the command to change specific fuse bits in pymcuprog? I am able to read fuses, but need help with command to change the fuse bits. I do set the fuse bits in my main firmware, but that doesn't seem to work.

author: westfw
author_rank: Super Contributor
timestamp: November 08, 2024, 09:03:23 pm
content: Note that many AVR build procedures do not include the fuse information when they generate .hex files (using avr-objcopy.)AFAICT, if your .hex file has fuse information at "address" 0x820000, then pymcuprog should be programming them, and they can also be programmed manually with a command like:Code:Write fuse byte 1 to 0xE0 on a kit:- pymcuprog write -m fuses -o 1 -l 0xE0
STM8L151 - Page 1
Forum section: electronics / general

author: graphtronics
author_rank: Contributor
timestamp: November 19, 2024, 02:27:40 am
content: Hello ForumHope to find some help for the display and ADC connection.MCU: STM8L151 XYZ 48 pinsDISPLAY: LEDa) Is it correct to assume that the GPIO voltage is either 3.3 V or 5 V? (since it considers them as 5 V tolerant).b) Then, select resistor depending on the LED Vd and intended I?c) Is the GPIO voltage suitable for common anode/cathode?ADC1) is there a dedicated pin (maybe 24 PF0 ) or can any GPIO be used?Thanks

author: Postal2
author_rank: Frequent Contributor
timestamp: November 19, 2024, 04:02:00 am
content: Let's start with the 2nd question. It is impossible to determine the resistor for the LED, because different voltages drop on them, from ~1.2 to ~2.5 volts, you must measure this first. From this we get the answer to the first question, if it concerns LEDs powered by 5 volts. 4 pins have tolerance to 5 volts, 2 of them are I2C, the rest are not tolerant. If we occupy PF0, then the only one output DAC_OUT will be occupied, and we would like to have it. Therefore, it is better to work out the display first, and use what is left for the ADC.

author: Chicane
author_rank: Contributor
timestamp: November 21, 2024, 07:34:00 am
content: Quote from: graphtronics on November 19, 2024, 02:27:40 ama). If the GPIOs are 5V tolerant on a 3.3V Vcc part, it means the load you're connecting to those GPIOs can pull them up to 5V. In other words, the outputs will sustain 5V at whatever current they are rated for.In this case, the Anode of your LEDs can be powered from a 3.3V rail or 5V rail. Hook them up to whichever one has higher current capability. If your main power is 5V and you're using LDO to drop it to 3.3V only for the microcontroller, then power your LEDs from 5V through an appropriate resistor.b). To calculate the resistors, you need to know the voltage they are powered by (3.3V or 5V in your case) and the voltage drop of the LED itself, found in the datasheet of the particular LEDs in your design. Alternatively, you can estimate the voltage drop by the color of your LEDs (red=1.7-2V, green=3.4V, blue=3.5-4V, white=4V). Finally, you need to know the current you need to supply to your LEDs to achieve the desired brightness. I would recommend to start with 5mA and stay under 10mA, for the safety of your MCU. Obviously, you need to find in the datasheet of your MCU the current its GPIOs are rated for first.c). The GPIOs are not suitable to drive common A or K, unless the sum of the currents through all the LEDs doesn't exceed the GPIO's current rating. Just add an external transistor, mosfet or BJT. Otherwise you have to calculate your LED resistors for 2mA at most and your display will likely be fairly dimm. And that's in case you have a 20mA capable GPIOs on your MCU.Search the Web for LED resistor calulator, I'm sure you'll find plenty.
How do I probe an MCU which needs pullups/downs on start-up?  - Page 1
Forum section: electronics / general

author: petemate
author_rank: Regular Contributor
timestamp: November 03, 2024, 08:03:21 pm
content: Hi everyone,I'm working on probing a system based on an ST10R172L MCU - Its an older device which is configured to run as 16 bit data and 24 bit address buses. This configuration is set by pullups/downs on PORT0(16 bits). Each pin in PORT0 has an internal pull-up, so the way to change config is to add external pull-downs, thus setting bits for various settings, e.g. data bus width, whether or not the bus is multiplexed and XTAL PLL multiplication factor. These values are read at reset/power-up, saved to a special register, and then PORT0 is configured according to whatever its config registers are set to(GPIO, special function, etc).The problem is that when I hook up my logic analyzer, it loads the line enough to pull down all pins on PORT0, thus forcing an erroneous config.Here is a waveform without the analyzer connected:Here is a waveform with the analyzer connected:Here is the equivalent circuit of the logic analyzer:As you can see, the logic analyzer poses 100k to ground, so its quite puzzling that such a high value can pull down from 3.3V to 0.8V. However, it does match with the datasheet of the "PORT0 configuration current", which says that you can't pull more than 4uA and have the port read as high(am I reading that right?):So my problem is, how the hell do I hook this PORT0 thing up to my logic analyzer without dragging down the config. Is there really nothing to do but to add some sort of buffer? This couldn't have been an uncommon a problem in the old days(pre JTAG, SWD and whatnot), so maybe some old-timers can tell me how to approach this?Thanks!

author: Kim Christensen
author_rank: Super Contributor
timestamp: November 03, 2024, 08:10:26 pm
content: I'd try adding some external pullup resistors on the lines loaded by your analyzer. Try maybe 10K?

author: petemate
author_rank: Regular Contributor
timestamp: November 03, 2024, 08:20:36 pm
content: Quote from: Kim Christensen on November 03, 2024, 08:10:26 pmThats a a great idea - don't know why I didn't think of that! Thanks!
LPDDR2 32bit chip on 16 bit bus - Page 1
Forum section: electronics / general

author: glenenglish
author_rank: Frequent Contributor
timestamp: October 31, 2024, 12:57:04 am
content: I dont know a whole lot about DDR control protocol bitty gritties. I know enough to make most workHowever, I have a project that needs 16 bit LPDDR2 interfaceand I have several trays of 32bit LPDDR2 in stock.Those that know LPDDR2 will know they're the same footprint, just a few extra pins used for the upper two banks (extra DQs, extra DQSs, extra mask bits)However first thought that comes to mind if just ignoring the upper two lanes..... is when the ram does a burst read, its going to burst the readout from the memory across all four lanes, and thus the burst lengths when the controller requires say 64 bytes which might be 16 clocks (ddr) over 2 lanes, the chip will expect to output 8 clocks over 4 lanes. so that isnt going to work.Anyone been down this before I read up the nitty- gritty detail ?AFAIKT - from reading the datsheets, the answer is no, and I should buy 16 bit RAMs instead.-glen

author: asmi
author_rank: Super Contributor
timestamp: October 31, 2024, 01:10:50 am
content: I'm going to to side with datasheet on that one. I've read some article about using DDR3 x16 module in x8 mode, which seemed possible, but I don't know much beyond that.

author: glenenglish
author_rank: Frequent Contributor
timestamp: October 31, 2024, 06:51:39 am
content: Some reading later.....The burst length "BL" is in words, then the chip and the controller won't care, and that will work.just got to tie the bit mask for the high lanes low. things to think about- unaligned accesses, wrapping bursts over boundaries.what else... DQ pattern calibration output is ram to controller, so that's fine.anyone got any informed comment ? Aol it will cost is a bit of power, all those extra cells being refreshed/ charged.Interestingly the 32 bit and 16 bit parts have same operating currents LOL. probably same chips but 32bit are the binned parts .
STM32 USB Mass Storage Class issue - Page 1
Forum section: electronics / general

author: Red_Micro
author_rank: Regular Contributor
timestamp: November 01, 2024, 02:50:27 pm
content: I'm testing the STM32 USB MSC using FATFS. I'm using two different flash drives, one generic 128GB and one 8GB encrypted. When using the 128GB one, things work well. See picture "generic.PNG". However, with the encrypted one, I get fatal error. When the stack resets the USB port, then the device stops responding. This encrypted flash drive works well in any computer that I connect it to. I just enter the password via the hardware keypad and that's it. Does anyone know about the issue I could be facing? I would expect the encrypted flash to be more problematic obviously but I'd like to understand if I need to set up things differently on the STM32 end to make it work.

author: voltsandjolts
author_rank: Unknown
timestamp: November 02, 2024, 09:41:20 am
content: I see you also posted this question on the STM32 forums and ST said they'll contact you directly. Hopefully they can help.https://community.st.com/t5/stm32-mcus-embedded-software/stm32h745-usb-msc-with-encrypted-flash-drive/td-p/738089

author: peter-h
author_rank: Super Contributor
timestamp: November 03, 2024, 06:19:01 pm
content: The ST code for USB MSC, and FatFS, is nothing to do with encryption. It is just implementing a block device.Where is the encryption done?
Segger embedded studio can't live watch variables when target is runing - Page 1
Forum section: electronics / general

author: eebbb
author_rank: Newbie
timestamp: October 30, 2024, 07:10:50 am
content: I am using Segger embedded studio8.18+Jlink12 to debug a RISC-V MCU(HPM6284).I added some global variables to the watch window and set the refresh rate to twice a second.In fact, the variables are refreshed only when the target stopped. When the target on running, the variables in the watch window are all 0.Is there something I need to set?Please gave me some help, thanks!!

author: eutectique
author_rank: Frequent Contributor
timestamp: October 30, 2024, 09:47:47 am
content: You would be better off asking your question on Segger's forum. They even have a board dedicated to Embedded Studio:https://forum.segger.com/index.php/Board/9-SEGGER-Embedded-Studio-related/

author: eebbb
author_rank: Newbie
timestamp: October 30, 2024, 10:32:25 am
content: Thanks a lot, I have asked a question there, hope it will solve the problem.

author: mino-fm
author_rank: Regular Contributor
timestamp: October 30, 2024, 02:37:09 pm
content: Watch1 != Live Watch

author: eebbb
author_rank: Newbie
timestamp: October 30, 2024, 02:52:08 pm
content: I can't find any "Live watch" window, however in the upper left corner of the watch1 window, there is a frequency setting drop-down box.I selected twice per second, I think this is the frequency at which the variable is refreshed.But it doesn't work, the data remains 0 when the target is running.
Identifying Unknown IC from Clone HP Toner Cartridge Modules with e3 Logo - Page 1
Forum section: electronics / general

author: morgan_flint
author_rank: Regular Contributor
timestamp: October 23, 2024, 11:21:25 am
content: Hello all!I have a bunch of modules (photos attached) rescued from clone HP toner cartridges with an IC (presumably, a microcontroller) that I cannot identify, despite a lot of searching and even trying with ChatGPT...Other similar modules use PIC 12F683 and 16LF819, but the number of pins is not the same.The manufacturer's logo is something like e3 or e&, the marking is 0650, and a variable code below (OCP, ODM, ODO...)Could somebody there help identify the chips or, at least, the manufacturer?Thank you very much!!

author: coromonadalix
author_rank: Super Contributor
timestamp: October 23, 2024, 11:41:31 am
content: refocus on the logo image and try a google search by image ??maybe from obscure places like Ali Taobao etc ...or try to power them up and some sniffing with a bus pirate or other tools ... could be any micro controller in disguise ?? thru the jtag port / other portsince you have 2 contacts for the toner ... unless completly wrong i'm not sure dallas 1 wire systems use such mcu's ?? data thru the supply line ??

author: gamalot
author_rank: Super Contributor
timestamp: October 23, 2024, 01:09:09 pm
content: The 'e3' mark means pins are tinned, which is specified in IPC/JEDEC J-STD-609.

author: amyk
author_rank: Super Contributor
timestamp: October 25, 2024, 03:13:39 am
content: If you figure out the pinout that may give more information on what to search for. The 5-pin unpopulated header on the right is obviously the programming interface.You might find this interesting:https://wiki.cuvoodoo.info/doku.php?id=printer_cartridge
need help for a circuit plan and a pcbdesign - Page 1
Forum section: electronics / general

author: spiderboy
author_rank: Newbie
timestamp: October 24, 2024, 11:21:49 am
content: Hi everyone, i have two topics in which i am stuck:dodow is a gadget that helps insomniacs by a blue led, that projects a breath simulating cone at the ceiling. i would like to build this gadget with a atiny85 microcontroller but i am stuck. could somebody design me a circuit plan for the following parts?:- atiny 85 (6pins)- led (dont know which one, it has to be able to do a small and bigger getting cone)- 220 ohm resistance- ttp223 touchpad-ams1117 (3.3V) voltage regulator- lithiumion battery 3.7v (500-1000mah)- charge controller (tp4056)-usbc socket (whatever you want suggest one pls)I think those are all the parts needed...?Second i would like to design the platine with kicad so i can easily print it.Could somebody pls design me a circuit plan and the pcb design in kicad?Thanks for help and im sry for bothering...spiderboy

author: ppTRN
author_rank: Regular Contributor
timestamp: October 24, 2024, 01:09:25 pm
content: I would rather focus on how you are planning to produce the cone at the celing. I think you will need to mechanically block the light from the led in order to make it smaller and then bigger again. Using just a microcontroller you will only be able to control its luminosity
Found 8951 clone, programming advice please! - Page 1
Forum section: electronics / general

author: throbscottle
author_rank: Contributor
timestamp: October 23, 2024, 01:09:45 am
content: I have found a Syncmos sm8951ac25pp, on a board dismantled from an old money counting machine, which as far as I can make out just needs connecting to a serial port to erase and re-program it. I'd quite like to have a tinker with it, flash some LEDs, whatever. It would be a useful learning exercise if nothing else.I also have, bought long ago, a USB to serial converter (I think Connexant but I don't have it to hand to check) with which I failed to make a working serial port PIC programmer about 15 years ago. Now, I'm given to understand that my original project didn't work because the timings with these converters aren't quite right, so I was using a dodgy thing to attempt a dodgy thing. But 8951 needs a direct connection with no funky stuff in between - I think. So do you think it will work?If not, I found a project for an Arduino based programmer - which seems overkill, but I am starting from a place of deep ignorance here...

author: PCB.Wiz
author_rank: Super Contributor
timestamp: October 23, 2024, 04:28:34 am
content: Quote from: throbscottle on October 23, 2024, 01:09:45 amThat's very old.The 2002 Data sheet mentions #EA/VPP and says 'To program the flash block, a commercial programmer is capable to do it.'That indicates it is a 12V or similar Vpp part, without a boot loader.Unless you have an old dedicated device programmer lying around, you are better to find a modern part that includes a bootloader.AliExpress have cheap boards with STC8H8k64U parts that are light years ahead of that Syncmos part.Or if you intend to spend a bit more time, find an Evalboard that includes a Debugger module - eg SiLabs or Nuvoton or ABOV.

author: throbscottle
author_rank: Contributor
timestamp: October 23, 2024, 09:32:23 pm
content: Ahhh... That's a shame. In that case I might try to have a tinker when my to-do list drops below 70,000One good thing - it has caused me to see what 8051 descendents are out there, so I might well follow your suggestion since I've been intrigued about them for a long time. STC8H8k64U is cheap!
ch32v003fun or PlatformIO code compiled in MounRiver Studio - Page 1
Forum section: electronics / general

author: corgon
author_rank: Contributor
timestamp: October 22, 2024, 06:33:12 am
content: Hello,I’ve discovered that it's possible to compile code originally written for PlatformIO or the alternative HAL ch32v003fun directly in the native MounRiver Studio environment without any issues.There's no need to modify anything—just create a new project in MRS, delete a few files, and replace them.The exact steps and a specific example using ch32v003fun can be found on my GitHub:https://github.com/lennox-13/ch32v003fun_MounRiverStudioEverything works, including debugging and flashing via WCHLink-E.
PIC18F external interrupts not triggering - Page 1
Forum section: electronics / general

author: newtekuser
author_rank: Frequent Contributor
timestamp: October 21, 2024, 02:14:20 am
content: Using PIC18F46K40 and in my simple test code, pin RA4 is connected to an LCD backlight which should be turned on when pressing the button connected to RB0 using external interrupt, but it never triggers. Very similar approach works just fine on PIC16F887. Is there something I missed in the setup? The wiring is exactly the same as I'm just swapping MCUs on the breadboard.LATAbits.LATA4 = 0;INTCONbits.INT0EDG = 0;PIR0bits.INT0IF = 0;PIE0bits.INT0IE = 1;INTCONbits.GIE = 1;INTCONbits.PEIE = 1;void __interrupt() isr(void){if (PIR0bits.INT0IF == 0){LATAbits.LATA4 = 1;PIR0bits.INT0IF = 0;}}

author: newtekuser
author_rank: Frequent Contributor
timestamp: October 21, 2024, 04:08:54 am
content: My bad, wasn't checking for the interrupt correctly. The fix was:Code:if (PIR0bits.INT0IF)
Provisioning a brand new EEPROM - Page 1
Forum section: electronics / general

author: frusciante89
author_rank: Newbie
timestamp: August 14, 2023, 06:26:31 pm
content: Hello everyone!I'm relatively new to the world of EEPROM so apologises in advance if I sound like a noobThis is my application: I have a magnetic encoder I need to use for a robotic project, the icHaus ic-MU200 (https://www.ichaus.de/product/ic-mu200). I've bought their eval board to test it and everything looks great. This is the eval board:https://www.ichaus.de/upload/pdf/MU200_EVAL_MU6M_evalmanual_A1en.pdfAfter the first evaluation tests, I've made my own board based on the schematics available in the datasheets. I have soldered all the components and I've started testing the board with their evaluation software.Everything works great: I can read the sensor, I can run a calibration and I can modify the RAM parameters. However, I can not write to the EEPROM - the error I'm given is that the I2C can't find the EEPROM. I'm stuck here!A couple of details:- I've used the same EEPROM they use in the MU6M board, a 24LC16B/P- I've not done anything to the EEPROM, I literally took it out of the packaging it came with and I've soldered it in placeAny ideas on what might be going wrong here? Do I need somehow to provision the EEPROM?

author: ataradov
author_rank: Super Contributor
timestamp: August 14, 2023, 06:42:42 pm
content: No provisioning is required, it should just work. What exact part number have you used for your board? Do you have pull-up resistors on the SCL/SDA lines?

author: ozcar
author_rank: Frequent Contributor
timestamp: August 14, 2023, 06:48:31 pm
content: Quote from: ataradov on August 14, 2023, 06:42:42 pmAnd, have you tied address lines the same?

author: ataradov
author_rank: Super Contributor
timestamp: August 14, 2023, 06:49:46 pm
content: That specific EEPROM ignores address lines. So, assuming the same exact part number was used it should be fine. SOT-23 version used on their board does not even have address pins.

author: frusciante89
author_rank: Newbie
timestamp: October 19, 2024, 08:52:14 pm
content: Just wanted to let you guys know that this was solved by applying the proper setting in the icMU200 chipTopic can be closed!
Microchip PICkit 5 PTG and multiple targets - Page 1
Forum section: electronics / general

author: gdr771
author_rank: Contributor
timestamp: October 16, 2024, 03:25:01 am
content: Anyone know if the Microchip PICkit 5 (Pk5) can be set up with the Programmer-To-Go (PTG) feature where multiple files are loaded for different target microcontroller models, and the Pk5 automatically selects the file matching the microcontroller? In case it matters, we have variants of the PIC18F familyWe have been successfully using the Pk5 as a field upgrade tool, where we load it with a firmware update and send it to distant service centers. They currently just plug in the Pk5 into the target board, power up the target, and press the (strangely hidden) button on the Pk5. The programming then automatically completes in seconds.I'd like to keep this process in place but for multiple versions of the target that use different microcontrollers. I'd rather not make the technician install the Microchip app and try connecting with Bluetooth in order to select the correct file, in order to make their life easier and to avoid possible mistakes from selecting the incorrect file. Multiple MicroSDHC cards are an option if one fancies searching for lost cards.I don't know how the Pk5 selects which file to use so maybe there's a way to have it match the file to the connected microcontroller.

author: voltsandjolts
author_rank: Unknown
timestamp: October 16, 2024, 07:11:53 am
content: https://www.microchip.com/en-us/development-tool/pg164150QuoteWhether it actually works, I dunno. Never used it.
AVR 0 series- Atmega1608 On-chip temp sensor - Page 1
Forum section: electronics / general

author: sanka1p
author_rank: Contributor
timestamp: October 15, 2024, 03:33:16 pm
content: Hi All,I am trying to use On chip temperature sensor of Atmega1608, I am getting a value of 160Kelvin even though my MCU is sitting on table and ambient temperature is approx 300Kelvin. I am attaching my temp sense code below please take a look at it. My CLK_PER is 10Mhz, CLK_ADC =(10Mhz/8) =1.25Mhz. I did use the reference code mentioned in datasheet.Code:unsigned int internal_temp(){unsigned int sigrow_offset = SIGROW.TEMPSENSE1; // Read signed value from signature rowunsigned int sigrow_gain = SIGROW.TEMPSENSE0; // Read unsigned value from signature rowunsigned int adc_reading = 0; // ADC conversion result with 1.1 V internal referenceVREF.CTRLA= VREF_ADC0REFSEL_1V1_gc;VREF.CTRLB = VREF_ADC0REFEN_bm;ADC0.CTRLC= ADC_PRESC_DIV8_gc | ADC_SAMPCAP_bm | ADC_REFSEL_INTREF_gc; // f_per =10mhz. adc_clk= 10mhz/8= 1.25mhzADC0.MUXPOS= ADC_MUXPOS_TEMPSENSE_gc;ADC0.CTRLD= ADC_INITDLY_DLY64_gc; // should be atleast 40ADC0.SAMPCTRL= 40; // should be atleast 40ADC0.CTRLB = ADC_SAMPNUM_ACC64_gc;ADC0.CTRLA= ADC_ENABLE_bm;ADC0.COMMAND= ADC_STCONV_bm;while(!(ADC0.INTFLAGS & ADC_RESRDY_bm));adc_reading = (ADC0.RES/64);unsigned int temp = adc_reading - sigrow_offset;temp *= sigrow_gain; // Result might overflow 16 bit variable (10bit+8bit)temp += 0x80; // Add 1/2 to get correct rounding on division belowtemp >>= 8; // Divide result to get Kelvinreturn temp;}

author: cv007
author_rank: Frequent Contributor
timestamp: October 15, 2024, 06:40:01 pm
content: Use the stdint.h typedefs instead of 'int', it will make life easier when you can see what size types you are using. I would also be aware that an 'int' overflows at 65536 on the avr so watch multiplications even if you think there will be no overflow.The datasheet gives an example, and uses the correct types-Code:int8_t sigrow_offset = SIGROW.TEMPSENSE1; // Read signed value from signature rowuint8_t sigrow_gain = SIGROW.TEMPSENSE0; // Read unsigned value from signature rowuint16_t adc_reading = 0; // ADC conversion result with 1.1 V internal referenceuint32_t temp = adc_reading - sigrow_offset;temp *= sigrow_gain; // Result might overflow 16 bit variable (10bit+8bit)temp += 0x80; // Add 1/2 to get correct rounding on division belowtemp >>= 8; // Divide result to get Kelvinuint16_t temperature_in_K = temp;With the adc_reading line obviously incomplete, so replace to get ADC0.RES/64.
MAX 31865 and PIC16F SPI - Page 1
Forum section: electronics / general

author: diegobincoletto
author_rank: Newbie
timestamp: June 15, 2024, 08:27:40 pm
content: I saw a glog on the same topic by NEXUS a couple of years ago.I'm facing the same problem, is it possible for NEXUS to share some code ?I'm stuck with writing to the MAX 31865 and getting a response.I read both the MAX31865 and PIC16F19326 satasheets.I have set up the configuration for SPI communication and sent a Write command.I can see the CD, Clock and data on SDO pin with an oscilloscope.I understand from the MAX31865 datasheet that after sending a Read byte (A7 = 0 + address) you have to send clock pulses to the slave MAX31865 in order to get an aswer, how do you do that?

author: TomS_
author_rank: Frequent Contributor
timestamp: June 15, 2024, 09:39:00 pm
content: Every time you send a byte you will receive a byte, and that involves generating 8 clocks.Sometimes a device needs one or two dummy bytes before it is ready to send the requested data, so just send a few more bytes as required, ignoring what ever is received until the device starts sending data. The number of dummy bytes should be detailed in the datasheet.If it needs less than 8 clocks then you'll have to take manual control of the clock line and toggle it yourself.

author: simonnavak
author_rank: Newbie
timestamp: October 14, 2024, 02:32:19 am
content: I faced a similar issue before and managed to get it working. After sending the Read byte (A7 = 0 + address) to the MAX31865, you do need to send extra clock pulses to the slave to get the response.

author: mikerj
author_rank: Super Contributor
timestamp: October 14, 2024, 07:06:26 pm
content: You just write "dummy" bytes (e.g. 0xFF) to the MSSP module to make it produce another 8 clock pulses.
Difference between original and clone AVRISP MKii? - Page 1
Forum section: electronics / general

author: erikbrenn
author_rank: Regular Contributor
timestamp: October 15, 2024, 08:43:05 pm
content: I just got an AVRISP MKii clone from Ali. I intend to replace its cable with my tag-connect cable.I noticed that the PCB of the clone(right) is extremely simple compared to the original one(left). It seems to only have one chinese micro on the board.Do you know which of these features from the original might be left out in the clone?I guess the protection stuff is not implemented:

author: westfw
author_rank: Super Contributor
timestamp: October 15, 2024, 10:42:44 pm
content: Guessing:not upgradable from Atmel tools (might be upgradable via other mechanisms.)Doesn't support full range (or any?) target voltages other than "5V"no "target interface protection" (whatever that means) or "short-circuit protection."May not support TPI/PDI protocols.Apparently the original has a "boost converter", but does not support HV programming? I guess this corrects for lower-than-5V USB power with 5V devices, which may be a problem with the clone?

author: erikbrenn
author_rank: Regular Contributor
timestamp: October 15, 2024, 11:12:44 pm
content: Thanks. No need for upgradeability, protection and TPI/TPD. But if it's only 5V that's a bummer , but I can hack together a 5v/3v3/1v8 level converter if necessary.cheers.

author: westfw
author_rank: Super Contributor
timestamp: October 16, 2024, 07:20:05 am
content: A lot of the AVRISP clones (thatdon'tlook like yours) also use a software bit-banged USB interface, so they won't run at "full speed."(Which I don't think is particularly relevant for a programmer-only device.)
Making a motor go backwards based on a microcontroller's output - Page 1
Forum section: electronics / general

author: vediguy
author_rank: Newbie
timestamp: October 13, 2024, 02:55:32 pm
content: Creating a similar robot to that of a beebot used in primary schools, where you input different instructions (forwards, backwards, left and right) and then press the "go" button where it follows those instructions. An issue I'm pretty confused upon is how to make the motor to go backwards, I know its got something to do with reversing the polarity but unsure how to create it, using circuit wizard to design this project as well.

author: ozcar
author_rank: Frequent Contributor
timestamp: October 13, 2024, 03:06:58 pm
content: Try looking up "H-bridge".

author: Andy Chee
author_rank: Super Contributor
timestamp: October 13, 2024, 03:07:37 pm
content: Do you know what kind of motor you will be using? This will have a direct bearing on the circuit topology and control methodology.

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 13, 2024, 04:12:40 pm
content: For a DC motor with brushes there are motor driver ic's that incorporate a full H bridge that controls the motor. By using PWM the speed can be controlled and with the bridge the polarity of the voltage on the motor can be reversed.Texas Instruments has several to select from.https://www.ti.com/motor-drivers/brushed-dc-bdc-drivers/overview.htmlOther companies make similar ic's and in the Arduino worldthisdriver is used a lot. Seehttps://www.techmonkeybusiness.com/articles/Using_MX1508_DC_Motor_Controller.htmlThis basically is the simplest type of motor to control. Lots of examples on how to do this can be found online.Then there are brushless DC motors (bldc) that need three phase driving which is a bit more difficult and in the RC world often ESC modules are used for this.https://nl.aliexpress.com/item/1005005983306835.htmlLeaves AC motors which are in a league of their own, so not going in to these.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 14, 2024, 11:04:04 am
content: H-bridges for smaller motors are often integrated in motor driver IC's. An ancient version is the L298, but it's really obsolete. It's big and bulky and needs a heatsink too. It's outperformed by for example the A4950 in SOIC. Such H-bridge IC's usually also have a built in method for measuring or limiting the motor current.For DIY you can also buy breakout boards for such IC's. Another popular one is the L9110. It's only fit for small DC motors, but it's not very expensive.
Issue with Motor 1 RPM Display Always Showing Zero Despite Proper Control via CA - Page 1
Forum section: electronics / general

author: romiktk
author_rank: Newbie
timestamp: October 24, 2024, 11:25:37 am
content: Hi,I’m working on a project using STM32 to control two BLDC motors with Hall sensors. The motors are controlled via CAN commands, and everything works as expected in terms of control. However, I have an issue with displaying the RPM of Motor 1. Motor 2's RPM is tracked and displayed accurately on the LCD, but Motor 1's RPM always shows as zero, even though both motors are running and controlled successfully.I’m using Hall sensors to calculate the speed of both motors, and the speed is displayed on the LCD. Here’s the part of the code responsible for calculating and displaying the speed for both motors:// Motor 1 Speed Calculationfloat calculate_speed_m1(void) {if (hall_pulse_count_m1 > 0) {float rpm_m1 = (hall_pulse_count_m1 / 6.0) * 60.0;hall_pulse_count_m1 = 0; // Reset pulse count after calculating RPMreturn rpm_m1;}return 0;}// Motor 1 EXTI Handlervoid EXTI9_5_IRQHandler(void) {if (EXTI_GetITStatus(EXTI_Line6) != RESET || EXTI_GetITStatus(EXTI_Line7) != RESET || EXTI_GetITStatus(EXTI_Line8) != RESET) {hall_pulse_count_m1++; // Increment the pulse count for motor 1EXTI_ClearITPendingBit(EXTI_Line6 | EXTI_Line7 | EXTI_Line8); // Clear the interrupt pending bit}}I verified that the EXTI handler is triggering for Motor 1, and I also confirmed that the CAN commands are controlling both motors correctly. The issue seems to be that hall_pulse_count_m1 is not updating properly, or the speed is not being calculated as expected for Motor 1, resulting in zero RPM on the display.Any advice on why this might be happening and how to fix it? I've attached the full code below for reference.

author: eutectique
author_rank: Frequent Contributor
timestamp: October 24, 2024, 02:44:23 pm
content: Make sure that the pulse counter is incrementing:Code:float calculate_speed_m1(void) {return (float) hall_pulse_count_m1;}

author: mikerj
author_rank: Super Contributor
timestamp: October 24, 2024, 03:50:18 pm
content: Ishall_pulse_count_m1declared as volatile?
Ti DM368 UART interface can not communicate with computer,  RX-TX short circuit？ - Page 1
Forum section: electronics / general

author: jason05
author_rank: Newbie
timestamp: October 05, 2024, 03:32:36 pm
content: My gopro drone has this chip. When I use the UART interface for debugging, It may be that some two lines of RX, TX and GND were accidentally short-circuited during use , which may trigger some mechanism. Now the UART interface has no output information, so it is no longer possible to communicate with the computer.Is there any solution? thanks!!

author: bson
author_rank: Unknown
timestamp: October 05, 2024, 09:57:21 pm
content: TMS320DM368, the DaVinci Media Processor?Do you have an oscilloscope? Probe the UART TX pin (or the signal downstream as it can be hard to probe a BGA) to see if it transmits. If so it's not the UART but a buffer or driver. In the old days RS-232 drivers were notoriously fragile. If the UART is dead it's likely permanent.

author: jason05
author_rank: Newbie
timestamp: October 05, 2024, 11:38:30 pm
content: I don't have an oscilloscope . My drone still works, but the UART doesn't work. Can I fix it through other interfaces such as JTAG?

author: jason05
author_rank: Newbie
timestamp: October 07, 2024, 08:09:29 am
content: I found a strange thing, when I short-circuited RX and TX there was an output, but the output content was a little repetitive and jumping, I suspect that there is a problem with a MOSFET used to control the RX and TX levels on the drone motherboard, or there is a problem with the signal control of the MOSFET, but there is no circuit schematics, there is no way to find the problemhttps://www.mediafire.com/file/xvygb31n9r7sktl/ttl.txt/file
Pickit 3 vs MPLAB X 6.20 (solved) - Page 1
Forum section: electronics / general

author: Drirr
author_rank: Regular Contributor
timestamp: October 06, 2024, 03:15:27 pm
content: Hi,After some time, I decided to get back into programming.I found my old Pickit 3, which should be compatible with MPLAB X 6.20.I also have some PIC24FJ32GA002 chips.Everything seems to be working — MPLAB X recognizes my Pickit 3, and the project is fine.But here's the problem:Program loaded with pack, PIC24F-GA-GB_DFP, 1.9.336, MicrochipLoading completedConnecting to programmer...The programmer could not be started: Could not connect to tool hardware: PICkit3PlatformTool, com.microchip.mplab.mdbcore.PICKit3Tool.PICkit3DbgToolManagerI tried this on both Linux and Windows 10 with the same result.I can't figure out why this is happening. Could the Pickit 3 have outdated firmware? Is there an incorrect configuration in MPLAB? I tried to find the old Pickit application to update the firmware, but I got a 404 error for both links.My hardware connections are:Pickit ---- MCUMCLR/VPP to MCLR (pin 1) (0V when connected to Pickit, otherwise 3.3V)VDD to VDD (pin 28) (3.3V measured)PGD to PGED1 (pin 4)PGC to PGEC1 (pin 5)PGM (LVP) left floatingThe only LEDs that light up are POWER (green) and ACTIVE (blue).During a programming attempt, the STATUS LED does nothing.It seems like the Pickit 3 is ignoring MPLAB altogether.Pickit firmware selector (or updating tool?) in MPLAB does nothing, ignored by pickit.I've run out of ideas. Should I feed Microchip's management by buying a Pickit 5?

author: RAPo
author_rank: Super Contributor
timestamp: October 06, 2024, 03:19:56 pm
content: Did you do areset?

author: Drirr
author_rank: Regular Contributor
timestamp: October 06, 2024, 03:32:40 pm
content: Thanks for reply,Tried reset,Then uncheck "Use Latest Firmware"selected PK3FW_015609.jamApplynot a single LED blink, only power and active.*****************************************************Connection Failed.The programmer could not be started:... same result

author: Drirr
author_rank: Regular Contributor
timestamp: October 06, 2024, 03:58:42 pm
content: Got it working,PICKIT was stucked in some strange mode.You need to download:https://github.com/langbeck/pickit3-programmer?tab=readme-ov-fileSelect - revert to MPLAB modeLost some hair.. again
Programming CH32V003 - NO WCH LINKe - Page 1
Forum section: electronics / general

author: ppTRN
author_rank: Regular Contributor
timestamp: October 03, 2024, 02:48:35 pm
content: Hi everyone,I recently bought a ch32v003 dev board, but I did not purchase a programmer (also by wch) because I thought it was just a usb to uart bridge.Turned out it isn't. It uses a proprietary standard to program the device!Do you guys know any easy way to program it in any other way or do you suggest to just buy a programmer?Cheers!Edit: typos

author: Sacodepatatas
author_rank: Regular Contributor
timestamp: October 03, 2024, 05:31:33 pm
content: The easiest way is to buy the programmer. It's about 5€ and comes cheaper if you buy the official set that included a proper dev board, 5 more ICs, and the programmer itself (be careful because you might be tempted to purchase the WCH-Link programmer. It isn't compatible, you need the WCH-LinkE version). But you have more alternatives. Although the SWIO interface is propietary, It is open so there are several implementations. Check out this link...https://github.com/cnlohr/ch32v003fun

author: ppTRN
author_rank: Regular Contributor
timestamp: October 03, 2024, 06:33:27 pm
content: Thank you. I think I will eventually buy the programmer but I want to try use an arduino just for the sake of it.The link you provided is very usefull.
GD32F405RE DEVICE ID - Page 1
Forum section: electronics / general

author: ieeeHuseyin
author_rank: Contributor
timestamp: October 02, 2024, 01:38:58 pm
content: Hello,I want to learn the device ID information for the GD32F405RE mcu.I have examined the datasheets. For example, there is the following information for STM32F4.But I could not find this information for GD32. Is there any document where device IDs are listed?

author: thm_w
author_rank: Super Contributor
timestamp: October 02, 2024, 11:54:51 pm
content: Maybe in Jlink:https://wiki.segger.com/GigaDevice_GD32F4Core ID is listed as 0x4BA00477 ?Or if you have one just read it out.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: October 03, 2024, 05:41:59 am
content: GD has their own (not present on STM32) ID register in the flash controller. But no idea where to find the values list.
PMS150 PWM generator - Page 1
Forum section: electronics / general

author: itelite
author_rank: Contributor
timestamp: August 15, 2019, 09:36:44 pm
content: Fellow Nerds. Trying out the PMS150 and more than a bit lost in this language and IDE. Hoping someone can point me in the right direction.Goal: Fixed frequency PWM output with duty based on the state of 2 pins. high or low state.I see that there is demo code that looks like it does this but it does not compile when you switch the chip to PMS150. It gives some errors that i simply do not know what they mean, and what the remediation would be.Also in the manual/help it states there is a PWM module under "generate code" and at least for that module is missing.Code:#include "extern.h"BYTE pwm_duty; // Modify pwm_duty, then FPPA change the PWM dutyvoid FPPA0 (void){.ADJUST_IC 8MIPS // IHRC/2 = 8MIPS, WatchDog Disable, RAM 0,1 temporary be usedpwm_duty = 0;pmode Program_Mode; // if has more FPPAs than 2fppen = 0xFF;BIT Sync : PA.0;BIT f_Duty_Dn;$ Sync Out, Low;while (1){WORD count = 0x5678; // Only for delaywhile (1){$ Sync Tog;.delay PWM_CYCLE - 5;count--;if (CF) break;}nop$ Sync Tog;if (! f_Duty_Dn){if (pwm_duty >= PWM_CYCLE){f_Duty_Dn = 1;pwm_duty--;}else{pwm_duty++;}}else{if (! pwm_duty){f_Duty_Dn = 0;pwm_duty++;}else{noppwm_duty--;}}.delay PWM_CYCLE - 13;}}Errors:C:\PADAUK_Tool\0.87\Demo\PWM\PWM.C(: Syntax error happen !!!C:\PADAUK_Tool\0.87\Demo\PWM\PWM.C(12): Syntax error : 'pmode'C:\PADAUK_Tool\0.87\Demo\PWM\PWM.C(14): Syntax error : 'fppen'C:\PADAUK_Tool\0.87\Demo\PWM\PWM.C(26): The 'TOG' not be supported at AssemblyC:\PADAUK_Tool\0.87\Demo\PWM\PWM.C(32): The 'TOG' not be supported at Assemblypmode seems to be related to running multiple differnt FPPA, and i can comment it out.fppen seems to be the default choice of those to run. i can comment it out.Syntax error happen, i just have no idea.TOG no idea.If there is an other way to do this i am all ears of course. I thought i would start with the demo code to see what happens.

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 01, 2024, 08:10:11 pm
content: If you were using Linux, I would suggest you look atFree PDK toolchain(also discussedhereon EEVBlog forums) based on SDCC and open-source tools, using standard freestanding C.I just don't know how friendly it is to set up in Windows; and some of the examples/instructions/discussions do assume Linux is used anyway..
[PIC18F2523] ADC ISR being called when ADIE is not set? - Page 1
Forum section: electronics / general

author: Sudo_apt-get_install_yum
author_rank: Regular Contributor
timestamp: September 25, 2024, 08:23:15 am
content: Hi!Im reworking some code for a PCI18. For whatever reason the ADC "conversion complete" ISR is being executed even though theADC Interrupt Enable(ADIE) bit is not set in the PIE1 register.ADIF is set in PIR1 when the ISR is called but why is it called?Im using MPLAB X version 6.2.Appreciate any input, i'm not to familiar with with PICsInterrupt registers when ISR is calledISRADC config

author: Sudo_apt-get_install_yum
author_rank: Regular Contributor
timestamp: September 25, 2024, 08:31:12 am
content: I think i just realized my mistakeThe ADC conversion time is the same as one of my timers who uses interrupts.Timer overflows -> ISR gets called (ADIF is set)ADIF macro/ if statement is run...In my defence I'm used to separate ISR functions for each peripheral.Sometimes...

author: JPortici
author_rank: Super Contributor
timestamp: September 25, 2024, 01:10:25 pm
content: Quote from: Sudo_apt-get_install_yum on September 25, 2024, 08:31:12 amwhich is why you are advised to useif (ADIF && ADIE)in the compiler manual