Page 1 of 1

10mS delay using Delay´s!

Posted: Fri Apr 20, 2012 11:13 am
by jgu1
Hi!

Need a litlle help from my friend´s! :D

I have made this simple program. When I use a 10mS delay I measure 5mS on my scope. It look´s like, that in the real world the delay is only the half of FC. The same is if I set the delay (as in the att. program) 2mS I get 1mS.

I have tested the same program in a 12f675 and in a 16f88 with Xtal, but same result.

Am I misunderstood something :?:

Best regard

Jorgen

Re: 10mS delay using Delay´s!

Posted: Fri Apr 20, 2012 5:27 pm
by Spanish_dude
Hi,

What's your oscillator frequency ?
Have you set your oscillator frequency in the project options correctly ?

Nicolas

Re: 10mS delay using Delay´s!

Posted: Fri Apr 20, 2012 6:48 pm
by jgu1
Hi Nicolas! :D

I use the internal oscillator and set the frq on 4Mhz. you can see it in the configuration for the chip in the att file.

Even if I try on a pic16f88 and use external osc. Xtal 19066Mhz I get the same result

Hope you can see something.

Thank´s in advance

Jorgen

Re: 10mS delay using Delay´s!

Posted: Fri Apr 20, 2012 8:17 pm
by JohnCrow
Hi Just tried your attached program on a pic 16F88 with the standard 19.6608MHz crystal

This is the timing I get on the EB070 Test pod
pod 2ms.jpg
pod 2ms.jpg (153.13 KiB) Viewed 7449 times
This is the FC5 I used
2ms test.fcf
(6.5 KiB) Downloaded 260 times
As you can see from the timing on the pulse it is actually 2 ms ± acceptable error

Re: 10mS delay using Delay´s!

Posted: Fri Apr 20, 2012 8:35 pm
by jgu1
Hi John! :)

Thank´s for your care. Strange?????

I have even also tested with 16f88 and xtal 19066mhz.

Ok first I tried with 10mS thats why the name is 10mS delay during test I change the delay. I can see by you it´s very fine. But by me it´s only the half time of the value.

By me: if I set the delay on 2mS I see 1mS on the scoope and 20mS > 10mS onthe scoope. Do you have any idea what i am doing wrong?

Tomorrow I will test your att. program with same Pic and osc. again, and you will get a reply.

Best regard

Jorgen

Re: 10mS delay using Delay´s! SOLVED!

Posted: Sat Apr 21, 2012 1:05 pm
by jgu1
Hi all!

The error is found, I am sorry many times.

It was my old Philips scoop that had the error, it shoows exactly the half of the time :?: . I tested with a another and newer scoop and of course fit the timing, 2mS from FC (pic) is now also 2mS on my scoop.

I regret and apologize for any inconvenience for anyone who has spent time on it. But now I'm happy again :D . Cuold not beleive it was FC.

Thanks to all and especially to you John.

Have a nice week-end

Jorgen

Re: 10mS delay using Delay´s!

Posted: Sat Apr 21, 2012 4:15 pm
by JohnCrow
Hi Jorgen

Thats ok these things do happen

Re: 10mS delay using Delay´s!

Posted: Sun Apr 22, 2012 10:42 am
by medelec35
Hi John,

that EB070 Test pod looks a great piece of kit!

Wish I had got one now, as my scope does not feel too well on one channel :cry:

Does it display a baud rate of 232 signals as well?

It's not a big deal if does not since it measures pulse duration, so baud can be calculated from that.

Re: 10mS delay using Delay´s!

Posted: Sun Apr 22, 2012 11:30 am
by JohnCrow
Hi Martin

The EB070 connects to the EB006 programmer, so you would be able to see the data going to the RS232 board. Im not sure about connecting it to the output of as RS232 signal as it can go negative, and above 5V, which could damage the unit.
But it is a nice piece of kit.

I'm thinking of getting a 50 MHz Rigol oscilloscope in the near future as these are quite reasonably priced. (I dont personally like the USB type that plug into the PC, though they are nice and compact).

Re: 10mS delay using Delay´s!

Posted: Sun Apr 22, 2012 4:32 pm
by medelec35
JohnCrow wrote: The EB070 connects to the EB006 programmer, so you would be able to see the data going to the RS232 board. Im not sure about connecting it to the output of as RS232 signal as it can go negative, and above 5V, which could damage the unit.
Yes it the 5V TTL voltage levels I was thinking of thats between o/p of micorcontroller and i/p to UART to USB converter. If connected to actual RS232, then would need diodes to prevent negative going signals.
But that's still a good point you made.
JohnCrow wrote: I'm thinking of getting a 50 MHz Rigol oscilloscope in the near future as these are quite reasonably priced. (I dont personally like the USB type that plug into the PC, though they are nice and compact).
Not bad at all for £280

Re: 10mS delay using Delay´s!

Posted: Sun Apr 22, 2012 6:46 pm
by JohnCrow
Hi Martin

This is the output of the programmer (in a loop) sending "Hello" @1200 baud 8 data bits.
Hello-2.jpg
(191.64 KiB) Downloaded 1569 times

What Ive found is you can save the sampled waveform, and load it into the signal generator software and send it back to the PIC
Ive just recorded the output form a RC5 remote control to the eblock plugged in the output of the pod.
Played it back via the POD and and got the same display on the LCD as if Id pointed the remote at the system.

Re: 10mS delay using Delay´s!

Posted: Sun Apr 22, 2012 6:58 pm
by medelec35
Hi John,
to determine the baud rate I just send the letter U
Must be upper case.
You can send data after the U.
Then the baud rate is the time duration of the 1/1st negative going pulse time duration.

But I do like the way the time duration is constantly shown at the top.

With my scope, I set it up show it's in single shot mode.

What your doing RC5 sounds interesting.

Re: 10mS delay using Delay´s!

Posted: Sun Apr 22, 2012 7:19 pm
by JohnCrow
Just tried that
Works all the way up to 38400 baud :)
The more I play with this the more I like it