delay
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Re: delay
Hello,
Our source codes are not open source and they are not available for viewing or editing.
Our libraries come with our compilers in compiled form (source code hidden).
We decided to do this because if we allow our costumers to change source codes we would not be able to provide technical support for it.
You can, however, search throughout Forum where some pieces of our libraries are posted for viewing, so you could maybe find what you are looking for.
Best regards,
Losic Tihomir
Our source codes are not open source and they are not available for viewing or editing.
Our libraries come with our compilers in compiled form (source code hidden).
We decided to do this because if we allow our costumers to change source codes we would not be able to provide technical support for it.
You can, however, search throughout Forum where some pieces of our libraries are posted for viewing, so you could maybe find what you are looking for.
Best regards,
Losic Tihomir
mikroElektronika [Support team]
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Re: delay
thank you
void main() {
TRISA=0;
PORTB=0;
do{
if(PORTB.F2==1){
Delay_ms(1500);
if(PORTB.F2==1){
PORTA.F1=1;
}else {
PORTA.F1=0;
}
}while(1);
}
in the above coding i need to make PORTA.F1=0 if PORB.F2=0 during the delay time
please good enough to help me.
void main() {
TRISA=0;
PORTB=0;
do{
if(PORTB.F2==1){
Delay_ms(1500);
if(PORTB.F2==1){
PORTA.F1=1;
}else {
PORTA.F1=0;
}
}while(1);
}
in the above coding i need to make PORTA.F1=0 if PORB.F2=0 during the delay time
please good enough to help me.
-
- Posts: 1179
- Joined: 24 Nov 2005 20:07
- Location: Colorado, USA
Re: delay
Use one of the many timers on the PIC instead of the compiler to generate the delay. This will allow you to monitor the port pin for change all the while the timer is working in the background. Using the compiler delay is considered a "blocking" function whereby all of the PIC's resources are focused on performing this task and nothing else.
Re: delay
If you need to test changes with PORTB pins then on many chips there is an interrupt that you can use and the interrupt will work regardless of if you are in a delay or not.
Look up the datasheet for your PIC for "Interrupt On Change"
M
Look up the datasheet for your PIC for "Interrupt On Change"
M