Author Topic: [Solved] Oscilliscope, how to measure the time of a pulse from a pic 16f88.  (Read 1460 times)

0 Members and 1 Guest are viewing this topic.

Offline TezaTopic starter

  • Contributor
  • Posts: 44
  • Country: no
I have set up a pic 16F88 on a breadboard, and have programmed it to flash a led for 500ms every second.

To find out if I have done this correctly, I would like to measure this on my agilent DSOX2024A (MSO enabled) oscilloscope.
I have never learned how to use this oscilloscope, but have played with it today and got the following screenshot:



Anyone that can point me in the correct direction to solve this?
« Last Edit: October 08, 2017, 07:57:46 pm by Teza »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Oscilliscope, how to measure the time of a pulse from a pic 16f88.
« Reply #1 on: October 08, 2017, 05:55:39 pm »
Well, it says on the right DX = +20 ms.

But assuming you want it to toggle every 500 ms, you can just judge it using your eyes. Does it blink at this rate?
Alex
 
The following users thanked this post: Teza

Offline TezaTopic starter

  • Contributor
  • Posts: 44
  • Country: no
Re: Oscilliscope, how to measure the time of a pulse from a pic 16f88.
« Reply #2 on: October 08, 2017, 06:57:15 pm »
Not so important how fast it is blinking, it is for learning purpose only.
The visual blinking looks correct, ~1/2 second on and ~1/2 second off, but I am trying to learn how to measure it.

I don't understand the values I got on my oscilloscope, and I believe I am not using it correct.
(The pic uses the internal oscillator at 4MHz, if I have understood it correctly this give an instruction cycle of 1 MHz, if this info is needed)

Short story: I try to find out the correct way to connect the scope and get the correct measurements.

« Last Edit: October 08, 2017, 07:01:41 pm by Teza »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Oscilliscope, how to measure the time of a pulse from a pic 16f88.
« Reply #3 on: October 08, 2017, 07:01:15 pm »
Not so important how fast it is blinking, it is for learning purpose only.
It is actually very important. Now we know that whatever is shows on the scope clearly way off from what you see in a real world.

Given 50 Hz signal, I assume you are observing the mains interference somehow.

Well, actually your trace is marked D0, which is a digital channel. So you do observe 50 Hz interference on a digital channel.

Press a button that corresponds to the channel you have your devices connected to. Or just press Auto button to get to some sort of a known state.
Alex
 
The following users thanked this post: Teza

Offline TezaTopic starter

  • Contributor
  • Posts: 44
  • Country: no
Re: Oscilliscope, how to measure the time of a pulse from a pic 16f88.
« Reply #4 on: October 08, 2017, 07:34:01 pm »
I tried again, using scope channel 1 instead, and got something that looked more correctly.


The power supply say 4,96V, and I have read that the internal oscillator if the pic is not the most accurate.
So 1 cycle is 1,23 S and the led will light for ~610 ms.

Thanks!

But should I not get this result when using the  D0 channel?

EDIT:

Got it!



So to use the D0 to D7 channels, one of the channel 1-4 must be connectet to the circuit so the scope get enough information?
« Last Edit: October 08, 2017, 07:48:01 pm by Teza »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
So to use the D0 to D7 channels, one of the channel 1-4 must be connectet to the circuit so the scope get enough information?
No, digital and analog channels are completely independent.

If your digital inputs are not connected to anything, then you are just observing interference. They must be high impedance input, so if you don't feed anything into them, they will act as tiny antennas.
Alex
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Page 182 of the manual shows the automated measurements you can make w/o cursor
use.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: Teza

Offline TezaTopic starter

  • Contributor
  • Posts: 44
  • Country: no
Thanks, did not even think looking for a manual (male syndrome?).
Have just start to use the built in learning module.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf