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 support@ccsinfo.com

Problem with making pin_a5 of pic18f46k22 high

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



Joined: 15 Nov 2018
Posts: 42
Location: Çanakkale

View user's profile Send private message Send e-mail

Problem with making pin_a5 of pic18f46k22 high
PostPosted: Sun Mar 03, 2019 7:39 am     Reply with quote

Hello everyone

İ am having a problem with turning high pin_a5 of pic18f46k22.
İ made all configurations about Tris, ansel registers.
When i operate code output_high(pin_a5); i see 0.6 V on physical pin .When i operate output_low(pin_a5) i see 0V or vice versa .İ think there is a problem of SS1 which slave select for spi communication.But i dont use spi communication.İ use i2c communication with ds3231 with i2c module 1 . İ mean there are two i2c module in pic18f46k22.Can anybody help me?
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Mar 03, 2019 8:46 am     Reply with quote

Generally speaking you need to disable the comaparator and analog peripherals that are attached to I/O pins when using simple in/out.
Depending on the PIC, the ADC section is the default NOT standardor basic I/O.
Also, check the board, perhaps there's a short or solder whisker betweeen that pin and the one next to it.
Ömer Faruk



Joined: 15 Nov 2018
Posts: 42
Location: Çanakkale

View user's profile Send private message Send e-mail

PostPosted: Sun Mar 03, 2019 9:06 am     Reply with quote

temtronic wrote:
Generally speaking you need to disable the comaparator and analog peripherals that are attached to I/O pins when using simple in/out.
Depending on the PIC, the ADC section is the default NOT standardor basic I/O.
Also, check the board, perhaps there's a short or solder whisker betweeen that pin and the one next to it.


Thank you for your reply i checked the pins for short circuit. pin_A5 and pin_E0 is short circuit. İ fixed it and problem solved. Thank you very much
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Mar 03, 2019 9:11 am     Reply with quote

GREAT !!
Code:
//flash A5
#include <18f46k22.h>      //processor
#include "46k22_fuses.h"   //my fuses
#use delay(clock=16000000)   //16MHz clock ( 8MHz worked as well)

#define led pin_a5         //pin with LED

main() {

while(TRUE) {
   delay_ms(100);         //delay for 1/2 second
   output_toggle(led);      //flip pin
   }                  //end of while
}                     //end of main

above code I just tested and it works...
Jay
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