jam1
Posts: 47
Joined: Tue Oct 21, 2014 5:51 pm

How good is piscope?

Sat Oct 25, 2014 1:19 pm

Hi,

I tried and tried to get some good sampling from piscope but I always get some strange plots. No matter how slow or fast I sample the gpios, some steps are always missing in the clock output.
I tried with SSH from linux.
I tried directly on the Pi with a HDMI monitor and a USB keyboard. Even with no connection to the Ethernet port.

What I am trying to do is a direct connection to an ADC0804 converter.

At this time, I am only testing the clock to at least feed a proper signal to the converter. I cannot get to that stage yet. The maximum speed I want is around 100kHz, which is trivial in this case. Even 100Hz don't give a clean signal for the output pin.

This is on a B+ with a 40 pin cable connection around 30 cm long normally. If I remove the cable, I get the same result.
Can I assumed that the signal is good even if piscope does no show it? I don't want to buy a real analyser just for this.

Is there an image of a good signal trace somewhere that I can compare with and try to replicate? I may have a bad Pi :)
Thanks

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: How good is piscope?

Sat Oct 25, 2014 1:31 pm

I would suspect its par for the course running a real time system with very small intervals on a multitasking OS. The OS has stuff to do to maintain itself, and that takes vital clock cycles from the sampling and displaying in the scope software.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How good is piscope?

Sat Oct 25, 2014 1:31 pm

Try generating activity on an unused gpio.

e.g.

pigs p 4 64

should show a 800Hz PWM signal (64/256) on gpio4.

Change the frequency with

pigs pfs 4 8000

it should then be a 8000Hz signal.

Do they look OK?

jam1
Posts: 47
Joined: Tue Oct 21, 2014 5:51 pm

Re: How good is piscope?

Sat Oct 25, 2014 3:36 pm

Thank you very much joan. I have a perfect clock now.
Now, I do I stop a PWM without stopping the deamon?

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How good is piscope?

Sat Oct 25, 2014 3:44 pm

jam1 wrote:Thank you very much joan. I have a perfect clock now.
Now, I do I stop a PWM without stopping the deamon?
pigs p 4 0

or

pigs w 4 0

If you can, use a Linux laptop/desktop to display the data. The Pi itself can collect the data at high data rates and send it over a network, but you are expecting too much if you want to display the traces in "real-time" on a Pi.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: How good is piscope?

Sat Oct 25, 2014 8:36 pm

joan wrote: ...
If you can, use a Linux laptop/desktop to display the data. The Pi itself can collect the data at high data rates and send it over a network, but you are expecting too much if you want to display the traces in "real-time" on a Pi.
I can confirm that this method works very well indeed (Thank you, @joan). No longer having access to any sort of oscilloscope (the downside of now being a retired physicist), I finally got around to trying out piscope etc. and have managed to display and monitor both I2C and SPI data transfers at a 1Mhz sample rate and thus optmise timing delays in my 'C' demo. software for various LCD displays, operating in "write-only" mode, and partially solve an apparent anomaly between 4-bit and 8-bit interfacing mechanisms (largely due to a bug of mine of course, :oops: - although there still remains a puzzle w.r.t. to I2C, which I'm in the process of building a new test circuit for further investigation)
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Kai42
Posts: 1
Joined: Sat Dec 30, 2017 6:49 pm

Re: How good is piscope?

Sat Dec 30, 2017 6:57 pm

Hi!

Not sure, if I'm in the right forum, but I'll give it a shot. If you feel a different place is more suited to answer my questions, please let me know.

I just started playing around with raspberry pi and switching 433MHz-outlets.
I have brennstuhl-outlets and a 433MHz transmitter and I can switch the outlets wit hthe transmiiter thru codesend no problem, BUT I don't understand the output of piscope while sending codes. Let's start simple:
If I'm not mistaken, a simple
./RPI_utils/codesend 0
should use protocol 1 from RCSwitch.cpp, which in return should send a sync of 1 high pulse followed by 31 low pulses and then my 0 which again is coded as 1 high and 3 lows - all with 350us pulselength ( I know that this is bogus for actual switching any outlets but should keep the matter simple)
Going to the very start of the full sequence, here's what I would expect to see in piscope:
350us high + 31*350us=10.85ms low
followed by my actual '0' i.e. 350us high and 3*350=1050us low.

What I do see when clearing the sample buffer and submitting the codesend 0 is a high of about 720us followed by a low of about 1360us followed by another high of 470us followed yet by a low of about 1240us and so on. - thatis not even close to what I expected.
Am I reading the piscope output wrong or are my expactations wrong / did I misinterpreted the 'protocol 1' - entry of RCSwitch.cpp and what it actually does to the GPIO-pin?

Cheers,
Kai

Return to “Troubleshooting”