Seemingly unstable basic PIC18F2550 circuit

  • Thread starter zxcvb
  • Start date
  • Tags
    Circuit
In summary, the conversation discusses a person's experience with hardware development and their recent experimentation with ground up MCU circuit design. They share a circuit they created to play around with MCU registers, but mention that it only works intermittently. They question if it could be due to not grounding a certain pin or if there could be an issue with the Vusb not being grounded. They also mention trying to step through the code with a debugger. The conversation concludes with the person discussing their current work with an 18F2520 and their preference for not leaving pins floating and configuring settings. They also bring up the possibility of powering the circuit through the USB port on the PC/programmer as a potential issue.
  • #1
zxcvb
10
1
From my work I've had quite a bit of experience with hardware development, but purely from a supervisory role, and so recently I've been playing around with ground up MCU circuit design to try to get a better understanding.

I put the following circuit together to allow me to play around with the MCU registers a bit and it does work - only intermittently.

The LED blinks as intended, then stops for an arbitrary time, flashes again a different number of times, off again etc. There doesn't seem to be any cyclic behaviour to it. It starts working without any external input (i.e. nudging it) so doesn't seem like a loose connection either. I realize the second Vss pin isn't grounded in the schematic, but this didn't help the circuit either when I tried it. Could it be because Vusb isn't grounded? I would have thought this would only affect USB operation.

proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2FfF8BQ.png

Code:
Code:
#include <stdio.h>
#include <stdlib.h>

#include <p18f2550.h>
#include <delays.h>

#pragma config FOSC = INTOSCIO_EC    

#pragma config WDT = OFF            

void main() {

   TRISAbits.TRISA1    = 0;    // Set RA1 as output
   LATAbits.LATA1      = 1;    // Set RA1 as HIGH

   while (1)
   {
       LATAbits.LATA1 = ~LATAbits.LATA1;   // Toggle LED pin
       Delay10KTCYx(25);                   // Delay
   }
}
Datasheet of the PIC18F2550: http://www.kynix.com/uploadfil...668338.pdf
 
Engineering news on Phys.org
  • #2
Ceci n'est pas une pipe

Your schematic is not your circuit.

Why wouldn't you ground pin 8 (VSS)?

[edit]: Oh I see you tried that. Did you really ground that?
[edit]: VUSB should not be grounded, it is an output.
[edit]: Have you tried stepping through the code with a debugger?
 
Last edited:
  • #3
As I write this I am working with an 18F2520. I don't like to leave pins floating. Also, there are a lot of settings that I don't see in your code that I prefer to define. In other words, if it can be configured, set it to what it should be. Are you powering this through the USB port on the PC/programmer? That could be a problem.
 

Related to Seemingly unstable basic PIC18F2550 circuit

1. Why is my PIC18F2550 circuit behaving erratically?

There could be several reasons for this, such as a faulty circuit design, inadequate power supply, or improper programming. It is important to carefully check all components and connections and ensure that the code is correctly written.

2. Is the PIC18F2550 microcontroller inherently unstable?

No, the PIC18F2550 is a reliable and widely used microcontroller. Any instability in the circuit is most likely due to external factors such as faulty components or incorrect programming.

3. How can I troubleshoot my unstable PIC18F2550 circuit?

Start by checking all connections and components, making sure they are properly connected and functioning. You can also use a debugger or logic analyzer to help identify any issues with the code. Additionally, checking the power supply and adjusting it if needed can also help stabilize the circuit.

4. Can the environment or external factors affect the stability of a PIC18F2550 circuit?

Yes, factors such as temperature, humidity, and electromagnetic interference can affect the performance of a circuit. It is important to ensure that the circuit is designed and shielded properly to minimize the impact of these external factors.

5. Are there any common mistakes that can cause instability in a PIC18F2550 circuit?

Yes, some common mistakes include incorrect connection of components, using incorrect values for resistors or capacitors, and incorrect programming. It is important to double-check all components and connections and follow proper programming techniques to avoid instability in the circuit.

Similar threads

Replies
2
Views
2K
  • Electrical Engineering
Replies
1
Views
2K
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
6K
Back
Top