View previous topic :: View next topic |
Author |
Message |
pasini
Joined: 12 Dec 2005 Posts: 50 Location: Curitiba - Brazil
|
PIN NOT TOGGLING |
Posted: Tue Jul 04, 2006 8:51 am |
|
|
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
|
|
Posted: Tue Jul 04, 2006 9:08 am |
|
|
Why should it toggle?...
You only ever set it high.
Best Wishes |
|
|
pasini
Joined: 12 Dec 2005 Posts: 50 Location: Curitiba - Brazil
|
|
Posted: Tue Jul 04, 2006 8:15 pm |
|
|
I�ll talk to my boss I need 2 weeks at the beach far from my computer.
Thanks anyway !!!!!!!!
Pasini |
|
|
Ttelmah Guest
|
|
Posted: Wed Jul 05, 2006 2:03 am |
|
|
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
|
|
Posted: Wed Jul 05, 2006 6:07 am |
|
|
You have a heat wave
not to many brass monkeys down south in Australia
Andrew _________________ What has been learnt if you make the same mistake? |
|
|
Ttelmah Guest
|
|
Posted: Wed Jul 05, 2006 6:44 am |
|
|
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 |
|
|
|