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

PIN NOT TOGGLING

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



Joined: 12 Dec 2005
Posts: 50
Location: Curitiba - Brazil

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

PIN NOT TOGGLING
PostPosted: Tue Jul 04, 2006 8:51 am     Reply with quote

MPLB 7.10 CCS 3.324

Hi I have the following code but pin D5 is not toggling. I don�t know why.
Can anyone help me ?
Thanks
Pasini

Code:

#define __USB_PIC_PERIF__ 1

#include <18F4550.h>
#device *=16
#device ADC=10
//configure a 16MHz crystal to operate at 48MHz
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,CPUDIV1,VREGEN,PLL4
#use delay(clock=48000000)
#case

#define USB_CON_SENSE_PIN PIN_C6

#include <defines.h>

#byte PORTE = 0x0F84

int8 data;
void main(void)
{   
   set_tris_a(0b00100001);      // bits 6 e 7 ?
   set_tris_b(0b11010001);
   set_tris_c(0b01111100);
   set_tris_d(0b01011000);
   set_tris_e(0b00000111);

   setup_psp(PSP_DISABLED);
   setup_ccp1(CCP_OFF);

   setup_adc_ports(NO_ANALOGS);
   enable_interrupts(GLOBAL);

   while(1)
   {   output_high(PIN_D5);
      output_high(PIN_B3);
      delay_ms(1000);
      output_low(PIN_D7);
      output_low(PIN_B3);
      delay_ms(1000);
   }
}
Ttelmah
Guest







PostPosted: Tue Jul 04, 2006 9:08 am     Reply with quote

Why should it toggle?...
You only ever set it high.

Best Wishes
pasini



Joined: 12 Dec 2005
Posts: 50
Location: Curitiba - Brazil

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

PostPosted: Tue Jul 04, 2006 8:15 pm     Reply with quote

I�ll talk to my boss I need 2 weeks at the beach far from my computer.
Thanks anyway !!!!!!!!
Pasini
Ttelmah
Guest







PostPosted: Wed Jul 05, 2006 2:03 am     Reply with quote

I know the feeling all too well...
Especially in the UK at the moment, with a 'heatwave'.

Best Wishes
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

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

PostPosted: Wed Jul 05, 2006 6:07 am     Reply with quote

You have a heat wave Shocked
not to many brass monkeys down south in Australia Sad

Andrew Wink
_________________
What has been learnt if you make the same mistake? Wink
Ttelmah
Guest







PostPosted: Wed Jul 05, 2006 6:44 am     Reply with quote

Yes. Amazing I know, but had two new 'record high' temperatures in June, and another already in July. 33C here at the moment (91F), not quite so hot as yesterday, and thunderstorms nearby. As always, seems hotter, because our architecture in particular is not designed to 'help' in hot weather. Definately the sort of temperatures that make 'not thinking about computers', seem a very nice idea...
:-)

Best Wishes
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