i wrote a program in mikroBasic and tried simulating it on oshon simulator. However only the leds are lighting but they are not flashing. Can u please help??
eloop:
PORTB = $FF 'lighting all leds in port B
Delay_ms(1000) 'putting a delay of 1 sec
PORTB = $00 'switching off all leds
Delay_ms(1000) 'putting a delay of 1 sec
goto eloop 'looping endlessly
end.
the above code was written in mikroBasic. However upon simulating with oshon software desired results are being obtained. The leds are not flashing on and off. With mikroC there are inbuilt delays,suppose delay of a sec(delay_1sec). This helps to simulate the program as desired. How can this problem be solved with mikroBasic? Are there in built delays in mikroBasic like in mikroC to overcome the above mentioned problem??? I am also including the mikroC program i have written for the same result. Thanks for replying.
void main() {
TRISB=0xFF; 'setting port b as output port
while (1) {
PORTB=0xFF; 'lighting all leds in port b
Delay_1sec; 'using in built delay of 1 sec instead of user defined delay
PORTB=0x00; 'switching off all leds in port b
Delay_1sec; 'using in built delay of 1 sec instead of user defined delay
}
}
did you set the 'rate' to ultimate ? (in oshonsoft simulator)
In oshonsoft, even if you set simulation speed to ultimate, then also, it will take 'about' 10 minutes to simulate a 1 second delay...
So better try to give delays like 1ms or such small delays and observe it.....
I downloaded the real pic simulator but i cant make it work. I looked on youtube but there real pic project file is being opened. How to create a real pic project file?? I have worked only with hex files so far.
I tried the real pic simulator yesterday, but don't know why, LCD is now working....but is is working in hardware and oshonsoft..... any idea?@cubanflyer
I configured the LCD pins correctly......