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.

Changing time delay in PIC18F252

Status
Not open for further replies.

amitdandyan

Newbie level 6
Joined
May 8, 2009
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,396
delay_us with variable delay+mikroc

I have developed this simple program using mikroC. Can i change the delays given in this program using serial communication of PIC18F252 with PC? (by denoting time with some variables)
Please give essential conditions required for interfacing.

#define switch PORTB.F0
#define Pressed 0
void main()
{
TRISC=0;
TRISB=1;
PORTC=0;
PORTB=0;
for(;;)
{
if (switch == Pressed)
{
PORTC=0X02;
Delay_us(1);
PORTC=0X00;
Delay_us(240);
PORTC=0X04;
Delay_us(1);
PORTC=0X00;
Delay_ms(2000);
}
}
}

If there's any other way, than also please let me know?
Thank You.
 

pic18f252 circuit

declare a variable and use that with Delay like Delay_ms(x);
read a value from UART and assign that to x.. x=getc()... and just use it...

if u need more get the question more specific
 
#define switch port b.f0

Thanx a lot for your reply sir.
In my project I need to change these delays frequently. For that, I have to burn the hex file in the PIC again & again. To solve this problem I want to send these delays through serial communication.
Sir, please give me an example to send these values, like if you can write this program again with the required changes.
Can you please provide me the circuit for serial communication?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top