Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21
votes
3answers
5k views

What is a Patty Code?

In my digital logic lecture today, my professor introduced a symbol code called Patty Code. I copied this table off the whiteboard: | Symbol | Binary | Odd Patty | Even Patty | |--------+---...
12
votes
2answers
16k views

How to visually tell the difference between axial inductors and common resistors?

Is there a simple way to tell axial inductors and resistors apart in through-hole type PCBs? I do find the color code on both very confusing. Is there an obvious difference that I am missing? As a ...
9
votes
5answers
2k views

What tools or standards can be used to improve embedded C code reliability?

I typically program PICs in C, usually for switched-mode converters. I've heard of various static analysis tools and standards like MISRA C that can be used to help improve the reliability of code. I'...
8
votes
3answers
4k views

Why is the Gray code called a cyclic code?

I understand why it is called reflexive and a unit distance code. I don't see any cyclic pattern which is repeating in the code. Why is it called a cyclic code?
7
votes
4answers
3k views

My first STM32 code - please criticize me

I have just wrote my first code on STM32 - blinking LED. It combines a fragments from different sources; please criticize me so I can learn how to write proper code and don't learn stupid habits. <...
6
votes
1answer
2k views

Identify unknown SMD component code A6530 72130

I have a TTL to RS485 driver board and I am try identify one of the manufacturer part number from the board. Can anyone identify the SMD Code and manufacturer part number of the following device? ...
6
votes
2answers
905 views

Help understanding “unusually talked about” transistor code markings

I am a beginner trying to gain a better understanding of transistor codes. Before posting this, I searched the web looking for answers but I was unsuccessful. Please take a moment to look at the ...
5
votes
1answer
365 views

What component has the reference designator RY?

I found a component designated RY8015 which I don't recognize, shown on the photo below on an LCD TV PCB (the bulb-like part next to a green radial varistor). What is it called? What is its design ...
4
votes
2answers
5k views

What is a Barker Code?

I Googled this, but didn't find anything that could put it in layman's terms for me to understand. I know it has to do with signals/ pulse compression, but I am not grasping what exactly it is. If ...
4
votes
3answers
2k views

Looking for capacitance and voltage rating - How to read electrolytic SMD capacitor labels

I need to replace an SMD capacitor on a board. The printing on it says F1 560 2.5z I have googled intensely but have been unable to find information on how to read such a codes. I need to find out ...
3
votes
4answers
2k views

How is the code written in ARM7 compatible with ARM9?

I'm studying ARM families, In the above image, it is written that the code by supported ARM7 can be migrated to ARM9 and others. ARM7 uses the Von-Neumann architecture (single bus for data and ...
3
votes
8answers
2k views

Implementation and usage of gray code?

Generally and briefly, are there any direct application of gray code in electronics? If so, what are they?
3
votes
2answers
7k views

What does “+:” mean in Verilog?

When I was looking at someone's Verilog code, I found "+:" in Verilog. It looks like an arithmetic function but I'm not sure. I never seen before. Does anyone know this usage? Update: ...
3
votes
4answers
394 views

Available Guidelines for Interrupt Driven Processing

Are there any available guidelines for the amount of code to have in a critical section of interrupt driven processing? My personal rule of thumb is that the critical portion, (i.e. that between ...
3
votes
2answers
719 views

Multiple AVR Projects Sharing Code - Managing Large Projects

I'm working on a group project that is based around designing an automotive CAN bus system. Essentially there are multiple different nodes on the bus, acting as sensors, displays, controllers or ...
3
votes
1answer
3k views

What are these hardware components, and how do I control them?

My father received a video card in the mail last week. He gave it to me and I dismantled the card to get to just the video player and other components. The labels here are based on my experience ...
3
votes
1answer
144 views

Errors in microcontroller delay routine

I have an issue with a delay routine that I am writing for use on a PIC32, the PIC32MX664F128H in particular. I have two separate delay functions, which use the same lower-level delay routine: one ...
2
votes
2answers
4k views

Difference between Blocking and Non-Blocking assignment in VHDL

I started reading about Blocking and Non-bocking assignment with reference to verilog. But when I switched to VHDL its confusing. What I felt is, in VHDL other than to visually differentiate ...
2
votes
1answer
725 views

Generate hamming code-words with given minimum distance

My understanding of hamming code (adding this as it might help someone in future): Description: Hamming code is basically an extended parity check code. Message is divided into blocks, and multiple ...
2
votes
1answer
541 views

How does this Matlab code work?

I came across this uncommented Matlab code except for the header: ...
2
votes
1answer
2k views

Deep sleep mode consumption of PIC

I would like to know why my PIC which when I put in to deep sleep does consume more than what is specified by the datasheet. I have connected a precision current meter and found that when I load the ...
2
votes
1answer
2k views

Barker code autocorrelation

How do you auto correlate the following Barker code? I tried to use the formula on Wikipedia's page but it did not make sense to me. +1, +1, -1, +1
1
vote
2answers
1k views

Electrical schematics component ID's

Is there a list of standard ID codes used for components on a schematic drawing that anyone can point to? e.g. K = Contactor S = Switch Y = Solenoid X = Terminal strip etc. Any list would be ...
1
vote
4answers
162 views

Help with delayed smoothing code

I'm hung up on how to smooth analog sensor data in a specific way. Math/code is not my expertise so thanks in advance. My sketch needs to listen an AnalogPin and smooth/remove any outliers as the ...
1
vote
2answers
390 views

Understand VHDL Code

I've been learning VHDL coding for the past two weeks to be able to understand the VHDL code of what I'll be working on. In other words, I'm still a beginner and I need help understanding some codes ...
1
vote
3answers
513 views

Arduino code - Why do we need to read the rising edge?

I'm having a difficult time figuring out why we need to read the rising edge instead of using both edges. We are doing a school lab using interrupts in Arduino code, and I understand that we need ...
1
vote
1answer
139 views

4bit demultiplexer with address entries in the EXCESS-3 code

My question is: how to make truth table for inputs on E3? There is only space for 2 bits, and E3 is written on 4 bits as I saw. Should I add more inputs for this situation or do this in different way?
1
vote
1answer
331 views

12V Stepper Motor not working - vibrates but doesnt spin

I'm working on a project and unfortunately my DC motor is not working. I wired it like this, am using a brand-new motor (SP BN2A in this document, I scavenged it from a bidet I had at home), powering ...
1
vote
1answer
73 views

Code protection in External flash

I am implementing external code execution for STM32F765VG with NOR flash (8/16 bit). The idea is to execute code from external flash memory. are there any ways to protect my code present in external ...
1
vote
1answer
1k views

Problems with LCD initialization: 4-bit mode

I have this microcontroler with this LCD(DEM16216) mounted on it which I cannot initialize. Only 4 of the pins are connected, thus it runs in a 4 bit mode (I think?). I found the datasheet for it (...
1
vote
1answer
141 views

Programming of ADC in PIC12F675: Not Working Properly

I'm new to embedded systems and I want to program a PIC12F675 for a project. So, the idea is that there is a switch. If the switch is off, the microcontroller normally outputs a clock signal, which ...
1
vote
0answers
461 views

can't change LEDs states using PCA9685

I have a PCA9685 IC connected to i2c of cubieboard like board. Also OE pin is connected to one GPIO pin. I'm using ic2tools to communicate with PCA9685, I can read/...
1
vote
2answers
646 views

Writing MIPS assembly and machine code for instructions

I am continuing my practice with MIPS assembly and machine code. I am doing a problem that assumes the following: ...
0
votes
1answer
724 views

Custom code on a calculator

I have got this old Casio fx-92B calculator I am not using any more. I opened it up and found this: I am not an electrical engineer. Is there a possibility of tweaking this board to make it run ...
0
votes
3answers
102 views

Numbering format in code syntax

For the code, which I am referring following is syntax: Write_Parameter(0x00); In above line, what does "x" stands for and what is data size for x? My assumption is its dec format. So, What other ...
0
votes
3answers
285 views

Bitwise operators: Whats the difference ^= vs &= ~(smthg)?

I'm coding for microcontrollers and I've come across two styles of bitwise operations that quite confuse me a lot because they are used interchangeably. First let's assume our REGISTER has 4 bits; bit ...
0
votes
4answers
1k views

Code Optimization of IF Statements?

Considering the design limitation of hardware (clock speed, memory, etc…), is there any better way to write IF statements more efficiently in C language (e.g. run on Arduino), more specifically the ...
0
votes
2answers
2k views

Tantalum Cap Code Explained

I need to replace the following cap: It was placed at the input of a device that runs off 24Vdc, like the following schematic. simulate this circuit – Schematic created using CircuitLab I'm ...
0
votes
1answer
5k views

Functions that return Enums?

In Atmel ASF I found this piece of code ...
0
votes
2answers
1k views

Extra I2C on stm32f

I am using stm32f105 to control 5 I2C buses and some other peripheral circuits. The problem is that I used all dedicated I2C pins by other peripheral circuits. Is it possible I change a GPIO (General ...
0
votes
2answers
184 views

Verilog code question

I'm new in Verilog and I need to create a module that when Entry=1, it will increment 5'b000100 in the "Money" output. This is the code that I made, but it's not working properly. The program it's ...
0
votes
1answer
926 views

RTOS: Micrium uCOS vs Mentor Graphics Nucleus

We're working on a wearable IoT device, and I'm hoping for some guidance on the common commercially available RTOS, such as what's the difference between the two. As of current I'm leaning toward ...
0
votes
2answers
50 views

Most efficient way to switch order in which data is read in assembly

I have an assembly assignment that requires me to be able to store a number and via a lookup table output the number on a 7 seg display in both forward and reverse order depending on the state of an ...
0
votes
2answers
128 views

8051 microcontroller problem to find execution time of part1 for a given code

For the below mentioned 8051 assembly code: Time elapse: MOV R0,#100 Part 1 \$ \quad \, \, \,\,\$ : MOV R1,#50 Part 2 \$ \quad \, \, \,\,\$ : MOV R2,#248 Part 3 \$ \quad \, \, \,\,...
0
votes
1answer
48 views

Completing Gray Code Given Initial Part

I've been asked to complete the following 5 bit Gray code: I know how to generate a Gray code (create a mirror image, pad the original values with a 0 and the reflected part with a 1), but I'm not ...
0
votes
2answers
163 views

How does programming code provide power to electronic circuits? [closed]

I've been thinking about a question and haven't been able to find an answer. The question is that: For instance, an Arduino has a 5V output pin to feed any electronic component. When you code ...
0
votes
1answer
214 views

I'm writing a simple verilog code, having little trouble

In the image shown below, there says a syntax error at line 10. Its a basic If statement, i dont know why the syntax error shows up. Please advise
0
votes
1answer
123 views

What does it mean code for TFT LCD rgb?

What does it mean code for TFT LCD rgb? i dont know ("%s") or ("\x12" "kwh") or "%4u:%02U:%02u" ?
0
votes
1answer
47 views

AYTINYx4 - execute other code during analog conversion

I am using an ATTINY44 in my current project. As I need to do some time sensitive switching I would like to avoid any unnecessary delay. To control another device (not time sensitive) I need to read ...
0
votes
2answers
3k views

Self complementing Codes

This statement was deemed true: Given any self-complementing decimal code scheme, if we know the codes for the number 283, then we can deduce the codes for 671. I wanna know why. I took Excess-3 BCD ...