hybridfree/eevblog-posts huggingface dataset:
PI - Servo stops turning after a few turns? Do I need to power it separately? - Page 1
Forum section: electronics / beginners

author: NameToRemember
author_rank: Newbie
timestamp: June 02, 2020, 04:05:53 pm
content: I am trying to get a servo motor to work with my raspberry pi for the first time. I have successfully got it to turn when I run a simple python script but was just wondering if this problem is because the servo motor needs to be powered externally by itself? I read online that the current being drawn to move the servo can sometimes be too much for the PI to handle powering from just the board. I also understand that the PWM needs to be setup right according to your servo. I have tried about 5 different scripts and all of them have the same outcome. I followed along a youtube tutorial where they are using the exact same pi and servo motor.If I do need to power the servo separately can I do so using some AA alkaline batteries in series? I know there are better ways to power the servo using separate 5v power supply boards but would like to know this is the problem before i buy them.servo: SG90 9gVideo of the servo stopping in a while True continuous loop:My python script running on the Pi:Code:from gpiozero import Servofrom time import sleepmyGPIO=4servo = Servo(myGPIO)print("Rassberry Pi Servo");while True:servo.min()sleep(0.5)servo.mid()sleep(1)servo.max()sleep(1)

author: Benta
author_rank: Super Contributor
timestamp: June 02, 2020, 04:30:36 pm
content: What do you means with "stops after a few turns? It's only supposed to turn +/- 90 degrees.But yes, you should power it separately. DC motors and low power circuitry don't mix well.

author: NameToRemember
author_rank: Newbie
timestamp: June 02, 2020, 04:44:29 pm
content: Quote from: Benta on June 02, 2020, 04:30:36 pmthe script that is running is a While True: keep moving the servo motor so in theory the servo should never stop but it does after a few turns. By turns i mean from -90 to 0 to 90 degrees and then back to -90 in a loop.

author: wizard69
author_rank: Super Contributor
timestamp: June 02, 2020, 05:23:39 pm
content: Start debugging!First increase the delays between moves to see if there is an impact there.By the way make sure the app isn't crashing or other wise halted.Ad a few print line debug strings. This can be helpful as it shows you that the program is still executing. If it stops executing you may be able to determine where it stops.A separate power supply for the servos is always a good idea. Will it help here I have no idea.Get rid of the min and max commands and replace them with commands that go 75% of the way there.Ask yourself what you you do to get the unit to run again.
Piaware Box Cooler - Page 1
Forum section: electronics / beginners

author: HoracioDos
author_rank: Frequent Contributor
timestamp: February 08, 2018, 01:03:11 pm
content: Hello!Yesterday I built a PiAware box with a raspberry pi and a RTL-SDR V3 inside a plastic case. I'm almost sure that it's going to be installed outdoors. As the receiver and the pi can get too hot I would like to build a simple temperature controlled circuit to cool them with a peltier. I don't care about low temperatures because we have quite warm winters. So it doesn't need to be heater/cooler circuit.Does anybody have a simple circuit to start from? I found this circuit as a concept.Thanks in advance!

author: HoracioDos
author_rank: Frequent Contributor
timestamp: February 08, 2018, 02:33:51 pm
content: Hello!After searching a while I think I could use a H bridge motor controller to drive the peltier. Going back and forward it could get heat and cold. As this controller can handle 5.5V to 27V and up to 43A I'm pretty much covered.https://www.ebay.com/itm/Double-BTS7960B-DC-43A-Stepper-Motor-Driver-H-Bridge-PWM-For-Arduino-Smart-Car/200950936475?epid=1062875951&hash=item2ec99bf39b:g:xE8AAOSwWDNZlB6His this idea correct?Thanks!

author: viperidae
author_rank: Frequent Contributor
timestamp: February 09, 2018, 06:15:20 am
content: A Peltier device doesn't cool things down, it transfers heat from one side to the other. You'll still need to dissipate the heat that is transferred, along with the extra heat from powering the Peltier.

author: HoracioDos
author_rank: Frequent Contributor
timestamp: February 09, 2018, 06:51:37 pm
content: Quote from: viperidae on February 09, 2018, 06:15:20 amOk thanks. Peltier should make contact to rtl sdr dongle and it would need a heatsink and a fan in the opposite side. Both (Heatsink and fan) should be outside of the box to dissipate heat.PD: I was thinking about something like this to build a cooler/heater
PIC 16HV Family - Page 1
Forum section: electronics / beginners

author: Isaac Newton
author_rank: Contributor
timestamp: November 19, 2012, 03:42:18 am
content: Hey guys,I'm thinking of using one of the pic16f family members for one AC powered project and, choosing the right resistor and the right cap, can I use the equivalent for the pic16HV family powered directly from the mains? I would need some sort of protection circuit for the garbage that we find on the AC line, but the idea is the same. Well, sure it would reduce the costs with parts to build a AC-DC convertes but it all seems to be too good to be true...

author: marinedalek
author_rank: Contributor
timestamp: November 19, 2012, 04:59:54 am
content: The highest voltage rating I can see for the PIC16HV range is 15V, which is also a DC rating, not AC. You would still need a transformer with a suitable tap along with a reservoir capacitor and, depending on load, possibly a regulator. The simplest solution is to cater for a 3.3 or 5V voltage rail (which you'll probably need for digital logic anyway) and use a regular PIC16F. In looking up the range of the 16HVs I discovered that there's barely any information on them other than the datasheets, so they don't seem particularly widespread.

author: Bloch
author_rank: Unknown
timestamp: November 19, 2012, 07:47:35 pm
content: Quote from: Isaac Newton on November 19, 2012, 03:42:18 amSurehttp://ww1.microchip.com/downloads/en/appnotes/00954A.pdfbut promise me that you will read and understand all the warnings in the PDF

author: Isaac Newton
author_rank: Contributor
timestamp: November 20, 2012, 02:26:27 am
content: Thanks.

author: Psi
author_rank: Super Contributor
timestamp: November 20, 2012, 09:19:50 am
content: While there's nothing wrong with capacitor based mains power supplies you do need to think carefully about your circuit I/O, since it's not mains isolated like it would be if you used a transformer.There are also a few types of capacitor mains powersupplies, some are earthed and some move up and down with the mains voltage.Note: Figure 11 on page 10 of that PDF seems wrong, or I just don't like it.It's got no current limit capacitor in series and just has 2K of resistance plus the zener across the mains. ??Even assuming its for 110VAC, that's 150V peak into 2k = 75mA = 11.2W into two 5W resistors (10W).It would probably work since the voltage isn't at peak for much duty but it's still not a good design.

author: Isaac Newton
author_rank: Contributor
timestamp: November 20, 2012, 08:36:33 pm
content: I agree. I give up using this option. I mean, transformers aren't expensive, so...

author: RCMR
author_rank: Frequent Contributor
timestamp: November 21, 2012, 03:13:43 am
content: Hell, just use a disassembled fake Apple USB supply -- I know where there are two that will be going for a song right now!
PIC ADC and Bluetooth Pairing Causing Voltage Spikes - Page 1
Forum section: electronics / beginners

author: Veramacor
author_rank: Regular Contributor
timestamp: September 28, 2010, 05:49:53 pm
content: Hello all,I got a problem and wondering if there any suggestions out there...I have a PIC16F886 micro, a sensor, and bluetooth module.The circuit gets its power from a +5V 500ma power supply. All chips are running 3.3v thru a 1 amp 3.3v Regulator, with 100uF and 10uF filter caps on the power supply.When I read voltages with the bluetooth module off, everything works as expected. But when I have the bluetooth turned on, it goes in to a pairing mode (searching to pair to a bluetooth dongle).When in this pairing mode I get a 300mv voltage dip every 500 milliseconds on the ADC line. I looked at the specs and the maximum output of the bluetooth dongle is about 10millamps.Is there any way to filter this spike out without adding a separate power supply to the bluetooth module?txJ

author: jahonen
author_rank: Super Contributor
timestamp: September 28, 2010, 06:04:43 pm
content: Could this be a EMI (self-compliance) problem? Bluetooth RF-signal being inadvertently rectified on nonlinearities on the ADC input? Have you verified the voltage dip with DMM etc? Also, if that is not the case, try to measure the actual pulse current requirement of the bluetooth module (with a scope using a small (0.1 ohms or less) series resistor in bluetooth module supply line) if pulse current is not specified in the datasheet, and decide what is best to do.Regards,Janne

author: scrat
author_rank: Frequent Contributor
timestamp: September 30, 2010, 03:52:47 pm
content: Could you please post some other information (through hole or SMD components? layout or at least a schematic)? It would be much more easy to find a solution, there are lots of experienced people here (not me).Although you may already have done, I'd suggest putting small value caps between supply and gnd pins of all the ICs, with very short leads/tracks. If the voltage dip is the cause, a big capacitor on the supply of the bluetooth module could help, also together with a small resistance or inductance in series to split the two supplies (I'd put it on the side which has less current transients, so I suppose on the PIC side):heavy cap || bluetooth modulesupply /\inductor/ferrite bead/1-10 Ohm resistance -> heavy cap || (PIC&friends, each || with small cap)
Pic and pickit 3 - C language guide - Page 1
Forum section: electronics / beginners

author: Vancata
author_rank: Contributor
timestamp: March 15, 2014, 10:33:04 am
content: Hello there folks.Again i have some boring question. Just bought the pickit 3 and now i'm in the "business". I need some logic for my hobby projects and i find the arduino pretty sucked up, lack of control, slow processing et.c I have it with one atmega328 but i don't feel really "free" with the code when i'm programming it. Everything is premade on high level language and i don't see the stuffs behind it.I'm looking for some book/online site for "C" so i can start with base level language for programming the pic mcu's. I'm beginner, i know some C but i'm not so confident in my knowledge. The idea is to start with C and move in some assembly language in the parts where i need optimal code.I'm pretty open for any suggestionsbtw: thumbs up for the forum and the folks here, not many places where you can ask your rookie questions and some pro's take the time to explain you stuffs.

author: Chris.M
author_rank: Contributor
timestamp: March 15, 2014, 10:53:29 am
content: Take a look atwww.mikroe.com/products/view/11/book-pic-microcontrollersfor an understanding of a PIC microcontroller andwww.gooligum.com.au/tutorials.htmlfor PIC tutorials in C.For a free IDE, check out MPLabX from Microchiphttp://www.microchip.com/pagehandler/en-us/family/mplabxand their XC compilerswww.microchip.com/pagehandler/en_us/devtools/mplabxc. Some of the compilers are free and each one has an in depth manual for how the C programming language works with that compiler.

author: Vancata
author_rank: Contributor
timestamp: March 15, 2014, 11:01:15 am
content: Thanks."PIC Microcontrollers" book looks just right for me, with a lot of pictures and explanations for beginners. Time to make some coffee and jump in to the pic-mcu "pool".

author: rollatorwieltje
author_rank: Unknown
timestamp: March 15, 2014, 11:14:21 am
content: Not trying to start an Atmel/PIC war, but you are aware that "Arduino code" is actually C / C++? If you're not happy with any of the supplied libraries, it's trivial to write your own stuff. Inline assembly is also easy if you really want it.The C code Arduino uses is in the IDE folder (hardware\arduino\cores\arduino).The Arduino IDE is horrible, but you can basically use any IDE that supports the GCC toolchain. I use Eclipse. I think there is even a manual on the Arduino website that explains how to set up Eclipse.
PIC -> or gate -> LCD ? - Page 1
Forum section: electronics / beginners

author: SilverHawk
author_rank: Contributor
timestamp: March 19, 2016, 02:32:42 pm
content: Im having trouble understanding why are the (or gates) necessary ?, does it have to do with delay ?Ive uploaded the datasheet for the ic , lcd , the pic im using is PIC18F46K20

author: ade
author_rank: Unknown
timestamp: March 19, 2016, 02:57:45 pm
content: They're using it for level shifting maybe? The PIC is at 5V and the LCD is at 3.3V. That OR gate chip might be a 3.3V device that's 5V tolerant.

author: SilverHawk
author_rank: Contributor
timestamp: March 19, 2016, 03:00:39 pm
content: can you elaborate a little bit about level shifting , im a beginner and i have no idea what that is.

author: SL4P
author_rank: Super Contributor
timestamp: March 19, 2016, 09:08:58 pm
content: Quote from: SilverHawk on March 19, 2016, 03:00:39 pmA *really* badly drawn schematic!

author: mariush
author_rank: Super Contributor
timestamp: March 19, 2016, 09:29:06 pm
content: If you have a microcontroller powered from 5v and you send a digital 1 on a pin, at the end of that pin you'll get 5v.Problem is you may want to connect a device like a LCD display as shown in the picture which was designed to run on a lower voltage and will probably be damaged by 5v.You work around that by introducing something between the microcontroller and the lcd display, a simple component that's powered from the lower voltage but which has an input that can handle up the higher voltage on the input but outputs only as much as the chip's input voltage.The other way is also possible, to shift from a lower voltage to a higher voltage, see for examplehttp://electronics.stackexchange.com/questions/81580/step-up-3-3v-to-5v-for-digital-i-ofor a detailed post with examples.

author: KL27x
author_rank: Super Contributor
timestamp: March 20, 2016, 12:06:44 am
content: QuoteI am, also.Badly drawn schematic aside...I know of no reprogrammable PIC that cannot run down to at least 2.0V.I know of no HD33780 LCD that cannot run on 5V.Even if I needed to run the PIC on 5V and LCD on 0V, I would just put a 4.7K-10K resistor between each PIC output pin and LCD input pin. No pulldowns. No OR gate IC.Maybe he needed a buffer to get the refresh rate from 60 Hz to 62 Hz.

author: SilverHawk
author_rank: Contributor
timestamp: March 20, 2016, 12:41:56 am
content: sorry about the schematic guys, i didnt draw it though , part of school project

author: Zero999
author_rank: Super Contributor
timestamp: March 20, 2016, 11:05:20 am
content: It doesn't give enough information, such as part numbers, especially for the gates.

author: danadak
author_rank: Super Contributor
timestamp: March 20, 2016, 12:57:54 pm
content: These might help -https://www.maximintegrated.com/en/app-notes/index.mvp/id/3007http://www.nxp.com/files/microcontrollers/doc/app_note/AN2433.pdfRegards, Dana.

author: SilverHawk
author_rank: Contributor
timestamp: March 21, 2016, 03:17:16 am
content: Thank you all for your answersIve uploaded the lcd and ic datasheet if you guys are curious
Pic input/output pins - Page 1
Forum section: electronics / beginners

author: Zedy
author_rank: Contributor
timestamp: June 24, 2010, 11:56:58 am
content: hi!Just started a project, and have some question, if I make TRISC ('b'00001111), and try to write(for example):movlw 0xFFmowf PORTCwhat will happen? will the input pins ignore this, because they are inputs?

author: Strube09
author_rank: Regular Contributor
timestamp: June 24, 2010, 03:08:24 pm
content: For PIC, when you set the pin as an input you disable the output driver for that pin. So writing to the port(x) pin will not affect the pin.However I do believe that if you change the pin back to an output it will then display whatever your last write to the port(x) register was. So be sure to set the pins to a default or safe position before enabling any pin as an output.

author: Zedy
author_rank: Contributor
timestamp: June 24, 2010, 06:54:07 pm
content: Thanks for helpabout pull-up -> referring to datasheet OPTION Register controls pull-ups
PIC MCU LAT register  - Page 1
Forum section: electronics / beginners

author: sairfan1
author_rank: Frequent Contributor
timestamp: September 07, 2023, 06:25:29 pm
content: I'm back to PIC MCU after long time. For PIC MCU we can use TRIS to set direction of port like input/output and we can read or set values directly from port like PORTAI totally for got what is the purpose of the LAT register here like LATCbits.LATC0 I remember its something related to assigning value to a port bits but with is difference between setting a value to LATx or PORTx

author: FireBird
author_rank: Regular Contributor
timestamp: September 07, 2023, 06:49:13 pm
content: You use the PORT register to read the state of the pins and the LAT register to set the state of output pins.

author: jpanhalt
author_rank: Super Contributor
timestamp: September 07, 2023, 08:00:10 pm
content: As stated, in theory, you must read a Port and write a LAT. Unfortunately, they are in different banks, which should require a Bank change, but they have the same offset (I am only familiar with 8-bit MCU's). Sometimes, I write the port on a LAT-chip as one did with the much older, non-LAT chips and it works fine. Simulation, both hardware and software, shows the LAT bit being changed. That is not a recommended practice, though.

author: MarkF
author_rank: Super Contributor
timestamp: September 08, 2023, 04:15:30 pm
content: LAT vs PORT really depends on the flavor of PIC you're using.The best way to understand the difference is by looking at the 'port' section of the datasheet.Here is a highlighted excerpt from a 32MX PIC:I believe the reason for the incorporation of the LAT register was to allow read-modify-write operations.

author: jpanhalt
author_rank: Super Contributor
timestamp: September 10, 2023, 07:24:56 pm
content: Quote from: MarkF on September 08, 2023, 04:15:30 pmRMW operations have always beenallowed, and it is my understanding that C did not include work arounds natively. That is, bit setting was common.A lot of hullabaloo is made about RMW, but if one paid attention to what was on the port, it was infrequently a real problem.

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 10, 2023, 08:00:21 pm
content: It's the opposite, to remove the problems derived from RMW using PORT.Quote from:https://ww1.microchip.com/downloads/en/DeviceDoc/70058D.pdfFor example, you could write "1" to RA1, then read RA1 again, and get 0 because the output didn't had enough time to toggle.Or if the output was shorted, you would always read 0 no, matter what.Reading/writing to the LAT register avoid all this.The output might be shorted or not have toggled yet, but LATA1 will be read "1" just after setting it.Another example. Imagine you wanted to toggle some outputs really fast in a PIC18.This might NOT toggle RA1 4 times!Code:btg PORTA,1,0btg PORTA,1,0btg PORTA,1,0btg PORTA,1,0But this will for sure (Or at least try, no matter the output load):Code:btg LATA,1,0btg LATA,1,0btg LATA,1,0btg LATA,1,0
Pic mcu not responding when sharing ground with other devices.  - Page 1
Forum section: electronics / beginners

author: Pariston
author_rank: Contributor
timestamp: December 04, 2020, 02:41:30 pm
content: Hi,I am not sure what is happening here. I am able to program mcu from a pickit3 without any problem, but when I connect ground of this mcu to grounds of other devices(caps, nmoss, buck converter, ground of high power led, boost converter), it just stops responding. All other devices operate without a problem.

author: msat
author_rank: Regular Contributor
timestamp: December 06, 2020, 01:53:37 am
content: Do you have decoupling caps near the mcu's power inputs?
PIC oscillator circuite - Page 1
Forum section: electronics / beginners

author: Zedy
author_rank: Contributor
timestamp: December 26, 2010, 02:45:13 pm
content: hey!Some simple question:A series resistor, Rs, may be required for AT strip cut crystals, it is said in pic datasheet.So... if I have Series resistance of 100 ? in Quartz datasheet, is it the same resistance what pic datasheet is talking about?

author: Simon
author_rank: Unknown
timestamp: December 26, 2010, 02:50:15 pm
content: can you clarify the question please ?

author: Zedy
author_rank: Contributor
timestamp: December 26, 2010, 02:59:24 pm
content: Quote from: Simon on December 26, 2010, 02:50:15 pmsorry about my bad english,but what I what to know is should I use this serial resistor?

author: Simon
author_rank: Unknown
timestamp: December 26, 2010, 03:02:51 pm
content: The datasheet for the resistor and pic in question should show you the common basic diagrams for setting the crystal up

author: djsb
author_rank: Super Contributor
timestamp: December 26, 2010, 03:39:47 pm
content: Post the page from the PIC data sheet AND the crystal data sheet (in PDF form) or cut and paste the relevant data here if you can (as an image) and we will be a lot clearer as to your meaning. Thanks.

author: migsantiago
author_rank: Frequent Contributor
timestamp: December 26, 2010, 03:47:52 pm
content: Quote from: Zedy on December 26, 2010, 02:45:13 pmHi!The datasheet says you should consult the datasheet for the crystal you're using. The manufacturer should say what resistor you should use.I wouldn't care so much about that resistor. I've never had to use it before.

author: djsb
author_rank: Super Contributor
timestamp: December 27, 2010, 12:47:38 pm
content: These Microchip application notes may also be useful• AN826, “Crystal Oscillator Basics andCrystal Selection for rfPIC ® and PIC ®Devices” (DS00826)• AN849, “Basic PIC ® Oscillator Design”(DS00849)• AN943, “Practical PIC ® OscillatorAnalysis and Design” (DS00943)• AN949, “Making Your Oscillator Work”(DS00949)David

author: Zedy
author_rank: Contributor
timestamp: December 27, 2010, 10:26:29 pm
content: Quote from: migsantiago on December 26, 2010, 03:47:52 pmcrystal datasheet is very poor, and doesn't say anythingQuote from: djsb on December 26, 2010, 03:39:47 pmI usually don't care about oscillator, but this time I need very precise frequency.

author: tecman
author_rank: Frequent Contributor
timestamp: December 29, 2010, 11:49:18 pm
content: I believe your datasheet data is referring to the equivalent series resistance of the crystal at resonance. Usually a series resistor is not required, and as stated only for crystals with low drive power requirements.I would not use a resistor.paul

author: Zedy
author_rank: Contributor
timestamp: December 30, 2010, 12:23:44 pm
content: Quote from: tecman on December 29, 2010, 11:49:18 pmThank you, it was, what I wanted to hear
PIC12F675 COUNTER - Page 1
Forum section: electronics / beginners

author: neko efecktz
author_rank: Regular Contributor
timestamp: March 25, 2017, 04:10:12 am
content: Good afternoon everyone.last week I asked for help getting a counter to display to a LCD.This week I need more help, also with a counter but for different reasons.I am building a module that mount on top of our coffee maker.one of those ones that takes PODS or CAPSULES.The bin for holding the used capsules can only hold 18 or 19 capsules.with 19 I have trouble getting it out.I bought an 8pin development board and it came with a PIC12F675 preloaded with a simple flasher that flashed the 2 LEDs at the same time. Could have made the demo a little more interesting.The board hasLED1 on GP0LED2 on GP1KEY1 on GP2RESET on GP3ADC on GP4KEY2 on Gp5I have done my program using the same IO configurations.My code is attached below.The problem is that LED2 is on all of the time.If I press RESET LED1 comes on for a brief moment then goes out.The counter has no effect, it should count to 6 then turn on the led.I thought this might be the 200ms delay I have to test the unit, but when I change the delay to 2000ms I.e. 2 secLED1 stays on for about 7 seconds. "by counting to myself."I REM'd out the entire counter section which left LED1 & Led2 both set to a low level,however It Didn't Work.Both LEDS are on all the time and when I press RESET Both of the LEDs dim to aprox 1/2 brightness until I release the reset.I think the problem could be the way I have named the pins.Any help Would be appreciated.my code has only one file. COFFEE MAIN.c

author: CJay
author_rank: Super Contributor
timestamp: March 25, 2017, 07:58:08 am
content: You need to look at the hardware and work out how the LEDs are connected, you explicitly set LED2 to 0 and it lights, that suggests the LED is connected to 5V and the PIC is sinking current, not sourcing.Try changing LED2=0; to LED2=1; and see if the LED goes off.Once you've worked out the hardware then you can work on the program logic as you don't ever change the state of LED2 anywhere in the attached code after that line.I suspect the key switches are similarly connected and raise the input pin to 1 when pressed so it'll always be a zero while the switch isn't pressed, making your counter run forever unless you push the switch.

author: neko efecktz
author_rank: Regular Contributor
timestamp: March 25, 2017, 09:35:28 am
content: Cjayyour right.I found some bits missing from the code and have added it in.The LEDs are wired to be on when low which is not how I would do it.I may have to build my own development board for these chips.The main problem however was about 4 lines missing at the top ofvoid main(void)I had just found the problem whilst getting ready for dinner so I didn't have time to update/edit this feed.edit...an updated version is belowThank youBILL.
PIC16F1827 and LM35 ADC impedance - Page 1
Forum section: electronics / beginners

author: PerranOak
author_rank: Frequent Contributor
timestamp: May 22, 2018, 02:55:35 pm
content: I'm trying to design a simple circuit to use a PIC16F1827 and LM35 to create a simple thermometer.The PIC datasheet says that the maximum recommended impedance of the analogue device is 10kOhms. I measured the resistance of the LM35 (output to ground) which was 43kOhms.Is this recommendation one I can just ignore?Or ... could I simply delay the start of measurement to accommodate the slower charging of the sample/hold capacitor? [the datasheet calc gives acquisition time as about 1us with 10kOhm so the LM35 would give about 3us)Or ... could I put a 10kOhm resistor in parallel to the LM35 output: this would give a total resistance of about 8kOhm?Thank you.

author: tecman
author_rank: Frequent Contributor
timestamp: May 22, 2018, 03:27:42 pm
content: The LM35 has an active driver. The datasheet has a load regulation of 0.5 mv/ma, which implies an output impedance of 0.5 ohms. Measuring the resistance of the output pin to ground when powered off is not a meaningful number. So adding a series R to the output is no problem. However the max recommended is not a value you would use. You should be able to connect it directly to the PIC. You could add a 100 ohm for some noise isolation if you wish.paul

author: PerranOak
author_rank: Frequent Contributor
timestamp: May 22, 2018, 04:20:57 pm
content: Brilliant, thank you very much.

author: StillTrying
author_rank: Super Contributor
timestamp: May 22, 2018, 04:22:04 pm
content: It's the large amount of negative feedback that gives the LM35's output less than 1R output impedance, which only works when it's powered up, and sourcing a small current.
PIC18F24 / IOC - INT priority  - Page 1
Forum section: electronics / beginners

author: Nikan
author_rank: Regular Contributor
timestamp: May 06, 2021, 01:13:53 pm
content: Greetings,I am new to PIC's, just have a few questions about the PIC18F24 interrupts.1. is it possible to have all 3 interrupts and some IOC's running at the same time?I understand that the 3 interrupts have a two level priority.2. which priority is higher, IOC or low priority?Thanks in advance and best regards from Germany!
PIC18f4431 PWM signal sampling - Page 1
Forum section: electronics / beginners

author: uzykc
author_rank: Newbie
timestamp: April 14, 2010, 11:37:38 pm
content: Hi Everyone. I am trying to read in a pwm signal from a receiver in to my PIC18f4431 uC. How can i do this to determine the PWM's frequency/period, amplitude and duty cyle? Please help!

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 03, 2010, 10:59:26 am
content: does the pic have timer interrupt feature? or comparator built in. i ran through my avr chip manual and come accross with this features, which i might think suitable for this purpose. but i never implemented it as there is no need for me right now. and i dont have your pic, so who knows?

author: uzykc
author_rank: Newbie
timestamp: May 13, 2010, 07:49:59 pm
content: Yes, it has a timer interrupt and a built in comparator. Please advise on this if you can. Thanks.

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 14, 2010, 03:14:46 am
content: i never implement it. but the way i see it, you can connect your pwm signal to comparator pin, set that pin as "comparator" active, code the interupt handling in programming such that var=var+1 where var is how many "ON" duty have occured divide it by time taken (var/time) = freq, or better yet, you can watch the comparator timer count, divide by time = freq. to get duty cycle, you can set the pin as timer counter rising detect or something like that (as i said, i've never done this, you need to do some experimenting and reading). if the timer is 16bit, you can get the duty %=counter/(2^16). generally should be like that.

author: viperidae
author_rank: Frequent Contributor
timestamp: May 14, 2010, 10:28:28 am
content: You can use the capture and compare function (CCP or ECCP)Set the ccp to capture rising edge signals.When the interrupt fires, save ccp timer value and reconfigure it to falling edge.Make sure the ccp is configured to reset the timer automatically. or you'll have to do that on interrupt too.When the falling edge triggers the ccp, you can use the previous ccp value to calculate the duty cycle and frequency. You'll need to reconfigure the ccp to capture rising edge again as well.Assuming the two ccp values are stored in A and Bduty cycle = B/(A+B)frequency = 1/(A+B) * (some constant depending on the frequency of the timer)Be very careful about doing arithmetic in interrupt routines, especially * and /. and even more so on variables larger than 8 bits. They can take a very long time to execute and you run the risk to losing interrupts if your interrupt routine is still executing (so hasn't yet cleared the interrupt flag) when the next event comes in.

author: Simon
author_rank: Unknown
timestamp: May 14, 2010, 12:38:50 pm
content: also remember that the pic will only be accurate up to about the same PWM frequency as it can generate itself,
PIC18F4550 pin Input/Output code - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: April 29, 2016, 08:14:48 am
content: I am using PIC18F4550 with MPBALX IDE V2.26, Xc8 V1.32.Below are codes for making pin as output & input. Are these codes ok.I have tried on proteus & it is working. But after few seconds, it throw warning that not in real time due to excessive cpu load.1. Output/* output low w& make it output */LATBbits.LATB0 = 0U;TRISBbits.TRISB0 = 0U;/* make low & the high */LATBbits.LATB0 = 0U;LATBbits.LATB0 = 0U;/* keep on inverting */while(1){LATBbits.LATB0 = !LATBbits.LATB0;}2. Input/* output low w& make it output */LATBbits.LATB0 = 0U;TRISBbits.TRISB0 = 0U;/* make it input */TRISBbits.TRISB1 = 1U;/* keep on reading */while(1){LATBbits.LATB0 = PORTBbits.RB1;}
PIC18F46K42 xpress EVAL Board - ADC program - Page 1
Forum section: electronics / beginners

author: arul
author_rank: Regular Contributor
timestamp: December 01, 2018, 11:33:02 am
content: Hi,I have a PIC18F46K42 xpress evaluation board. Now I am developing one of the ADC program using MPLAB Xpress PIC18F46K42 evaluation board on MPLAB CLOUD IDE. I make one of the simple circuit for that program using variable power supply, resistor. I am varying the power source, but that ADC result register value does not change, only shown 0x00 (i got that value 0x00, in debug mode). I have attached my code and circuit.Please let me know, what is going wrong.....void main(){int RH, RL;ADCON0bits.FM = 1;ADCON0bits.CS = 1;ADPCH = 0b00011100; //RD4 is analog inputTRISDbits.TRISD4 = 1;ANSELDbits.ADSELD4 = 1;ADCON0bits.ON = 1;while(1){ADCON0bits.GO = 1;while(ADCON0bits.GO);RH = ADRESH;RL = ADRESL;}}
PIC24 capacitor value for crystal - Page 1
Forum section: electronics / beginners

author: Unknown
author_rank: Unknown
timestamp: May 16, 2014, 02:54:30 pm
content: I want to use this crystal :http://it.mouser.com/Search/ProductDetail.aspx?R=TSX-3225_16.0000MF10U-B0virtualkey64320000virtualkey732-322516MF10U-B0for a pic24 but i have a doubt on the capacitor value.The datasheet says " Load capacitance : 7pF to Infinity " . What value should i use? I have some 12.5 pF, are they ok?Thanks for the help.

author: 22swg
author_rank: Frequent Contributor
timestamp: May 16, 2014, 08:00:31 pm
content: Its quite likely your 12pf will only be around 10pF anyway will be fine, I am curious as to why you need external osc / xtal with PIC24 ?

author: mariush
author_rank: Super Contributor
timestamp: May 16, 2014, 08:24:47 pm
content: Most need 12-18pF so what you have now should be good.

author: 8086
author_rank: Super Contributor
timestamp: May 16, 2014, 08:31:38 pm
content: Always err on the side of caution, better go with infinity.

author: Unknown
author_rank: Unknown
timestamp: May 16, 2014, 09:45:34 pm
content: Quote from: 22swg on May 16, 2014, 08:00:31 pmI need an external osc because i'm using the usb module.

author: pipe
author_rank: Contributor
timestamp: May 17, 2014, 08:48:39 am
content: Quote from: exapod on May 16, 2014, 09:45:34 pmAre you sure it works with a 16 MHz crystal for that? I've no experience with that PIC model but considering USB is 48 MHz, I would have expected that you would want a 6/12/24 MHz crystal, just to make the PLL a little easier. Maybe it doesn't matter.

author: Psi
author_rank: Super Contributor
timestamp: May 17, 2014, 09:07:36 am
content: The crystal lists 16pf on the mouser page you posted

author: Unknown
author_rank: Unknown
timestamp: May 17, 2014, 01:04:24 pm
content: Quote from: pipe on May 17, 2014, 08:48:39 amYes, the pic has a prescaler before the pll that generate the usb clock.
PIC32 vs Cortex M4/M7 DSP performance - Page 1
Forum section: electronics / beginners

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: May 23, 2019, 06:08:42 pm
content: Are there any benchmarks for DSP performance of the Microchip PIC32 series vs Cortex M4 / M7 series.I found a linkhttp://www.joshianlindsay.com/index.php?id=158however it seems to compare the PIC32MZ @ 200Mhz with the Cortex M4 running at 48Mhz, so I'm not sure how valid that comparison really is?For Cortex M4/M7 I'm mostly leaning towards the STM32F4 /F7.Regards,

author: JPortici
author_rank: Super Contributor
timestamp: May 23, 2019, 08:02:44 pm
content: Yeah... pic32mz is to be compared against cortex M7 (double precision fpu, simd, more complex bus matrix and dma than m4)Another interesting condenter (architecture, bus, dma, peripherals) if you don't need a FPU is the newer dsPIC33C

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: May 23, 2019, 09:10:50 pm
content: Quote from: JPortici on May 23, 2019, 08:02:44 pmWould the DSP instructions be similar on the pic32MZ and the cortex M7?The dsPIC33C looks interesting ... however still 16 bit though.I need to run DSP ops on biopontential data that is streaming in, and most of the biopotential frontends from TI / Analog Devices etc. have 24bit adc's.

author: iMo
author_rank: Super Contributor
timestamp: May 24, 2019, 02:54:02 am
content: The performance comparison is usually done in DMIPS/MHz. The FPU in both supports only a few floating point operations. Afaik in practical real life M4/PIC32MZ M7/PIC32MZEF perf is the same, the MIPS vs ARM architecture choice is more-less matter of taste..

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: May 27, 2019, 07:47:30 am
content: Quote from: JPortici on May 23, 2019, 08:02:44 pmWould it make sense in going for the dsPIC33CK / CH series when the data size you are dealing with is primarily 24bits wide. I mean the dsPIC may have to do 2 fetches to get he data from memory, correct?

author: JPortici
author_rank: Super Contributor
timestamp: May 27, 2019, 12:01:55 pm
content: you did not specify that you had to deal with 24bit sensors, that changes some things.The dsPIC is a 16 bit architecture, which means that yes, load and stores of 32 bit will have to happen in two cycles... but any operation on 32bit will use more instructions.Also, you can't use the DSP because the operands are 16 bit.
pic32... - Page 1
Forum section: electronics / beginners

author: Unknown
author_rank: Unknown
timestamp: February 27, 2010, 09:29:43 am
content: i can't believe that theres almost anything in this forum about "pic32" so i decided to start this topic...first of all i'm gonna ask youtube...( <3 i love the acelerometeeeeers <3 )i hope you enjoy them...regards...

author: Unknown
author_rank: Unknown
timestamp: February 27, 2010, 09:33:05 am
content: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2591&redirects=32bithttp://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2615&dDocName=en532453http://www.mypic32.com/web/guest/home
Picking a GPS module - Page 1
Forum section: electronics / beginners

author: limestone
author_rank: Newbie
timestamp: June 03, 2018, 02:03:33 pm
content: I'm about to start a project for a device that tracks speed and location while cycling and I have started looking at GPS modules online and I see there is a huge price gap with many at $60+ AUD but most of the ones on ebay are about $6. As I don't know much about GPS so it's hard for me to work out what's good and what will be useless. The accuracy needs to be about a street width. What kind of things should I look out for when picking a module and are there any recommended good ones?

author: CJay
author_rank: Super Contributor
timestamp: June 03, 2018, 07:08:42 pm
content: The little U-Blox modules for about £5-6 each are really good but I believe there have been fakes spotted.YMMV, there are lots on eBay and at $6 each it's probably cheap enough to order one and try it, they should all speak NMEA so as long as you only want the standard sentences any coding you do won't be wasted if the module you buy turns out to be a dud.
picking an NTC thermistor for current inrush limiting - Page 1
Forum section: electronics / beginners

author: ledtester
author_rank: Super Contributor
timestamp: June 07, 2019, 06:46:26 pm
content: I have a a PowerOne HD28-4-AG (28V, 4A) open frame linear power supply which has a 13000 uF filtering capacitor, and I'd like to use a NTC thermistor to limit the inrush current.On Digikey the main parameters for NTC thermistors are R@25C, Steady State Current and R@Current.I guess my Steady State Current doesn't need to be more than 2A (I live in the US), but how would you go about choosing the values for R@25C and R@Current?Thanks!

author: Quarlo Klobrigney
author_rank: Super Contributor
timestamp: June 07, 2019, 07:06:02 pm
content: Checkhttps://www.mouser.com/Circuit-Protection/Thermistors/Inrush-Current-Limiters/_/N-axfxj/for your specs. If it's no help, check back.

author: ocset
author_rank: Super Contributor
timestamp: June 07, 2019, 09:44:12 pm
content: just check it doesnt overheat at the "R at current".Ie, that the NTC can handle your steady state current.The great thing about NTCs that can handle the steady state current, is that they wont blow up from almost any amount of inrush....because they will just heat up and then effectively cool themselves down by reducing their resistance....unlike a resistor which may blow.

author: Gyro
author_rank: Super Contributor
timestamp: June 08, 2019, 07:43:34 pm
content: Quote from: treez on June 07, 2019, 09:44:12 pmUnless you power cycle them quickly and they haven't had time to cool down. Then the excessive inrush current into a substantial load can easily kill them.
Picking good overall signal mosfet (arduino) - Page 1
Forum section: electronics / beginners

author: Lassivv
author_rank: Contributor
timestamp: January 11, 2020, 10:36:16 am
content: Hi all!Just think to order couple parts on mouser.com. Started thinking do you have any recommendation good overall mosfet what i can get.Little bit more info:- Many times u i use ULN2003 drive something little loads with arduino. Many times only need 1-3 outs and ULN have too many outputs on that.- Normally i only use something on/off or drive little led array (100mA or something like that). Not big currents i think 200mA rating is enough my use or 500mA.- Need to be logig level can drive directly arduino 5v boards and hopefully can use same mosfet 3.3v boards too.- I think totally max voltage is something 50v etc.- that can be trought hole or smd component. (or maybe have same model both ways)- Big plus if Eagle 9.xx have default library to that mosfet, not need do own libray or download that somewhere.I am very thankfull if some one can give some recommendations mosfet models.edit:How about example this:https://www.mouser.fi/ProductDetail/Diodes-Incorporated/2N7002A-7?qs=sGAEpiMZZMshyDBzk1%2FWi4sELpEYrY7sTB36DmLpMIE%3D

author: Yansi
author_rank: Super Contributor
timestamp: January 11, 2020, 10:59:52 am
content: Yes, 2N7002 is the industry go to for cheap signal SMD NMOS. BSS84 about being the PMOS "complementary" part.And in the THT world, BS170 and BS250 may serve similarly.Also note there are heaps of different flavors of 2N7002, so you do not always get the exact same spec for a part. But in generic switching applications, they well may be interchangeable.Main difference being often the on state resistance. May be anywhere between 2 and 10+ ohms.

author: Lassivv
author_rank: Contributor
timestamp: January 13, 2020, 09:42:28 pm
content: @Yansi thanks for your tip.What you mean "THT". I think have couple of bs170 in my cabinet, think if that 2N7002 is better. But maybe there is not so much different what use simple signal mosfets.Like you tell main difference is only that state resistance and thats not so big thing that tiny amount currents.Normally just looking first RDS(on) parameters mosfet when use them (after voltage and current) of course, but signal (little current) models that not so important thing i think. Of course 2-10ohm rds(on) hears horrible, if compare any fets what i use normally there is only 5-20mOhm rds(on) values. Example IRLB3034 and IRLB8721 i use white often.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 13, 2020, 09:59:06 pm
content: Quote from: Lassivv on January 13, 2020, 09:42:28 pmThrough Hole Technology
Picking RF ceramic capacitors and SMT inductors (experimenters sample kits?) - Page 1
Forum section: electronics / beginners

author: cdev
author_rank: Super Contributor
timestamp: May 15, 2020, 08:37:03 pm
content: I want to pick up two sample kits of L's and C's for critical uses on projects where "whatever is in the parts drawer" (and in many cases of unknown provenance) wont do. Ive asked this question before and been steered to the AVX capacitors and coilcraft little colored dot purplish inductors and indeed, Ive had great luck with those particular inductors. So now I want to buy some of both of them, with my main requirement on the inductors being "high SRF" (its difficult to do this myself) and low loss/high q. (values in the nh range) and I actually don't know how to specify this quality in the ceramic caps, but I know it when I see it, there are dramatic differences between ceramic capacitors. Some will probably be used for DC blocks and others for filters. (values in the pf range) This is for unknown future experimental use perhaps up to several thousand MHz. I like parts that are big enough to be hand solderable, which means the larger smt sizes.. I just want to make a decent choice and have them around and available. Experimenters or engineers kits. Not too expensive. I dont need a huge quantity.I'm open to suggestions of cheaper parts too. (LCSC?) if the quality is good in those particular areas. For a low price, I am very willing to take a risk on them. This is just for fooling around, not any commercial product.Thanks!EDIT: I just realized its possible with (most?) components to use the manufacturers provided information to use EDA tools like Spice to minimize the problems caused by stray inductance and capacitance and interact with the parts choosing process empowered by this data and possibly even be able to simulate the effect of different pasrts once I master the EDA tools.If anybody has any suggestions for a rank beginner they would be welcome.
PICkit 2 "Power Surge On Hub Port - Page 1
Forum section: electronics / beginners

author: Ferroto
author_rank: Frequent Contributor
timestamp: March 05, 2010, 03:44:16 am
content: I hooked up my PICKit 2 up to a circuit (just a MCU) to test out it's logic analyzer functions. When I hooked up VCC and GND I got a message from windows that said "Power Surge On Hub Port" I then double checked my circuit and everything was ok. Hell it was working fine awhile ago when I was programming it with no changes in between. Shouldn't the device have stopped such a surge from reaching the system? I'm abit worried about the fact it didn't.

author: macpod
author_rank: Newbie
timestamp: March 05, 2010, 04:38:07 pm
content: Sounds like you have a short. Try hooking the vcc and gnd wires to a multimeter and check you have some measureable resistance.If that's not it, you should state what is connected to the hub, and if it is powered or not. It could be you are using an unpowered hub and the total combined usb devices is using greater than 500mA

author: Ferroto
author_rank: Frequent Contributor
timestamp: March 05, 2010, 07:06:30 pm
content: Quote from: macpod on March 05, 2010, 04:38:07 pmactually it's connected directly to a usb port. I don't know why it says Hub.

author: joelby
author_rank: Frequent Contributor
timestamp: March 06, 2010, 01:56:49 am
content: If you have multiple USB ports, you may have a hub internally.

author: Emyr
author_rank: Contributor
timestamp: March 08, 2010, 01:23:56 pm
content: There's always one or more root hubs on a motherboard or expansion card.

author: Ferroto
author_rank: Frequent Contributor
timestamp: March 08, 2010, 02:03:05 pm
content: Quote from: Emyr on March 08, 2010, 01:23:56 pmI know but shouldn't the PICkit2 have some kind of protection to stop that. Kinda abit nervous I disassembled the circuit just as a precaution as I couldn't see what was wrong with it.