Jump to content

zhi

EstablishedMember
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About zhi

  • Rank
    Newbrie
  1. Alright, found the problem. It's the target selection from the C2C IDE. It should be p16f84a, but it wasn't.
  2. I always have the WatchDog timer off. Can you try it and see if it works? It's kind of frustrated to see this simple code not working. asm __config _XT_OSC & _WDT_OFF & _PWRTE_OFF //Timing settings #pragma CLOCK_FREQ 4000000 void main(void) { //Hardware Initialization disable_interrupt( GIE ); set_bit( STATUS, RP0 ); set_tris_a( 16 ); set_tris_b( 0 ); clear_bit( STATUS, RP0 ); output_port_a( 0 ); output_port_b( 0 ); while(1) { output_port_b(0xff); delay_s(1); output_port_b(0x00); delay_s(1); } } thanks! Zhi
  3. I always have the WatchDog timer off. Can you try it and see if it works? It's kind of frustrated to see this simple code not working. asm __config _XT_OSC & _WDT_OFF & _PWRTE_OFF //Timing settings #pragma CLOCK_FREQ 4000000 void main(void) { //Hardware Initialization disable_interrupt( GIE ); set_bit( STATUS, RP0 ); set_tris_a( 16 ); set_tris_b( 0 ); clear_bit( STATUS, RP0 ); output_port_a( 0 ); output_port_b( 0 ); while(1) { output_port_b(0xff); delay_s(1); output_port_b(0x00); delay_s(1); } } thanks! Zhi
  4. I did - adding the second delay function call. All LED on PortB pins are lit. No other activity seem going on.
  5. That's what I thought at the beginning. I used a oscillascope to probe it. Don't see any activity on any of the output pins. However, if I commend out the delay_ function and let it run in the while() loop. I see a pulse stream out of the output pins, which what I was expecting. So I conclude it's the delay that some suspend the execution. Is there any register bit I forgot to set in order to use the delay_x function?
  6. This is my first time using delay_x() function, but doesn't seem work right. I don't see any problem with the following code. However, it's not working - the LEDs are not blinking. Without the call to delay_s(), works fine. HELP!! //Timing settings #pragma CLOCK_FREQ 4000000 void main(void) { //Hardware Initialization disable_interrupt( GIE ); set_bit( STATUS, RP0 ); set_tris_a( 2 ); set_tris_b( 0 ); clear_bit( STATUS, RP0 ); output_port_a( 0 ); output_port_b( 0 ); while(1) { output_port_b(0xff); delay_s(1); output_port_b(0x00); } } cheers!! Zhi
×
×
  • Create New...