Jump to content

meder

Members
  • Content Count

    2
  • Joined

  • Last visited

    Never

Community Reputation

0 Neutral

About meder

  • Rank
    Newbrie
  1. What is the proper syntax for use of structures. No matter what I try, the compilier chokes. struct{ char led; char led1; }bitdata={1,0}; What ANSI part has been implemented? TIA
  2. Its nice to have a working bug free sample app to get a Dev system up and running. The sample inter.c does not toggle the portb bit correctly. If you run it the bit stays high. But, MPLAB 6.4 happily toggles the bit! Heres the correct coding: //This sample program for the PIC16F84 target shows how //to use interrupts. If there is a LED connected to //B7 it will blink. #include <system.h> char led = 1; void interrupt( void ) { if( led == 1 ) { portb |= 128; led = 0; } else { portb &= ~128; led = 1; } clear_bit( intcon, T0IF ); //clear TMR0 overflow flag } main() { option_reg = 7; //set prescaler to 1:256 trisb = 0; portb = 0; enable_interrupt( GIE ); enable_interrupt( T0IE ); //enable TMR0 overflow bit while( 1 ); //endless loop } /* EOF *****************/
×
×
  • Create New...