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.

pulse generation using MikroC-in different power load

Status
Not open for further replies.

nandini88

Junior Member level 2
Joined
Nov 9, 2011
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,439
anyone here can give some example of code in mikroC to generated pulses in different load?
thank you
 

Depends on what kind of pulse and load you are talking about.

A simple example is this:
Code:
   ADC1_Init();
   ADR = ADC1_Get_Sample(0);
   if ((ADR > 100) & (ADR < 200)){
      RD0_bit = 1;
      delay_ms(20);
      RD0_bit = 0;
   }
   if (ADR > 512){
      RD1_bit = 1;
      delay_ms(20);
      RD1_bit = 0;
   }

It takes a reading from channel 0 and outputs a 20ms pulse on RD0 if the ADC input voltage is between 0.49V and 0.98V. How much current/power this corresponds to will depend on your sensor.
If the input voltage is greater than 2.5V, it outputs a 20ms pulse on RD1.

Hope this helps.
Tahmid.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top