Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 27 20:40
    CloudyPadmal synchronize #137
  • Sep 27 20:30
    CloudyPadmal synchronize #137
  • Sep 27 16:58
    CloudyPadmal synchronize #137
  • Sep 26 09:53
    CloudyPadmal edited #105
  • Sep 26 08:45
    CloudyPadmal synchronize #137
  • Sep 26 08:43
    CloudyPadmal synchronize #137
  • Sep 25 21:14
    CloudyPadmal synchronize #137
  • Sep 25 21:03
    CloudyPadmal synchronize #137
  • Sep 25 20:16
    CloudyPadmal review_request_removed #137
  • Sep 25 20:16
    CloudyPadmal synchronize #137
  • Sep 25 19:22
    CloudyPadmal edited #105
  • Sep 25 19:20
    CloudyPadmal synchronize #137
  • Sep 25 19:13
    CloudyPadmal synchronize #137
  • Sep 25 19:07
    CloudyPadmal synchronize #137
  • Sep 25 17:28
    CloudyPadmal synchronize #137
  • Sep 25 16:41
    CloudyPadmal converted_to_draft #137
  • Sep 25 12:25
    CloudyPadmal edited #105
  • Sep 25 12:24
    CloudyPadmal review_requested #137
  • Sep 25 12:24
    CloudyPadmal labeled #137
  • Sep 25 12:24
    CloudyPadmal assigned #137
ANSEL should be 1 for analog inputs.
Alexander Bessman
@bessman
Yep, that was it.
nielek2
@nielek2
@bessman As mentioned before, I would like to add an OSC (open sound control) bridge to https://github.com/fossasia/pslab-python/blob/development/pslab/cli.py to be able to call it directly from the cli. I assume using it in connection with collect would be the proper way to actually have data to forward. Connecting to external sensors is not possible through the cli currently I believe, correct?
8 replies
Alexander Bessman
@bessman
I just realized I missed the meeting yesterday. Sorry about that, it completely slipped my mind. I'll add a reminder in my calendar.
Alexander Bessman
@bessman
I had a think regarding front end sensor integration: fossasia/pslab-python#200
1 reply
Feedback welcome.
RafaelLeeImg
@RafaelLeeImg
I had fixed the PSLab v5 I got, the problem is D+ is short to GND in micro-USB plug.
Mario Behling
@mariobehling
:thumbsup:
As we are getting closer to the next version, we should think about hardware testing. What are your ideas? Here is an interesting article of another project https://blog.flipperzero.one/electronics-testing/
NAVEEN S R
@nkpro2000sr

I had a think regarding front end sensor integration: fossasia/pslab-python#200
Feedback welcome.

I have a thought of including Adafruit's drivers which uses CircuitPython-busio, since pslab-python has busio (I2C) now. Which I planned to discuss in meeting. Unfortunately i am unable to attend.

Kartikay Sharma
@kartikaysharma01
Is there a reason why we are sampling just 1000samples from the front end in the case of oscilloscope?
21 replies
Alexander Bessman
@bessman
Good question. I'm not aware of the reason.
Mario Behling
@mariobehling
How can the Android and desktop app communicate with the device with a Bluetooth? What needs to be implemented?
For Wifi, do we want the PSLab to open a hotspot or should we look at Wi-Fi Direct?
3 replies
Alexander Bessman
@bessman
@nielek2 I've merged Frederic and Jackson's work on the TCD1304 and fixed the issues. In theory it should work now.
3 replies
Usage is a bit simpler now as well:
spectro = TCD1304()
data = spectro.read_signal()
Mario Behling
@mariobehling
:thumbsup:
Kartikay Sharma
@kartikaysharma01
Do we have any instrument preference to implement after oscilloscope ?
Alexander Bessman
@bessman
I suggest logic analyzer next.
Mario Behling
@mariobehling
:thumbsup:
CyReVolt
@CyReVolt:matrix.org
[m]
At least that is how I understood it.
This https://github.com/kehribar/nrf24L01_plus may be a suitable reference for some things.
Kartikay Sharma
@kartikaysharma01
fossasia/libsigrok#8 is ready for review and testing.
nielek2
@nielek2
thank you @bessman! i'll try tonight...
Kartikay Sharma
@kartikaysharma01
What are the possible use cases of PWM generator other than being used for logic analyzer
Alexander Bessman
@bessman
PWM is used for any number of things: https://en.wikipedia.org/wiki/Pulse-width_modulation
Kartikay Sharma
@kartikaysharma01
Can someone please elaborate the functioning of set_state in the PWM generator. Thanks.
Alexander Bessman
@bessman
set_state simply sets the SQ-pins either high or low.
If you're asking about this specific usage of set_state, PWMGenerator uses the firmware function sqr4. This function outputs a PWM signal on every SQ-pin, including pins which should be constant high or constant low. It is therefore necessary to reset pins which should not have PWM signals on them after calling the firmware function.
This is a workaround for some firmware bugs/limitations. In the next firmware version these should be resolved, but for now this is necessary.
nielek2
@nielek2
Figure_1.png
(images don't seem to work in threads, so this TCD1304 in a dark box)
Figure_2.png
Kartikay Sharma
@kartikaysharma01
In pslab-python, if I do wavegen.generate("SI1",2500) and then connect SI1 to CH2, on sampling using oscilloscope.capture(2,100,1) the noise values on CH1 change too. Is this the expected behavior? @bessman Can you reproduce this too?
Alexander Bessman
@bessman
Yes, there is some crosstalk between the channels.
nielek2
@nielek2
tcd1304-timing-es.png
so i ICG needs to be low before the sampling and goes low again at the end of the samling process, correct?
Alexander Bessman
@bessman
That's my understanding, yes.
NAVEEN S R
@nkpro2000sr

Regarding tests/test_spi.py:

For testing SPI transfer, I planned to connect MISO and MOSI (SDO -> SDI). Simple but, has some cons: can't test write and read independently, and can't test SMP bit of SPI config (main problem).

Then second plan, use logic analyser for MOSI and PWM generator for MISO. By this we can test write and read separately and can test SMP bit of SPI config. But testing SMP bit need precision PWM wave generation.

Like:

testSMPbit.png
My question: is it possible to generate PWM wave at perfect timing so that, SPI read with SMP==0 will return 0 and with SMP==1 will return 0xFF ?
Alexander Bessman
@bessman
How precise is "perfect"? Are the frequency and duty cycle constant?
The PSLab's PWG generator has a precision of around 100 ns.
NAVEEN S R
@nkpro2000sr

For testing, we need a PWM wave with the same frequency as SPI and 50% phase shifted from SPI. So that if we read, we get 0 (when SMP=0; Input data is sampled at the middle of data output time) and 0xFF (when SMP=1; Input data is sampled at the end of data output time).

Like:

SCK:   ___|```|___|```|___|``
PWM:   `|___|```|___|```|___|
SMP=0: ___|_______|_______|__  (Input Sample)
SMP=1: _______|_______|______  (Input Sample)
Alexander Bessman
@bessman
The PWM frequency goes up to about 1 MHz, maybe a little bit higher but then the timing starts to be not so great. The frequency of the SPI bus can be lower than that, I believe. Is it sufficient to test up to that frequency?
The phase shift may be tricky. We need to check if there is a constant phase shift between the SPI bus and a PWM signal with the same frequency. If there is, it should be easy to adjust the PWM signal's phase to get the desired behavior. If the phase shift is not constant (i.e. the frequencies are not exactly the same), this method probably won't work.
CyReVolt
@CyReVolt:matrix.org
[m]
I won't make it today
Alexander Bessman
@bessman
@nielek2 I pushed some changes to the TCD1304. Clocks now look like this:
4 replies
Figure_1.png
Zoomed in: