Jump to content

tejaswiyvs

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About tejaswiyvs

  • Rank
    Newbrie
  1. Thanks for the help . Did some searching and found a similar topic on the forums. Thanks anyway!
  2. #include "PIC16F887.h" #define XTAL_FREQ 4000000 // config clock to 4mhz. // Set configuration fuse. #pragma DATA _CONFIG, _XT_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF void setupADC(void); void setup(void); void setupSPI(void); char getADC(void); void main() { setup(); } void setup() { setupADC(); setupSPI(); return; } void setupSPI() { // Stub return; } void setupADC() { ADCON1 = 0x80; // setting ADC result as right justify, along with Vdd, Vss as reference voltages. TRISA = 0x01; // Setting RA0 as an input. (ADC Channel 1?) ANSEL = 0x01; // ADC can be used to conver
×
×
  • Create New...