Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] code on ccs c compiler for pic 16f72

Status
Not open for further replies.

ryad_shabbir

Newbie level 4
Joined
Dec 8, 2010
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,316
hi
i want to know how can i take the input analog/digital signal and out put analog/ digital signal, code on ccs c compiler for pic 16f72.

please send the example coding.
 

Lot of examples are given in the example folder of CCS, See those examples they will be very useful for you as a beginner.

Best Regards
 
  • Like
Reactions: hot

    hot

    Points: 2
    Helpful Answer Positive Rating
Dear cool man,

thanks for your nice reply, but i did not found any example with pic 16f72. can u please write an example code here of 16f72.
If u write a example program for input and out put it will be great help for me.

thanks
Ryad
 

This program uses pin C0 as an output and toggle the pin after every 1 sec.
Connect an led on that pin with 1k resistor and ground that resistor
see your led will blink.
Code:
#include <16F72.h>
#device adc=8

#FUSES HS,NOWDT,PUT,NOPROTECT,NOBROWNOUT
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

void main()
{

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);

   // TODO: USER CODE!!
 while(1)
 {
  output_toggle(PIN_C0);
  delay_ms(1000);
 }
}

Best Regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top