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

How to Output_high and Output_low on Pin_A1 PIC16F690

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



Joined: 23 Nov 2014
Posts: 27
Location: Vietnam

View user's profile Send private message

How to Output_high and Output_low on Pin_A1 PIC16F690
PostPosted: Mon Jan 19, 2015 11:06 pm     Reply with quote

My code:
Code:

Output_high(Pin_A1);
Delay_ms(500);
Output_Low(Pin_A1);
Delay_ms(500);

But it not work.
Why and how to fix this problem.
Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jan 20, 2015 12:11 am     Reply with quote

You need an #include for the PIC, and #fuses and #use delay()
statements. Try this program:
Code:

#include <16F690.H>
#fuses INTRC_IO, NOWDT, BROWNOUT, PUT
#use delay(clock=4M)
   
//====================================
void main()
{

while(1)
  {
   output_high(PIN_A1);   // Blink LED 
   delay_ms(500);
   output_low(PIN_A1);
   delay_ms(500);
  }

}

However, be aware that Pin A1 is used by your ICD debugger and
programmer. My advice is to blink another pin, such as pin B6.
hoa35ktxd



Joined: 23 Nov 2014
Posts: 27
Location: Vietnam

View user's profile Send private message

PostPosted: Tue Jan 20, 2015 6:48 am     Reply with quote

Thank you.
Your code are not work.
I need only PIN_A1.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jan 20, 2015 12:42 pm     Reply with quote

It works for me. I used a Microchip Low Pin Count board with a 16F690
installed in it:
http://www.microchip.com/_ImagedCopy/DM164130-9.png

I compiled the program that I posted, and programmed it into the 16F690
with a Pickit3 programmer. Then I jumpered from Pin A1 to Pin C0,
because that board only has LEDs on pins C0 to C3.

Pin C0 is in a high-Z state, so it doesn't control anything. Only the signal
from Pin A1 controls the LED. It's blinking. It works.
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