Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Write over USB using the printer_basic example for SAM E54

I was trying to use the SAM E54 Xplained dev board to achieve printer communication using this example from Microchip https://github.com/Microchip-MPLAB-Harmony/usb_apps_device/tree/master/apps/...
user avatar
  • 285
0 votes
1 answer
76 views

Code protection (firmware security) in PI PICO RP2040?

What are the available code protection (firmware security) options for off chip flash in PI PICO RP2040 for industrial IP critical designs?
user avatar
  • 11
2 votes
1 answer
153 views

How to convert the ADC/PDB part code of Teensy 3.2 for Teensy 4.0

I was working on two thumb ECG device on Teensy 3.2 but Teensy 3.2 was out of stock everywhere, so I was having only option to buy Teensy 4.0, now I was having code for Teensy 3.2, the below code is ...
user avatar
0 votes
0 answers
25 views

Photovoltaic array reconfiguration for a 3x3 array under partial shading conditions

I'm trying simulate photovoltaic array reconfiguration using particle swarm kptimization in MATLAB Simulink. I need to build a controller for the switching matrix that switches the arrays based on ...
user avatar
  • 1
4 votes
1 answer
163 views

Noob questions about my accelerometer (ADXL345) and Arduino components in general

I've just bought this accelerometer: https://www.amazon.co.uk/XTVTX-ADXL345-Digital-Acceleration-Gravity/dp/B09NRFDH5J/ref=cm_cr_arp_d_pl_foot_top?ie=UTF8 I've bought it to learn about accelerometers ...
user avatar
2 votes
1 answer
199 views

ESP32 PWM duty cycle measurement from input

I am trying to measure the duty cycle interval (from falling to rising edge) in microseconds of an incoming PWM signal of 20 KHz. I made a test PWM signal on a GPIO pin (50% duty) and connected it to ...
user avatar
0 votes
1 answer
75 views

How to monitor your code execution written for any electronic device while they are operating?

I am working on a mobile robot that includes motors, proximity sensors, encoders, and MCU. I am powering my MCU CC1350 Launchpad using the onboard power supply. The IDE I am using is Energia IDE, ...
user avatar
0 votes
0 answers
38 views

How to implement Airband (Aircraft band) in this MATLAB code

I am researching Airband (Aircraft Band) for the Telecommunication course, but the professor didn't explain what to do exactly in simulation except saying that I have to do AM modulation scheme. I ...
user avatar
1 vote
0 answers
50 views

What is wrong with this PIC16F877A HCSR04 example?

I am working on distance sensor with PIC16F877A. I am using MPLAB IDE AND XC8 compiler. My goal is to gradually turn on the right leds at certain distance levels. but the leds are blinking unstable. ...
user avatar
2 votes
2 answers
342 views

Identifying unique color code of non-inductive wire wound resistors: Weird resistor color coding, never seen before

Here we identify the color code determining the values of non-inductive wire wound resistors, specifically Yageo's NKN series (but applicable to other manufacturers of this class), which are a unique ...
user avatar
  • 775
0 votes
0 answers
267 views

ILI9341 display interfacing with stm32f103c8t6 with TFT_ESPI library

I am trying to configure stm32f103c8t6 bluepill with ILI9341 display using the tft_espi library . Connection stm32 ILI9341 PB15 -> MOSI, T_MOSI PB14 -> MISO, T_MISO PB13 -> SCK, T_SCK PC15 -&...
user avatar
2 votes
1 answer
408 views

Trouble using the UART with RPi Pico

I'm making a remote controlled machine using a pi pico to drive the motors and read some sensors, and a raspberry pi 4 to send commands to the pi pico via serial and host the web interface. I'm ...
user avatar
  • 125
0 votes
2 answers
147 views

Is it possible to write a program that calculates its own energy usage?

If I have a program (e.g. a small Python program) on a specific machine. Would the program be able to measure how much energy its computation costed? I think, there would be two possible ways to go: A)...
user avatar
  • 101
3 votes
2 answers
135 views

AD5693 digital to analog converter

I am using an AD5693 as digital to analog converter with an Arduino Uno. I have connected the SDA andSCL pins of the AD5693 to the I2C pins of the Arduino Uno. I have connected the LDAC active low to ...
user avatar
-1 votes
1 answer
81 views

Can't get Arduino output to work using IRremote Arduino library

I'm trying to send an infrared signal to my LED-strip-receiver, but no code makes the LED work (light.) I have the IRremote.h Arduino library installed on version 1.18.15 and I found this example/test ...
user avatar
0 votes
1 answer
31 views

How to use TA1 of P1.6 without also using it on P1.2 on MSP430F1101

I have been struggling for a lot of time now, training to use the pwm function on pin 1.6 of the microcontroller. For P1SEL=BIT2, it is correctly using TA1 on P1.2, but for P1SEL=BIT6 it is not using ...
user avatar
0 votes
0 answers
43 views

NFPA70E Question: My company provides electrical inspection services, does my technician need to wear a hot suit?

So my company provides preventative maintenance inspections, wherein the technician will open a large number of electrical panels, rated from 120-480 volts, sometimes up to 30 panelboards in a single ...
user avatar
0 votes
0 answers
59 views

8 bit divider can you help with it? [duplicate]

This is the vhdl code and it need more, can you help me? ...
user avatar
2 votes
1 answer
122 views

Can't understand this PID code

I am having trouble understanding some PID code on an FPGA that is posted on github, by David Paquette. I will paste it in at the bottom of the post. It looks very compact and neat, and I understand ...
user avatar
  • 986
0 votes
2 answers
166 views

I want to implement an Z transform Equation in C (with saturation limits)

I will start from the beginning . I had a PI controller with saturation limits (+4 and -2) whose Laplace equation is as follows (0.05s + 0.5)/s. Sampling time of 40 micro seconds Using Tustins method ...
user avatar
0 votes
1 answer
97 views

STM32 - developing code without controller

Is it possible to develop a code for STM32 (hobbyist) without controller attached and test it? Is there a simulator mode or some other possibility? I do not have enough space to let the project "...
user avatar
2 votes
0 answers
39 views

add 2 buttons to this sketch

Can anyone tell me how to add 2 button switches to this sketch (one forward and one reverse) for a second motor?` This code works great and I would like to just add the some button switches to pins 4 ...
user avatar
1 vote
1 answer
56 views

How can I make Verilog HDL ModelSim test bench for a simple ripple adder circuit output an addition table instead of a long list of every calculation?

I've completed my assignment and I'd like to make the output look something like this, with one table for sum output and one table for carry output: ...
user avatar
0 votes
1 answer
266 views

VHDL code for ALU and ROM connection

I need to connect an ALU with a two-port data memory, but I can only implement this far, and I don't know what is missing, plus I am a bit confused as to what to write for the testbench code ...
user avatar
  • 23
0 votes
1 answer
255 views

ADS1115 differential measurements - resolution limited to 12 bits instead of 16 bits

I am trying to read a differential voltage with an ADS1115 (https://www.amazon.fr/gp/product/B07RJT3GHC/) hooked up to a Teensy 4.1. I am using Adafruit_ADS1015 library (https://github.com/adafruit/...
user avatar
  • 1
0 votes
0 answers
35 views

download code via SWD ADuCM3029

I made my own PCB using ADUCM30299 as microcontroller; in this card I also have a power management, BLE, Flash memory,USB Type C when I tried to calculate the voltage in SWD_CLK, SWD_DATA, .... I find ...
user avatar
2 votes
2 answers
1k views

How to find SMD resistor and capacitor value and correct size

I'm new to the SMD world and struggling to find an easy and quick way to get the correct SMD resistor and SMD capacitor size and value based on a circuit schematic; any tips will help. For example, I'...
user avatar
0 votes
0 answers
53 views

How would I use PhaseFrequencyOffset correctly in MATLAB?

So I am currently using MATLAB Live Script to run a script with a modulation index of infinity, but at this point im using 5. The programme itself is a synchronous demodulator using a non-coherent ...
user avatar
0 votes
0 answers
26 views

stc12c5a60s2 similar code but typed in different PC not working in keil

Is there any reason why the code typed in my friends pc(bottom) works properly while the code I typed in my pc(top) doesn't? Both doesn't seem to have any error when compiled on my PC, but when ...
user avatar
0 votes
1 answer
75 views

Differences Between " P1SEL |= BIT5 + BIT6 " vs " P1SEL= BIT5 | BIT6 " in embedded C

Is there any difference between " P1SEL |= BIT5 + BIT6 " vs " P1SEL= BIT5 | BIT6 ". If there is , what is it?
user avatar
0 votes
0 answers
819 views

Problem in Computing the Energy in Energy Meter using ESP32

So me and my groupmates are been working on with our thesis project about energy meter. In our project, the esp32 is the main board we are using. We also have voltage sensor (ZMPT101B) and current ...
user avatar
0 votes
1 answer
97 views

Can anyone spot my mistake (VHDL)

I have been scratching my head with this one for a while. Probably a simple problem to people familiar with VHDL on Vivado. I have inserted all my code below. I am creating a 32 bit register from D ...
user avatar
  • 986
0 votes
1 answer
83 views

Can I sell and install homemade smart light switches legally?

I have designed and made prototypes for a smart light switch. It involves inserting a PCB into the work box behind the switch and is powered by the household AC. The goal was to sell these locally and ...
user avatar
-1 votes
1 answer
855 views

VHDL issue with the code [closed]

I have ran into a trouble when trying to compile my code for the project. This is the error message.  -- Compiling entity comb_lock -- Compiling architecture comb_lock_arch of comb_lock ** Error: ...
user avatar
6 votes
5 answers
399 views

How is digital data represented in analog waves? [closed]

This question is simply coming from an intrigued teenager, so if it has any flaws, I'm sorry for the inconvenience. To my knowledge, when digital data is transmitted wirelessly, it is first encoded ...
user avatar
-1 votes
1 answer
69 views

Help with an Mbed LCP1768 assignment

Could someone help me out and see if my code is correct please and thank you. ...
user avatar
1 vote
3 answers
361 views

Servos going crazy! Help! [Solved]

Every time I boot up the board (DFRobot Bluno) the servos start moving without me telling them to. Earlier, it worked perfectly fine but since then, I've change the electronics set up a little bit and ...
user avatar
  • 41
-1 votes
1 answer
1k views

Converting a 50MHz clock to 1Hz to blink an LED

My board uses a 50MHz clock which I am trying to convert to 1Hz so that I can blink an LED. The way my code works is it counts up to 25,000,000 and then the divided clock signal switches from 0 to 1. ...
user avatar
  • 67
0 votes
2 answers
248 views

Is it possible to generate a sine wave formula using values from an array?

so we have an Arduino code which includes an array, is it possible to make those array disappear [in the code] and instead formulate a sine wave formula for those [array] to make the output in sine ...
user avatar
0 votes
2 answers
2k views

How can we multiply two 2-digit BCD numbers?

I am designing a PIC18F4520 microcontroller based system. By using this system I want to multiply two numbers. Each number is a 2-digit BCD number. Such as 73*27 and I want to see results as 2715 at a ...
user avatar
  • 31
0 votes
1 answer
71 views

Velilog HDL(Logic cricuit)

I want to design this circuit using the Velilog HDL. However, I can't make a feedback part well. Here is my code about it! ...
user avatar
1 vote
2 answers
686 views

Smd resistor code= IEE

r28=iee what is meaning of iee code of smd resistor?
user avatar
0 votes
0 answers
50 views

output voltage of boost converter

I built a boost converter and I can't see on the oscilloscope the 12V in the output and the real frequency that I defined (70kHz.) What should I do? This is my circuit, and below that is what I see ...
user avatar
0 votes
1 answer
74 views

STM32 Nucleo board, SD card displaying symbols instead of numbers

Devices: STM32F4 The SD is working and the data is saving on the SD, but the problem is that the integers are displayed as symbols in this SD. So I think that the problem is that the function I used ...
user avatar
  • 3
-2 votes
2 answers
104 views

I need to make a connection between two devices, who can help me? [closed]

During the Corona era, it's not always easy to keep distance from each other. However, you still have to stay a metre and a half away from each other. This is why I want to create a device that hangs ...
user avatar
0 votes
1 answer
608 views

Basic code using millis() function to calculate time elapsed

I do not know why the simple code below does not work. It may have to do with how unsigned long behaves? Code simply determines if elapsed time has exceeded Snooze_Time which is 10000 by comparing ...
user avatar
  • 97
0 votes
2 answers
201 views

Firmware coding - applicable standards

I would like to know if there are any applicable standards when coding microcontroller firmware (ARM) in order to achieve a specific quality level. In my case, I would like to code firmware for a ...
user avatar
2 votes
2 answers
241 views

Step up converter

I built a circuit of boost converter and my input voltages is 6-9 V. I want to get output at the converter 9-12 V. My problem is that I get over 40 V and I do not know why, in the code do I have to ...
user avatar
0 votes
2 answers
278 views

Read code from ESP12F / ESP8266

Is it possible to read the code that is programmed on an ESP12F/ESP8266? I don't even know which programming language is used. This is a technical sheet for the ESP12F http://wiki.ai-thinker.com/...
user avatar
  • 155
1 vote
1 answer
105 views

Why are Global Struct Variables not visible in Loop and in Function?

I created variables in a struct above void setup() so they would be Global. Prior to this the code ran. In Loop and in the one function I get error the variables were not declared in this scope. ...
user avatar
  • 97