Jump to content
Electronics-Lab.com Community

Leaderboard

Popular Content

Showing content with the highest reputation since 08/14/2021 in all areas

  1. But even if we disable debug, it will call print method and do not print anything. I mean we should make it something like #ifdef DEBUG Serial.print("\n debug controlled print"); #endif Here when we disable macro, its like code is not written for compiler, code will be removed in macro processing itself.
    2 points
  2. Introduction Arduino IDE is a convenient tool to write your code and upload to microcontrollers. However, it doesn’t come with debugger function, which means the only way to debug our program is through using debug message through standard output, in this case, Serial Monitor. Debug message is handy and it helps to print out the information the registers holds at a specific time, but once you have done debugging and your program is ready to go, we often have to delete/comment out those debug message code manually, in a big project, this could be problematic as there are just too manny of them. Today, I am going to show you an easy method to turn on / off debug message with only a few lines of code. Method Take a look of the following C code, //#define __DEBUG__ #ifdef __DEBUG__ #define DEBUG(...) printf(__VA_ARGS__) #else #define DEBUG(...) #endif Since all Ameba microcontroller supports printf(), we can re-define printf() to a preprocessor function, in this case, I name it DEBUG(). Whenever you want to print out the debug message, instead of Serial.print() or printf(), you should try using DEBUG() instead, it works just like the previous two, but can be easily enabled or disabled by uncomment //#define __DEBUG__ or just leave the comment syntax there. Let’s look at an example Example code 1 This is a simple code that only print out “Debug msg 1” and “Debug msg 2” alternatively with a 1 second delay in between. Screenshot 2021-01-22 1639441919×1079 173 KB Note that the first line of the code is uncommented, and we are seeing the debug messages actually got printed out using the DEBUG() function. Example code 2 Screenshot 2021-01-22 1641171920×1077 127 KB Note that this is the same code except I keep the first line commented out, and as a result, no debug messages got print out at all. It works! Conclusion All you need to do is to copy the few lines of code from above into the top of your arduino sketch and you may name your custom debug function anything you like and it will work like a charm. Turn on / off is just to keep / remove the // at the first line, very convenient. Hope you like this content, stay healthy and happy coding~
    1 point
  3. I am confused with the two SIDACs (Silicon Diode for Alternating Current) in series. They are rated 220-250 volts switching each. 240 mains voltages would be in the order of 340*1,4 or 480 volts peak. About the same as the two SIDACs; not much to switch with? "These tasks of the starter are taken over by two 135 V sidac (or a single 270 V one). The starting voltage is thus 270 V, Which is below the peak value of the mains (about 340 V), but higher than the working voltage of a 20-40 W neon tube." see: https://circuit-diagramz.com/sidac-neon-tube-starter/ I will look at the circuit some more.
    1 point
  4. If you look in the IDE at [tools] -> boards you will see the Nano and the Duemilanove. You will not see the port listed until you select the board and have a board or adapter connected. The Meg2560 has a different AVR microcontroller; an ATmega2560. If you search on Youtube for the FT232RL (the USB to serial/TTL Adapter) you will find numerous videos. Speaking of ports, the current port is shown in the IDE in [Tools] also in the Preferences file. The Preferences file can be found [file] -> Preferences. That brings up a pop up window containing the path to the file. Near the bottom of the file can be seen the comport listed in two places. Also in the Device Manager it is listed under Ports(COM & LPT). Device Manager is via [Windows] + [x]. Sometimes you can edit the Preferences file to bring the comport inline with the device port iIf the IDE gets confused. You may know this but others may not. (I screwed up the fonts by cut and past again)
    1 point
  5. As this chip is made by Analog and Analog owns LTspice simulator the circuit appears in the simulator and can be explored there. The circuit there is slightly different. Note it uses the FDS6680A mosfets. If you want 10 amperes make sure the mosfets can handle the current. Go here and put in your requirements then you will see some 10 ampere chips: https://www.analog.com/en/parametricsearch/11491#/p5573=min|24&p5574=100|max&p5347=min|12&p5357=12|max&p5349=10|240&qsfv=vinmin|24_vinmax|100_vout|12_iout|10&p5362=Buck
    1 point
  6. Do you think it is a D6Gi1K or D6GiLK ? After the G it looks like an aye i gather. Not even close: http://twitpic.com/d6gilk SOT323 is a SMD package type; it has only three leads. Often a transistor.
    1 point
  7. I'm looking forward to the next post)Keep it up!
    1 point
  8. what else is there?
    1 point
  9. This site gives the MPXV7002DPT1 as an alternative to the MPXV7002DP see: https://www.apogeeweb.net/circuitry/mpxv7002dp-transducer-datasheet-features-pinout.html#product-overview This one has a list of exact alternatives also: https://www.newark.com/nxp/mpxv7002dpt1/pressure-sensor-2-to-2kpa-sop/dp/28X3717
    1 point
  10. There is a library file ( GOLANG library for SPI ) here that maybe helpful? https://github.com/stamp/CS5484 I have problems finding the page that has the {code} button to download the file; you may have to dork around with the URL a bit.
    1 point
  11. 1 point
  12. Kevoh

    LATCH CIRCUIT

    I need to build a latch circuit with one tactile switch and mosfets. Any idea how to go about it Will help.
    1 point
  13. repairman2be

    0-30V 0-3A Latest Data

    Hi all, Finally after some months have gone by, my build of the Power Supply is done. I have used liquibyte schematic Rev. 8 and had made the cirquit board according to the Gerber.zip file he posted here: 0-30V Stabilized Power Supply Page 88 posted October 6, 2014 "http://electronics-lab.com/community/index.php?/topic/29563-0-30v-stabilized-power-supply/&page=88" I left out D10 and R15 as per his description. I have plenty of boards leftover if someone has a need for it. There was only one mistake liquibyte made which have outlined in one of the pictures uploaded here. I was fortunate enough to get a big case with a Toroidal transformer from the scrapyard. Also many parts are recycled from various sources. Regards, William
    1 point
  14. Transistors are all different. There are good ones and there are poor ones. The worst (but still passing) 2N3055 transistor has a collector to emitter leakage current of 0.7mA but a good one has much less. The collector-base leakage current is much less (a maximum of only 3.5uA at 25 degrees C) then it is amplified maybe 200 times by the current gain of the transistor so the 1k resistor from base to emitter completely kills the leakage current. R16 in our project is the "R" for the output transistors so they do not have leakage current. If R16 is missing then the output transistors will amplify their collector-base leakage current which will cause them to turn on.
    1 point
  15. The collector-base junction of a transistor has a small leakage current that increases when the temperature increases. The current gain of a transistor amplifies the resulting base current which turns on the transistor. R16 shunts the collector-base leakage current away from the base. Of course not, the collector-base leakage current causes Q4 to turn on. Leakage current and dielectric absorption in C7 causes the output voltage to rise when the load current is zero or is low. The datasheet for a 2N3055 transistor shows that its maximum collector to emitter leakage current is 0.7mA when it has a Vce of 30V, it is at 25 degrees C and it has no base current with its base not connected.
    1 point
×
  • Create New...