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

PIC16F917 Port D2 problem

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



Joined: 05 Oct 2009
Posts: 9

View user's profile Send private message

PIC16F917 Port D2 problem
PostPosted: Mon Oct 05, 2009 6:06 pm     Reply with quote

I am using the PIC16F917 device with the following code:
Code:

// Include files
#include "16F917.h"
#device adc=10
#define CCP_OFF

// PIC Configuration
#use delay ( clock = 8MHZ, type = internal )
#fuses HS         // Crystal Osc (> 4 MHz)
#fuses NOWDT       // No watch Dog Timer
#fuses NOPROTECT   // Code not protected from reading
#fuses NOPUT      // No Power Up Timer
#fuses NOBROWNOUT   // No Brownout Reset
#fuses NOIESO      // Internal External Switch Over mode disabled
#fuses FCMEN      // Fail-safe clock monitor enabled,
#fuses NOMCLR      // Master Clear pin used for I/O


void main ()
{
   // CCA Initialization
   Disable_Interrupts(INT_CCP2);
      output_high(PIN_D3);
      output_high(PIN_D2);
}

The problem is that I can enable an LED out of Port D3 but not D2 and I am using the same circuitry. I read that Port D2 is related to the CCP2 function of the PIC but have hit a wall and cant get it to work.

Any ideas on my problem?

Thanks-N-Advance
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 05, 2009 10:58 pm     Reply with quote

Post your compiler version.
freddayz



Joined: 05 Oct 2009
Posts: 9

View user's profile Send private message

PostPosted: Tue Oct 06, 2009 9:19 am     Reply with quote

Compiler Version:

4.071
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 06, 2009 1:05 pm     Reply with quote

I installed vs. 4.071 and ran the following test program in hardware
on a 16F917 on a PicDem2-Plus board. It works. Both pins D2 and D3
are toggling, every 500 ms, as seen on an oscilloscope.
Code:

#include <16F917.H>
#fuses INTRC_IO, NOWDT, NOPROTECT, BROWNOUT, PUT
#use delay(clock=8000000)

//======================================
void main()
{

while(1)
  {
   output_high(PIN_D2);
   output_high(PIN_D3);
   delay_ms(500);

   output_low(PIN_D2);
   output_low(PIN_D3);
   delay_ms(500);
  }

}
freddayz



Joined: 05 Oct 2009
Posts: 9

View user's profile Send private message

PostPosted: Wed Oct 07, 2009 9:34 am     Reply with quote

It appears it may be a HW problem within the PIC...will swap and see results.
Thanks for the help.
freddayz



Joined: 05 Oct 2009
Posts: 9

View user's profile Send private message

PostPosted: Thu Oct 15, 2009 4:33 pm     Reply with quote

It was the HW...thanks
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