Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PORTE problem 16F877A

Rajeshtr

Newbie level 6
Joined
Jan 1, 2023
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
106
how to configure PORTE of 16F877A PIC controller..PORTE.RE2 shows toggling issue when RE1 signal occurs in mikro c
 
Is that the code that actually shows the problem?
Looking at that, there are only 2 places where RE1 changes (via the 'BUZZER_PIN' name) - at least that are not commented out - and they would seem to be far enough away from the references to RE2 to probably not be RWM related.
What I don't see if any reference to ADCON1 to set the PORTE pins to 'digital' mode. That should not be an issue when you set the RE1 and RE2 to output, but it will interfere with RE0 which you set as an input although I can't see any other reference to that pin. Still, it is worth a try to set the pins to digital mode.
Susan
 
Is that the code that actually shows the problem?
Looking at that, there are only 2 places where RE1 changes (via the 'BUZZER_PIN' name) - at least that are not commented out - and they would seem to be far enough away from the references to RE2 to probably not be RWM related.
What I don't see if any reference to ADCON1 to set the PORTE pins to 'digital' mode. That should not be an issue when you set the RE1 and RE2 to output, but it will interfere with RE0 which you set as an input although I can't see any other reference to that pin. Still, it is worth a try to set the pins to digital mode.
Susan
Yes ma'am..if the BUZZER _PIN is commented there is no issues for the PIN RE2
 
Is it expecting too much if we want to see exactly the code that causes the reported problems?
--- Updated ---

Sorry, I misread the code. I presume it's the recent version.
What are you specifically observing? LED should be on but is toggling to off? LED should be off but is toggling to on? Both cases? Is the LED output driving active high or low? What's the series resistor value?
--- Updated ---

Does the problem occur if no buzzer is connected?
 
Last edited:
Is it expecting too much if we want to see exactly the code that causes the reported problems?
--- Updated ---

Sorry, I misread the code. I presume it's the recent version.
What are you specifically observing? LED should be on but is toggling to off? LED should be off but is toggling to on? Both cases? Is the LED output driving active high or low? What's the series resistor value?
--- Updated ---

Does the problem occur if no buzzer is connected?
After commenting the BUZZER _PIN HIGH the led becomes stable.. otherwise toggling
 

Attachments

  • IMG20231123101233.jpg
    IMG20231123101233.jpg
    3.1 MB · Views: 63
Hi,

so you don´t give us the complete source code.

Instead you give a 3100000 bytes photo instead of copy and paste 500 bytes of text ... (factor of 6000)
... still not complete

Klaus
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top