Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

2

A microcontroller with lots of pins as an intelligent I/O expander could be more cost-effective than an FPGA. An STM32H743BIT6 has for example 168 I/O pins, let's say 8 of them are needed for communication and debugging, leaving 160 inputs for the application. These pins are arranged in 11 ports of 16 bits each. The controller runs on 400 MHz, so there'd be ...


2

Forgive my ignorance, but if a regular IC won't do it. could you point me to how to do it using an FPGA. which kit has this many inputs? a general idea of how to do it would be greatly appreciated. Unfortunately what you ask falls under "design services" which is not what we offer here. So I will only some give guidance. You can get FPGAs with up to 1400 ...


0

Q1 The most simple method: after the firmware for the BLE-µC is created, convert the binary data to C-Array. Include this C-Array into your MSP433-firmware. Now you can transfer the BLE-firmware easily, as it is available as static resource. The only limitation is the amount of storage available on your MSP-µC, it's firmware and the BLE-firmware both need ...


1

You can detect that the power has failed because the microcontroller is starting up. If the power just came on, then it must have been off before. Therefore, there was a power failure. Perhaps I haven't understood the question correctly.


0

A flip flop will lose it's state if not powered. A better method would be to have a routine to write a counted value to a ROM. If the counter started from zero then you would know about an upset. Another way to do this would be to use an RTC IC and a microcontroller You could also have a brown out detection circuit and a enough power to run the micro for ...


1

If you give the port a name and a function and generate code... example... You'll noticed that in system_config.h harmony only creates the following /*** Functions for MY_TEST_PIN pin ***/ #define MY_TEST_PIN_PORT PORT_CHANNEL_E #define MY_TEST_PIN_PIN PORTS_BIT_POS_6 #define MY_TEST_PIN_PIN_MASK (0x1 << 6) which can be used as your parameters for ...


0

Why not use this: #define DATA_IN RE6 value = DATA_IN; otherwise you could use this with harmony: PLIB_PORTS_PinGet (PORTS_ID_0, PORT_CHANNEL_E, PORTS_BIT_POS_6) or PLIB_PORTS_PinGet (PORTS_ID_0, PORT_CHANNEL_E, DATA_IN) but I guess it's much more complicated.


1

I understand that Harmony is supposed to make things simpler. It does this well for configuration -- but it does makes a lot more things confusing especially for newcomers. Your main code can go absolutely anywhere you want and you can just dump the APP_Tasks() function. HOWEVER --- if you really want to follow the correct Harmony procedure and not kill ...


0

There are 2 requirements from what I can see: The generic I/O power (see section 2.5 in the datasheet) should all ramp up together and can precede \$V_{DDR}\$ although \$V_{DDR}\$ can ramp up with the generic I/O power; the LV supply should follow this. In section 3.4.1 (Recommended operating conditions for 3.3V operation) there is a caution: VDDE_C and ...


0

As far as I'm aware, the correct procedure for a single-block write operation is: Send CMD24 Wait for the 0x00 acknowledgement Send 0xFE Send entire block (512 bytes for modern cards) Send 2-bytes of anything (or 2-byte CRC, if enabled) Wait for xxx0yyy1 data response token Check that yyy = 010 I have a suspicion that you're not waiting for the CMD24 ...


0

You are probably getting the memory address of the DRV_TMR0_CounterValueGet function rather than the return value because you didn't call the function. You must call the function with () i.e. teste = DRV_TMR0_CounterValueGet(); (not teste = DRV_TMR0_CounterValueGet;)


1

There are two ways of configuring timers in harmony v2. i.e. Static or Dynamic For static timers you need to add your handling code into the system-interrupt.c file timer handler. See here For dynamic timers you can specify a custom handler in your application code. See here. See 'Creating the ISR' and 'Registering the ISR' sections. I would use the ...


2

Yes you can. But they do not need to be in different addresses, unless you want to select all of them simultaneously with the first mux, but then they can be all connected to the MCU directly without the first mux.


0

Get a motor with an encoder on it. The encoder allows you to monitor position and velocity (to some extent, you need enough resolution on the encoder for velocity control). Some motor controllers come with feedback from a encoder built in and encoder/motor/controller kits can be found at many motor manufacturers. If you have no experience with control ...


1

For non v1-2 Harmony you need to download and install the framework yourself see download installer links on https://www.microchip.com/mplab/mplab-harmony/mplab-harmony-1.0 then after installing , link the project harmony path to the install path


1

Seems like MPLAB harmony v3 is a new beast and the PIC32MX470F512L files were only added about a month ago. First make sure you download the latest framework when starting a new project by clicking on "Launch Framework Downloader" whilst online Browse for a path you want the files to download to. click on Create Folder if it says that the path is not valid....


1

I'm answering based on the MCC image you posted which relates to PIC16F and not your chosen PIC32MX which may be the source of your confusion. You should run MCC with your PIC of choice to fully understand what it is doing with your chosen PIC. The timer period is the time it takes for the timer interrupt to occur. MCC just works out hidden variables so ...


1

Just some extended comments and errors in your design. ground plane adds more unwanted stray capacitance (to gnd) than coplanar tracks. Maybe <150 ppm lower f, if C is too high and <150 ppm high if C is too low. no thermal solder pads for SMD and XTAL parts. Each pad should be a thermal island of heat when soldering so you do not have to heat up ...


0

Figure 1. A very simple polarity reversal circuit using two GPIOs. GPIO tricks. GPIO1 GPIO2 LED ----- ----- ----- 0 0 Off 1 0 Green 0 1 Red 1 1 Off


3

If you follow the recommended oscillator circuit, a good quality active crystal should work with a load capacitance that's off a bit. The problem isn't that it won't oscillate at all, the problem is that it'll oscillate at the wrong frequency. Looking at your layout your oscillation frequency may be extra sensitive to temperature variations because FR-4 is ...


1

You're right on most of the points. PICs use typically any of the available clocks, usually the internal low frequency clock, internal or external (crystal) high frequency clocks, going through a prescaler for that particular timer, or an external pulsetrain, in which case it acts as a counter, since that pulsetrain doesn't need to be regular. There's ...


3

Unless otherwise configured the timer will use the internal clock the rest of the PIC runs off of to increment. The timer will increment to its max value, although there are MCUs that are capable of incrementing to a particular value, or decrement to zero. I haven't used PICs too often but I think for at least the older ones if you to decrease the amount of ...


2

There are no metrics that completely capture this (or much else), but cyclomatic complexity seems likely to correlate somewhat with difficulty in making changes (Some shit however is just complicated). One thing that DOES (on average) help is having a development team that has subject matter expertise in how the software is likely to be employed. If you are ...


0

One possibility (assuming you are using the crystal as part of a tuning fork design as a micro's clock) is that you are not giving it the proper load capacitance. This could mean it's oscillating too slow or too fast for your micro. I'm guessing this as a possibility because you mentioned not having a datasheet for the crystals. You have to get the ...


1

• Do not forcibly spread or bend the leads into a socket or PCB holes. This will avoid cracking the glass insulation around the leads of the component. • Do not apply excessive soldering heat – Recommended Maximum Temperature is 380 ̊C using a hand soldering iron for a Maximum Duration of 3 seconds. If you neglect these rules, you may damage performance. ...


0

All PIC timers increment at each input clock cycle. Older PIC16 only have system clock as a timer input (plus an external pin) while newer ones usually have pre- and postscalers, multiple clock sources, etc. For you code to work in the same way you need the same input clock. Find out the exact timer clock on your PIC16 and make it the same on PIC32.


1

Is there a limit on how long the hot solder tip can touch the crystal lead before a crystal malfunctions? Yes, but its absurdly long. If you get two or three data sheets for comparable crystals from two or three reputable crystal manufacturers then you should find some guidance, and it should more or less apply to any decent crystal. Basically, if you're ...


0

What I'm confused about is how the fully address decoded SRAM will differ from the partially addressed i/o ports. "Partial decoding" simply means that even though each port only requires 1 byte, it occupies 64 bytes worth of address space. In other words, no matter which of the 64 possible addresses you use, you're accessing the same hardware port. On the ...


2

Looks like you need PIC32 Peripheral Library Starting with XC32 V1.40, PIC32MX peripheral support libraries are no longer installed as part of the compiler’s installation. These libraries are now installed as a second setup, after the installation of XC32 compiler.


0

The ATtiny13 is spec'ed to draw ~0.2uA without WDT and ~4uA with WDT @3V @25C so if you are seeing 100uA then something else is going on here. There is a lot happening in the above code. I'd scale it back to just the minimum code needed to put the chip into power down mode and then measure how much current that uses without anything connected to the chip ...


0

There are two ways that I know of. The first is viewing the assembly code for your production build within MPLAB X IDE v5.10 Open the Project Properties. Select the "Loading" node under "Conf: [your current configuration]". Check "Load Symbols when Programming or building for production". Then "Clean and Build" and once finished go to Window -> Debugging -...


0

In debug mode you can also step through your assembly file: Just click: Window/Debugging/Diassembly Start the debugger/simulator and run until a break-point. Know you can single step in your assembly file.


1

You should find a .lst file with your ASM code on folder debug or production within your project folder. If that's not the case, go to project settings --> XC32 --> Preprocessing & Messages: "Generate ASM listing"


0

update ULINK2 only works with IAR toolkit, not Code Composer. MSP-FET is the Texas tool of choice and the MSP430 is not really JTAG compatible. IAR can use a standard JTAG emulator to program/debug MSP430 but not Texas Code Composer. Fortunately you can buy [low-cost (£20-25) MSP-FET430UIF clone from ebay][1].. . It's been superseded by MSP-FET but ...


1

Frequency counters can get complicated quick depending on the bandwidth you want and the clock speed of the internal clock as well as the size of the registers holding the clock ticks and the input ticks. I mean it looks like it'll work but you should make sure that (1) the clock counter and the frequency counter are refreshed at the end of the sample (2) ...


4

MSP430s with USB can be programmed over USB. All other MSP430s must be connected to a programmer that supports the JTAG (a special MSP430 variant) or SBW interfaces. The MSP-FET is expensive, because it supports both JTAG and SBW, and different voltages. If your board can run at 3.6 V, you can do SBW programming with a cheap LaunchPad board, such as the ...


9

You can use a JTAG programming tool for this purpose. Pinout of the programmer looks like this: You can find matching pins on the IC: When you design your custom board, you can put in a row of header pins connected to these pins. When your PCB is assembled, use spring loaded pins or a cable connector to program the board. Somewhat like this (image source):


4

You use a JTAG debugger or programmer like this one or use the launchpad as Eugene Sh. suggested. When you make your design, you can add a connection for either a JTAG or SWD interface. There are schematics on how to do it in the link above. It is fairly simple. You can load and debug your program through this interface with the IDE supplied by TI or you ...


0

You are going about debugging the oscillator the wrong way. You are trying to measure an unknown quantity, and getting confused because it is not a number that you expect - even though you are not sure what you are expecting. The best way to do this is to set up a timer of a convenient value ( say 1ms). Have your pin toggle whenever the timer flag is ...


1

Yes, you must look at the disassembly how many opcodes the loop is, and calculate cycle count for each opcode. This is usually just easier with a debugger or simulator.


3

I've read in some place that it is a Primary oscillator, but the logic on my mind says that it's external, which is right? An external clock or oscillator is a (usually square wave) signal which is generated by some other circuit. Your setup is a Primary oscillator as the clock is generated locally by the combination of the PIC uC and the crystal. So ...


2

While others have suggested linear optocouplers and voltage dependent oscillators, I'll throw a very different method out as an answer to read high voltages with very high isolation. I've used this in fully floating front ends up to around 56V. It should work for any voltage you can get a suitable transformer for. In the schematic below I've created a ...


0

You might want to check out Analog Devices' portfolio of battery monitor chips. Some of them have galvanic isolation allowing you to monitor cells that are far from at ground potential.


2

It's not easy to wire and fuse 48 sense lines to batteries. When given a big task like this, with high numbers of anything, see if you can split the problem up into smaller bits. Both to get into terrain you might already know, and to shorten the development cycle with quicker milestones. If you have a setup with 8 packs of 6 batteries, you can create 8 ...


2

Would that MOSFET do the job? At first glance, it's a logic level FET capable of being turned on with 1.8V, and rated at 2A continuous. 250mA is down in the noise on all the graphs. It should work just fine. I couldn't be sure if voltage drop on MOSFET might be an issue for feeding 5V motor with 5V power supply? Rdson is \$<120m\Omega\$ for the ...


2

The 'non-5V tolerant pins' have an internal high side diode to VDD. If the signal can supply more than 5mA (see the datasheet) the diode will be destroyed, followed by the input circuit to the PIC. So to answer your question, not only will this this input pin get damaged, but possibly other parts of the PIC too. One solution, as Dirk Bruere mentioned, is to ...


0

Another possibility, and something I have used on other devices, is just to feed the signal via a suitable resistor. The chip inputs are normally diode clamped with a specified maximum current. As long as you don't exceed that current it should be OK


3

if you out 4.2V on it a pic pin that only want 3.3V something will break. Perhaps use a resistive divider. simulate this circuit – Schematic created using CircuitLab


2

It's simple enough. simulate this circuit – Schematic created using CircuitLab Figure 1. Various output options. If the required load current and voltage is <= the microcontroller's output capability then drive directly from the GPIO pin. (Figure 1a.) If a higher voltage or current is required then use an external transistor to do the heavy duty ...


2

You can jump from the firmware to the bootloader on the STM32F4. The STM32F4 has a built in bootloader at address 0x01ff000. Here is a tutorial on how to jump https://stm32f4-discovery.net/2017/04/tutorial-jump-system-memory-software-stm32/. Once in bootloader mode you can use DfuSe form ST(free) to flash the new firmware.


Top 50 recent answers are included