Home Forum Latest Post
 Gabotronics Forum
Welcome Guest   
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  4 
  •  5 
  •  6 
  •  7 
  •  8 
  •  9 
  •  10 
  •  Next 
  •  End 
  • »
 Subject :control the scope with python, here are some code examples.. 2018-12-18 06:02:01 
nicole wolffer
Joined: 2018-12-18 11:51:37
Posts: 1
Location
Forum : XScopes PC Interface
Topic : control the scope with python, here are some code examples

 

The pyusb module allows to control xpotolab with python.

I tried with a xprotolab plain, a computer on Ubuntu and a Raspberry pi

I tried the scope mode only.

 

First, one need to install pyusb

https://github.com/walac/pyusb

https://github.com/walac/pyusb/blob/master/docs/tutorial.rst

 

libusb must also be installed, but, if Gabriel's program is running, it’s already done

 

One must be sure the scope is triggered. If it is not , a time out error will occur while trying to transfer the frame data

On Ubuntu or Raspberry, open python in super user mode.

 

it’s ready, here are the code examples

 

#first, import the modules

import sys

import usb.core

import usb.util

 

#find the scope

xscope = usb.core.find(idVendor=5840, idProduct=1785)

if xscope is None:

print'Xscope is not connected'

 

#find the number of configurations

print 'nomber of configurations : ',xscope.bNumConfigurations

cfg=xscope[0]

 

#find the number of interfaces and alternate settings

print "nomber of interfaces of config 0 : ",cfg.bNumInterfaces

intf=cfg[0,0]

print "nomber of alternate settings : ",intf.bAlternateSetting

 

#find the end points

print "nomber of end point : ",intf.bNumEndpoints

ep0=intf[0]

ep1=intf[1]

print "ep0 adress: ",ep0.bEndpointAddress

print "ep1 :adress ",ep1.bEndpointAddress

print "packet max of ep0 : ",ep0.wMaxPacketSize

print "packet max of ep1 : ",ep1.wMaxPacketSize

 

#set configuration before beeing able to communicate with the scope

xscope.set_configuration()

 

 

 

 

#for each frame, 12 paquets of 64 bytes and a paquet of 2 bytes (frame and index)

#get paquets using bulk transfer untill the frame and index are send

u=100

while u>2:

data = xscope.read(ep0.bEndpointAddress,ep0.wMaxPacketSize)

u = len(data)

 

#paquets will now correspond to a new frame

#get ch1 data

ch1=[]

for u in range (4):

#bulk transfer of 64 bytes

data = xscope.read(ep0.bEndpointAddress,ep0.wMaxPacketSize)

#add data to ch1

ch1.extend(data.tolist())

print 'ch1 = ', ch1

 

#get ch2 data

ch2=[]

for u in range (4):

data = xscope.read(ep0.bEndpointAddress,ep0.wMaxPacketSize)

ch2.extend(data.tolist())

print 'ch2 = ',ch2

 

#get chD data

chD=[]

for u in range (4):

data = xscope.read(ep0.bEndpointAddress,ep0.wMaxPacketSize)

chD.extend(data.tolist())

print 'chD = ',chD

 

#get frame, index data

data = xscope.read(ep0.bEndpointAddress,ep0.wMaxPacketSize)

frameindex=data.tolist()

print 'frame and index =', frameindex

 

 

 

#Now, one want to read and change the scope settings.

#

#commands are sent as CONTROL READ requests.

#commands are letters which can be found in the manual

#There are only two details one has to be carefull :

#first, do not use the command letters as string but use the ASCII value of the command letter.

#For example , to ask the firmware version, do not write ‘a’ but write ord(‘a’) or 0x61.

#Also, ask the exact number of bytes the scope is ready to send, no more, no less.

 

#To ask for firmware version :

data = xscope.ctrl_transfer(0xC0,0x61,0,0,4)

print data

v=data.tolist()

version = chr(v[0])+chr(v[1])+chr(v[2])+chr(v[3])

print version

 

#my version is 2,38

 

 

#to read registers : command is 'u', 44 bytes are send to computer

data = xscope.ctrl_transfer(0xC0,ord('u'),0,0,44)

print data

 

#mind, in older devices, there may be only 43 bytes

 

 

#to restore defaults , command is ‘k’

xscope.ctrl_transfer(0xC0,ord('k'),0,0,0)

 

#to write the settings, command is 'b' and 0 byte is send to computer,

#for example

#to set channel A gain (index 12 ) to level 3 :

xscope.ctrl_transfer(0xC0,ord('b'),3,12,0)

#to set channel B gain (index 13 ) to level 5 :

xscope.ctrl_transfer(0xC0,ord('b'),5,13,0)

#to set timescale (index 0 ) to level 5 :

xscope.ctrl_transfer(0xC0,ord('b'),5,0,0)

 

 

p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }

IP Logged
 Subject :Trigger sign is missing from graph interface from a certain horizontal.. 2018-12-07 09:30:04 
lshachar
Joined: 2015-10-09 11:51:52
Posts: 2
Location
Forum : XScopes PC Interface
Topic : Trigger sign is missing from graph interface from a certain horizontal range

Subject :Trigger sign is missing from graph interface from a certain horizontal range

Hello!

I cannot use triggers properly, since the trigger sign is missing once going from 10ms/div time to 20ms/div time and up. also, once that happens, I cannot scroll the captured signal to the sides.

link: attached video

XScope Version 1.1.0.0
Xprotolab Plain Firmware Version 2.38

cheers, Shachar.

IP Logged
 Subject :Re:UART baud rate... 2018-08-29 05:50:01 
eead369
Joined: 2018-07-08 23:44:31
Posts: 2
Location
Forum : XMEGA Xminilab
Topic : UART baud rate.

I don't have that skillset.

IP Logged
 Subject :Re:Xminilab - USB PC-connection.. 2018-08-03 18:37:54 
ganzziani
Joined: 2012-04-02 15:42:39
Posts: 461
Location: Sarasota, FL
 
Forum : XMEGA Xminilab
Topic : Xminilab - USB PC-connection

Have you tried another cable? Do you see a the red LED blink quickly when connecting the Xminilab?
IP Logged
Gabriel Anzziani
 Subject :Xminilab - USB PC-connection.. 2018-07-31 01:36:37 
Alwinharms
Joined: 2018-07-31 06:29:48
Posts: 1
Location
Forum : XMEGA Xminilab
Topic : Xminilab - USB PC-connection

a few weeks ago i discovered that the Xminilab won't connect to the Gabotronics Xscope interface PC-software anymore. I am using Windows 7. Is there any workaround that may help solving the problem?

Thanks and regards,

Alwin

IP Logged
 Subject :not connected problem.. 2018-07-14 06:11:00 
sarea
Joined: 2018-07-14 11:03:20
Posts: 1
Location
Forum : XMEGA Xprotolab
Topic : not connected problem

Hello all,

while i am using the Xscope spi protocol sniffer, suddenly the pc gui stops working.

i have tried to restart the PC and reconnect the scope usb but nothing happened.

the gui opens as usual if the scope not connected but if i try to open it with the scope connected then i have on the window "not connected" and it is closed immediately.

How to fix that ?

Regards,

Sarea

IP Logged
 Subject :Re:UART baud rate... 2018-07-09 15:55:51 
ganzziani
Joined: 2012-04-02 15:42:39
Posts: 461
Location: Sarasota, FL
 
Forum : XMEGA Xminilab
Topic : UART baud rate.

You could create your own firmware.

It would be a matter of changing some constants in the source code.

IP Logged
Gabriel Anzziani
 Subject :How do I buy another one.. 2018-07-09 14:02:21 
haywardt
Joined: 2013-05-17 01:03:03
Posts: 2
Location
Forum : XMEGA Xprotolab
Topic : How do I buy another one

I can't find a way to put the xprotolab in my shopping cart. I love these little devices and I'm all out of them. How do I buy one?

IP Logged
 Subject :UART baud rate... 2018-07-08 19:03:31 
eead369
Joined: 2018-07-08 23:44:31
Posts: 2
Location
Forum : XMEGA Xminilab
Topic : UART baud rate.

Any chance that the UART protocol analyzer can have 76.8Kbs added as a baud rate? Or allow user to input custom baud rates?

IP Logged
 Subject :Re:Dead Xprotolab plain ???.. 2018-06-18 05:47:31 
elecomte
Joined: 2018-06-18 03:52:07
Posts: 2
Location
Forum : XMEGA Xprotolab
Topic : Dead Xprotolab plain ??? (FIXED)

(This is an edited answer as my first one was providing wrong details)

So I finally find the details I needed, and was able to fix the Xprotolab Plain :-)

Everything provided in documentation about firmware update is OK, except that the details on "what is the PIN 1 / 6 of J8 connector" are missing.

I did a (fixed) pin diagram : I'm sharing it here, this time it seems to be OK

So the J8 connector is the extension port, not soldered and with only surface mount soldering points, next to the MCU. You have to solder a connector here (for example, a low-profil 1*6 connector is perfect) and "sacrifice" the PDI connector (actually, you will never use it if you don't have a PDI compliant programmer). Then you will be able to link PIN 1 to 6 in it and once you have connected USB, you have to remove the link.

After that, follow the instructions. As the Atmel website is gone since december 2017, you have to search into archive.org for the FLIP tool . Don't forget to use the USB driver provided with FLIP when your computer identify the device, not the WinUSB driver from Zadig tool.

Once the firmware is updated, this nice little device is back to normal :-)

IP Logged
 Subject :Dead Xprotolab plain ??? (FIXED).. 2018-06-17 23:16:14 
elecomte
Joined: 2018-06-18 03:52:07
Posts: 2
Location
Forum : XMEGA Xprotolab
Topic : Dead Xprotolab plain ??? (FIXED)

Hi,

My brand new Xprotolab plain (bought in your french distributor store) worked for 5 minutes (using Windows 10, xscope + driver install was OK) and was very promising for a total newbe on MCU programming like me.

But when I started to use the logic analyzer (on a NodeMCU output => ESP8266 with 3.3v level for all GPIOs) Xscope freezed. I restarted everything but since, the xprotolab doesn't light up anymore : I have only 2/3 red light flashes and no more green light.

As I though I erased the firmware or something, I followed various instructions about how to restore it : BTW it's not well explained : do I have to link pin 1 to pin 6 or do I have to ground pin 6 to GND, as I have seen on another forum message ???.

  • I tried with FLIP (hard to find since the Atmel site doesn't exist anymore ... by the way you can find Flip installer for a version working with Windows 10 here : thank you archive.org). USB connection doesn't work, and I got a missing dll error. It's impossible to install the USB driver provided with FLIP. But Zadig is still able to "reinstall" the driver with success (and the device is seen in windows as "xscope"). And windows seems to "see" the xprotolab in some way.
  • I tried also on linux Ubuntu, but AVRDUDE says that there is no available driver for the device.
  • I have tried on various PC without more success : still 2 / 3 red light flashes, no green light.

So I really don't know how to fix this. Maybe it's the bootloader which is erased, but I don't have a PIC programmer and I don't expect to pay 20€ or something to buy stuff for fixing a 20€ device ... Or maybe I can try with a USB / TTL adaptor (I have one based on CP2104) ?

Is my protolab fully dead ? Did I missed something somewhere on how to fix this ?

Thank you a lot for any help provided

IP Logged
 Subject :Updating firmware on xprotolab.. 2018-05-23 19:27:59 
omegacore
Joined: 2012-10-01 19:57:33
Posts: 1
Location
Forum : XMEGA Xprotolab
Topic : Updating firmware on xprotolab

Hi,

When I use the USB scope windows application it tells me to update my firmware. Also the software doesn't seem to control the scope very well.

I tried to follow the firmware update guide, but Windows 10 will not let me install the USB drivers for the bootloader. When I try to update the driver (per the Amtel guide instructions AN 8429) it says I already have newer drivers and the device remains uninitialized.

I could spin up a VM and try from linux, but the avrdude instructions are very sparse. Do I really only need to run two commands?

I also could not find where it says what hardware version of the scope I have. When it boots it says it's running v2.0.0.

Thanks!

 

IP Logged
 Subject :Re:Xprotolab Plain no usb.. 2018-04-11 09:50:09 
pease@coati.com
Joined: 2015-03-29 23:28:48
Posts: 2
Location
Forum : XMEGA Xprotolab
Topic : Xprotolab Plain no usb

Hi, Gabriel,

Thanks for the reply.  Much to my amazement, I tried a different USB cable and it worked!  (I thought I had tried more than one when moving from my laptop to my Android tablet, without any success, but now both work.)  So I guess this was user error!

-David

IP Logged
 Subject :Re:Xprotolab Plain no usb.. 2018-03-28 19:10:46 
ganzziani
Joined: 2012-04-02 15:42:39
Posts: 461
Location: Sarasota, FL
 
Forum : XMEGA Xprotolab
Topic : Xprotolab Plain no usb

Hi, can you try with a different USB cable? If it doesn't work, perhaps you will need a replacement. Send me an email.
IP Logged
Gabriel Anzziani
 Subject :Xprotolab Plain no usb.. 2018-03-04 12:43:00 
pease@coati.com
Joined: 2015-03-29 23:28:48
Posts: 2
Location
Forum : XMEGA Xprotolab
Topic : Xprotolab Plain no usb

Hi,

I have an Xprotolab Plain that I cannot get to show up through USB.  (I have tried both Ubuntu and Android, and both claim there is no USB device connected.)

The list of attached devices from lsusb does not change when I plug in the device; it simply doesn't show up.  I believe that there is a red LED that is supposed to flash with USB activity, but I have never seen it.  (The green LED stays lit continuously.)  I've tried shorting pins 1 and 6 of J8 to activate the bootloader before powering, but still no USB device.

I've had the board for quite a while, and have tried several times to figure out what's wrong, but now need to use it and need help getting it connected.

Thanks!  -David

P.S. The packaging shows HW: 1.0, if that makes a difference.  Obviously, I can't see the firmware version.

 

IP Logged
 Subject :Re:Pinout for old xprotolab.. 2018-02-20 14:10:10 
ganzziani
Joined: 2012-04-02 15:42:39
Posts: 461
Location: Sarasota, FL
 
Forum : XMEGA Xprotolab
Topic : Pinout for old xprotolab

Yes, you can apply power thru +5V and GND. You can take a look at schematics to be sure.
IP Logged
Gabriel Anzziani
 Subject :Pinout for old xprotolab.. 2018-02-17 06:48:11 
Efluon
Joined: 2018-12-14 03:29:13
Posts: 1
Location
Forum : XMEGA Xprotolab
Topic : Pinout for old xprotolab

i want to use my old xprotolab without usb. Now i dont know how to connect the power. The manual describes a 6x1 pin connector , i have a 3x2 connector.

Edit: can i just use the +5v of the „back“ pins (besides the logic ins)? (The -5 is an output??)

IP Logged
 Subject :Xprotolab plain - how to use it in a simple way.. 2018-01-14 05:55:41 
friemelfritze
Joined: 2018-01-14 11:34:52
Posts: 1
Location
Forum : XMEGA Xprotolab
Topic : Xprotolab plain - how to use it in a simple way

Hello,

I recently bought a "plain version". Problem: it is not running anyway, neither under windows (XP64) nor Ubuntu 16 nor Android.

Later I only want to use it with a tablet and the Oscilloscope software from NFX (Nick Winder), for now also this is not working. (but using a OTG cable). What about the two cables from Micro -->A-A--> Micro? Both OTG necessary?

But the LED is lighting and both the voltages can be measured at the PCB-pins.

How to install the ZADIG-driver? There is no explanation, what it does. It propably does'nt work because the device is not recognized by MS Windows resp. I believe this. Can this be true?

And at last: should Xscope show "Connected", when it is connected only without any other cables on it or not? What means the white cable on the picture at the "plain" page between pin 1 and 5? I dont understand, why there is a signal shown without any Channel input. Confusing.

And really at last: what mean the 6 empty holes near the usb interface? Can I use them?

thanks for help!

Fritze

IP Logged
 Subject :... 2018-01-12 08:09:10 
Schizopilz
Joined: 2016-04-21 08:39:49
Posts: 1
Location
Forum : XMEGA Xprotolab
Topic : .

.

IP Logged
 Subject :Re:Xscope and screen resolution + control hiding.. 2017-12-17 06:26:24 
jdinsmore
Joined: 2017-11-20 12:12:16
Posts: 4
Location: Melbourne, Florida
 
Forum : XScopes PC Interface
Topic : Xscope and screen resolution + control hiding

Yes, this is giving me grief also on the Raspberry Pi; I hate to make everything else microscopic just to get access to the controls; even to turn it on and off.

 

One thing I did was to edit the /boot/config.txt in order to change the vertical part of my screen resolution to 800 which worked for my 1366x768 display.

IP Logged
Page # 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  4 
  •  5 
  •  6 
  •  7 
  •  8 
  •  9 
  •  10 
  •  Next 
  •  End 
  • »


Powered by ccBoard