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
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:
Figure_1.png
CyReVolt
@CyReVolt:matrix.org
[m]

Here's a decent board for those interested in FPGAs:
https://github.com/GlasgowEmbedded/glasgow

And the other one from the Radiona hackerspace:
https://radiona.org/ulx3s/

Both are open hardware and work with open tooling. The Glasgow is very much like PSLab, but based on an FPGA.

Glasgow is a tool for exploring digital interfaces, aimed at embedded developers, reverse engineers, digital archivists, electronics hobbyists, and everyone else who wants to communicate to a wide selection of digital devices with high reliability and minimum hassle. It can be attached to most devices without additional active or passive components, and includes extensive protection from unexpected conditions and operator error.
CyReVolt
@CyReVolt:matrix.org
[m]
Another interesting board:
http://www.gnarlygrey.com/?i=1
And the legendary OrangeCrab:
https://1bitsquared.de/products/orangecrab
CyReVolt
@CyReVolt:matrix.org
[m]

Sooo... they're all based on Lattice FPGAs (Lattice being an FPGA vendor). Arrow is just a distributor, and they do have Lattice among their catalog:
https://www.arrow.com/en/products/lcmxo3lf-9400e-5mg256c/lattice-semiconductor

@mariobehling could you ask the person who contacted you if they would offer their workshop based on the open tooling that the community made for Lattice FPGAs?

And sorry for being quite dismissive... I think that was premature.
Mario Behling
@mariobehling
@CyReVolt:matrix.org Sure, I will ask. Thanks

The Glasgow is very much like PSLab, but based on an FPGA.

Where would you see a difference to what a future PSLab FPGA could offer compared to the Glasgow board?

CyReVolt
@CyReVolt:matrix.org
[m]
I don't see one. The main value I see in PSLab is the apps with the full stack. The key step for someone to get started - in my view - is to learn how wiring things up leads to getting something to show up in the apps. It's that moment when someone realizes "I put this together and understood what it means". And because they have the app, they can focus entirely on the mechanical and analog world. Does that make sense? :-)