CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

I couldn't get the E3 pin to work in PIC18f45k40

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sema_tufan



Joined: 03 Mar 2020
Posts: 14
Location: turkey

View user's profile Send private message

I couldn't get the E3 pin to work in PIC18f45k40
PostPosted: Tue May 25, 2021 7:54 am     Reply with quote

Hello,
A few pins of LEDs were connected in my circuit board. Although I just set the E3 pin as output, I could not see the voltage.
Other leds work, only E3 pin does not work.
My code is as follows:
Code:

#include <18F45K40.h>   
#use delay(internal=16000000)


#FUSES PUT                     
#FUSES PROTECT                 
#FUSES NODEBUG                 
#FUSES NOBROWNOUT               
#FUSES NOLVP                   
#FUSES NOCPD                   

#FUSES NOWDT
#FUSES NOMCLR                 





#BYTE       TRISA          = 0xF88
#BYTE       TRISB          = 0xF89
#BYTE       TRISC          = 0xF8A
#BYTE       TRISE          = 0xF8C

#byte       PORTA          = 0xF8D
#byte       PORTB          = 0xF8E
#byte       PORTC          = 0xF8F
#byte       PORTE          = 0xF91



void main()
{
    setup_oscillator(OSC_HFINTRC_16MHZ);
    set_timer0(T1_DISABLED);
    setup_timer_1(T1_DISABLED);
    setup_timer_2(T2_DISABLED, 0, 1);
    setup_ccp1(CCP_OFF);



    TRISA = (0B00000000);
    TRISB = (0B00000000);
    TRISC = (0B00000000);
    TRISE = (0B00000000);

    PORTA = (0B00000000);
    PORTB = (0B00000000);
    PORTC = (0B00000000);
    PORTE = (0B00000000);



    while (true)
    {
        output_high(PIN_A0);
        output_high(PIN_A1);
        output_high(PIN_A2);
        output_high(PIN_B1);
        output_high(PIN_B2);
        output_high(PIN_B3);
        output_high(PIN_B4);
        output_high(PIN_B5);
        output_high(PIN_B6);
        output_high(PIN_B7);
        output_high(PIN_E3);
        delay_ms(1000);
        output_low(PIN_E3);
        output_low(PIN_A0);
        output_low(PIN_A1);
        output_low(PIN_A2);
        output_low(PIN_B1);
        output_low(PIN_B2);
        output_low(PIN_B3);
        output_low(PIN_B4);
        output_low(PIN_B5);
        output_low(PIN_B6);
        output_low(PIN_B7);
        delay_ms(1000);
    }
   
}

http://remoturk.com/e3.jpg
There is a photo of the circuit in the link.
Ttelmah



Joined: 11 Mar 2010
Posts: 19505

View user's profile Send private message

PostPosted: Tue May 25, 2021 8:18 am     Reply with quote

This is a read the data sheet one.
From the device overview:

Quote:

Note 1: RE3 is an input only pin.


Never going to work as an output.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group