Function Test ADC #30

Open
opened 5 years ago by jebba · 32 comments
jebba commented 5 years ago
Owner

Function Test ADC

Function Test ADC
jebba added this to the 3.0.8 milestone 5 years ago
jebba self-assigned this 5 years ago
jebba added the Function label 5 years ago
jebba commented 5 years ago
Poster
Owner

Per:
https://twitter.com/RadionaOrg/status/1183641959472287744

"And if you will have some time, we will have few questions for you, your version is 3.0.8 and in this version EMARD added filter to ADC chip so we are interested will the signal on ADC be better (you can check that with @HDL4FPGA ScopeIO)"

Per: https://twitter.com/RadionaOrg/status/1183641959472287744 "And if you will have some time, we will have few questions for you, your version is 3.0.8 and in this version EMARD added filter to ADC chip so we are interested will the signal on ADC be better (you can check that with @HDL4FPGA ScopeIO)"
jebba commented 5 years ago
Poster
Owner
https://github.com/hdl4fpga/hdl4fpga
jebba commented 5 years ago
Poster
Owner

make linux builds:

tools/bin/scope tools/bin/check

There is a ULX3S directory. In it is a diamond directory, but not icestorm or similar. Need to figure out how to build this with icestorm.

`make linux` builds: `tools/bin/scope tools/bin/check` There is a `ULX3S` directory. In it is a `diamond` directory, but not `icestorm` or similar. Need to figure out how to build this with icestorm.
jebba commented 5 years ago
Poster
Owner

...also not sure if/what external gear is needed for this test...

...also not sure if/what external gear is needed for this test...
jebba commented 5 years ago
Poster
Owner

https://twitter.com/gojimmypi/status/1184758325813993474

"Voila! @HDL4FPGA
and emard have the @RadionaOrg
#ULS3S #FPGA programmed to be an oscilloscope using a common AD/DA board found on ebay! Here's a view of the outbound digital sawtooth in blue (D/A), with a loopback cable and the resultant input, slightly delayed, in yellow! (A/D)"

https://twitter.com/gojimmypi/status/1184758325813993474 "Voila! @HDL4FPGA and emard have the @RadionaOrg #ULS3S #FPGA programmed to be an oscilloscope using a common AD/DA board found on ebay! Here's a view of the outbound digital sawtooth in blue (D/A), with a loopback cable and the resultant input, slightly delayed, in yellow! (A/D)"
jebba added the Needs Cluebat label 5 years ago
Ghost commented 5 years ago

You can unpack this bitstream and try is it working on your version ...

https://github.com/emard/ulx3s-bin/blob/master/fpga/scope/scope-m85f-usb.zip

You can unpack this bitstream and try is it working on your version ... https://github.com/emard/ulx3s-bin/blob/master/fpga/scope/scope-m85f-usb.zip
jebba commented 5 years ago
Poster
Owner

I unpacked that:

$ ecpunpack --input ulx3s_m85f_scope_dvi.bit --textcfg ulx3s_m85f_scope_dvi.config
bitstream size: 15442816 bits
bitstream: reset crc
bitstream: device ID: 0x01113043
bitstream: set control reg 0 to 0x4000003b
bitstream: init address
bitstream: settings: 91 33 ee
bitstream: reading 13294 config frames (with 1 dummy bytes)
bitstream: set USERCODE to 0x00000000
bitstream: program DONE

But repacking it failed (probably user error, this was a guess...):

ecppack --db /home/jebba/devel/FPGA/ECP5/ulx3s/fpga-odysseus-bin/fpga_tools/apio_data/packages/toolchain-ecp5/share/trellis/database ulx3s_m85f_scope_dvi.config --svf ulx3s_m85f_scope_dvi.svf
terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at
Aborted
I unpacked that: <pre> $ ecpunpack --input ulx3s_m85f_scope_dvi.bit --textcfg ulx3s_m85f_scope_dvi.config bitstream size: 15442816 bits bitstream: reset crc bitstream: device ID: 0x01113043 bitstream: set control reg 0 to 0x4000003b bitstream: init address bitstream: settings: 91 33 ee bitstream: reading 13294 config frames (with 1 dummy bytes) bitstream: set USERCODE to 0x00000000 bitstream: program DONE </pre> But repacking it failed (probably user error, this was a guess...): <pre> ecppack --db /home/jebba/devel/FPGA/ECP5/ulx3s/fpga-odysseus-bin/fpga_tools/apio_data/packages/toolchain-ecp5/share/trellis/database ulx3s_m85f_scope_dvi.config --svf ulx3s_m85f_scope_dvi.svf terminate called after throwing an instance of 'std::out_of_range' what(): map::at Aborted </pre>
jebba commented 5 years ago
Poster
Owner

I also rebuilt ujprog with the latest commit: "attempt to support LFE5UM-* chips (untested)". It has the same issue as before.

[FPGA] ~/devel/FPGA/ECP5/ulx3s/scope/scope-m85f-usb $ ~jebba/.local/bin/ujprog ulx3s_m85f_scope_dvi.bit 

ULX2S / ULX3S JTAG programmer v 3.0.92 (built Oct 21 2019 10:26:29)
Cannot find JTAG cable.
I also rebuilt `ujprog` with the latest commit: "attempt to support LFE5UM-* chips (untested)". It has the same issue as before. <pre> [FPGA] ~/devel/FPGA/ECP5/ulx3s/scope/scope-m85f-usb $ ~jebba/.local/bin/ujprog ulx3s_m85f_scope_dvi.bit ULX2S / ULX3S JTAG programmer v 3.0.92 (built Oct 21 2019 10:26:29) Cannot find JTAG cable. </pre>
Ghost commented 5 years ago

If cable is not found you may not program FTDI

You can do it by (do not change 12K to 85K -- this is all fine for now!):

usb-jtag/linux-amd64/ftx_prog --max-bus-power 500

usb-jtag/linux-amd64/ftx_prog --manufacturer "FER-RADIONA-EMARD"

usb-jtag/linux-amd64/ftx_prog --product "ULX3S FPGA 12K v3.0.3"

usb-jtag/linux-amd64/ftx_prog --new-serial-number 120001

usb-jtag/linux-amd64/ftx_prog --cbus 2 TxRxLED

usb-jtag/linux-amd64/ftx_prog --cbus 3 SLEEP

From here:
https://github.com/emard/ulx3s-bin

If cable is not found you may not program FTDI You can do it by (do not change 12K to 85K -- this is all fine for now!): usb-jtag/linux-amd64/ftx_prog --max-bus-power 500 usb-jtag/linux-amd64/ftx_prog --manufacturer "FER-RADIONA-EMARD" usb-jtag/linux-amd64/ftx_prog --product "ULX3S FPGA 12K v3.0.3" usb-jtag/linux-amd64/ftx_prog --new-serial-number 120001 usb-jtag/linux-amd64/ftx_prog --cbus 2 TxRxLED usb-jtag/linux-amd64/ftx_prog --cbus 3 SLEEP From here: https://github.com/emard/ulx3s-bin
Ghost commented 5 years ago

For pack unpack -- I need to check I have this in history for 25F to 12F

ecpunpack --db /home/mistery/FPGA/prjtrellis/database --input project_project.bit --idcode 0x41111043 --textcfg test.log

ecppack --db /home/mistery/FPGA/prjtrellis/database --input project_project.bit --bit out.bit --idcode 0x21111043

For some issues like this one it would be nice to have you on our gitter channel

https://gitter.im/ulx3s/Lobby

For pack unpack -- I need to check I have this in history for 25F to 12F ecpunpack --db /home/mistery/FPGA/prjtrellis/database --input project_project.bit --idcode 0x41111043 --textcfg test.log ecppack --db /home/mistery/FPGA/prjtrellis/database --input project_project.bit --bit out.bit --idcode 0x21111043 For some issues like this one it would be nice to have you on our gitter channel https://gitter.im/ulx3s/Lobby
jebba commented 5 years ago
Poster
Owner

@goran-mahovlic Great, reprogramming with ftx_prog and now ujprog works! Thanks. :)

@goran-mahovlic Great, reprogramming with `ftx_prog` and now `ujprog` works! Thanks. :)
jebba commented 5 years ago
Poster
Owner

I ran this:

$ ~jebba/.local/bin/ujprog ulx3s_m85f_scope_dvi.bit
ULX2S / ULX3S JTAG programmer v 3.0.92 (built Oct 21 2019 10:26:29)
Using USB cable: ULX3S FPGA 12K v3.0.3
Programming: 100%  
Completed in 35.22 seconds.

The monitor plugged into the GDMI port then synced (e.g. usually the power button on the monitor is orange, after the FGPA was programmed by ujprog the color switched to blue. But on the monitor display it says "Out of range". So it seems we're part way there.

I'll check out gitter.

I ran this: <pre> $ ~jebba/.local/bin/ujprog ulx3s_m85f_scope_dvi.bit ULX2S / ULX3S JTAG programmer v 3.0.92 (built Oct 21 2019 10:26:29) Using USB cable: ULX3S FPGA 12K v3.0.3 Programming: 100% Completed in 35.22 seconds. </pre> The monitor plugged into the GDMI port then synced (e.g. usually the power button on the monitor is orange, after the FGPA was programmed by `ujprog` the color switched to blue. But on the monitor display it says "Out of range". So it seems we're part way there. I'll check out gitter.
Ghost commented 5 years ago

Yup, you may try different monitor (could be resolution issue on this one)
This can be changed in source but yes gitter is best way to get answers...

You could try selftest first!

Load this bitstream:

https://github.com/emard/ulx3s-bin/blob/master/fpga/f32c/f32c-85k-vector-v20/ulx3s_v20_m85f_f32c_selftest_2ws_89mhz.bit

You should see some colors, do not restart just run this:

fpga/f32c/f32cup.py fpga/f32c/f32c-bin/selftest-mcp7940n.bin

from here:

https://github.com/emard/ulx3s-bin

Yup, you may try different monitor (could be resolution issue on this one) This can be changed in source but yes gitter is best way to get answers... You could try selftest first! Load this bitstream: https://github.com/emard/ulx3s-bin/blob/master/fpga/f32c/f32c-85k-vector-v20/ulx3s_v20_m85f_f32c_selftest_2ws_89mhz.bit You should see some colors, do not restart just run this: fpga/f32c/f32cup.py fpga/f32c/f32c-bin/selftest-mcp7940n.bin from here: https://github.com/emard/ulx3s-bin
jebba commented 5 years ago
Poster
Owner

@goran-mahovlic the selftest-mcp7940n.bin works! :)

@goran-mahovlic the `selftest-mcp7940n.bin` works! :)
jebba commented 5 years ago
Poster
Owner

Here is what it reads:

2001-02-01 00:00:00 FAIL *-01 00:00:00
EDID EEPROM:128 CRC=00 OK
0001 .... basically a row of numbers that keeps changing
DAC: L3210 FAIL R3210 FAIL V3210 FAIL
BTN: _ _ _ _ _ _ _ SW:1234 LED: (changes...)
FLASH:  17 OK    OLED: 2C     SD: FAIL
Here is what it reads: <pre> 2001-02-01 00:00:00 FAIL *-01 00:00:00 EDID EEPROM:128 CRC=00 OK 0001 .... basically a row of numbers that keeps changing DAC: L3210 FAIL R3210 FAIL V3210 FAIL BTN: _ _ _ _ _ _ _ SW:1234 LED: (changes...) FLASH: 17 OK OLED: 2C SD: FAIL </pre>
Ghost commented 5 years ago

Cool!

Now you can hold BTN1 for a few secs to start timer
When it hits 00:00 it will write OK

ADC will be checked and OK if pass
If you have I2C chip it will read monitor EDID and if OK note ...

I think that for power down and power up by RTC and preserving clock you need to add small battery on back ...

Add SD card so it will not be so slow and it will note SD card type...

You can test BTNs Switches here...

It is actually arduino code

http://www.nxlab.fer.hr/fpgarduino/

run on f32c ( opensource core designed on university in Zagreb )

https://github.com/f32c/f32c

Cool! Now you can hold BTN1 for a few secs to start timer When it hits 00:00 it will write OK ADC will be checked and OK if pass If you have I2C chip it will read monitor EDID and if OK note ... I think that for power down and power up by RTC and preserving clock you need to add small battery on back ... Add SD card so it will not be so slow and it will note SD card type... You can test BTNs Switches here... It is actually arduino code http://www.nxlab.fer.hr/fpgarduino/ run on f32c ( opensource core designed on university in Zagreb ) https://github.com/f32c/f32c
Ghost commented 5 years ago

You can get it from serial and wait a bit then hold BTN1 for few seconds to check if clock is active...
After 1 min I think it should note OK

If something failes you can paste it to gitter -- and EMARD will know if e can fix it ...

stty sane 115200 < /dev/ttyUSB0

cat /dev/ttyUSB0

You can get it from serial and wait a bit then hold BTN1 for few seconds to check if clock is active... After 1 min I think it should note OK If something failes you can paste it to gitter -- and EMARD will know if e can fix it ... stty sane 115200 < /dev/ttyUSB0 cat /dev/ttyUSB0
jebba commented 5 years ago
Poster
Owner

BTN1 change top line which started counting, like this:

2017-12-31 23:50:30 WAIT *-01 00:00:00

After a minute it was like this (counting):

2018-01-01 00:00:15 OK *-01 00:00:00

`BTN1` change top line which started counting, like this: `2017-12-31 23:50:30 WAIT *-01 00:00:00` After a minute it was like this (counting): `2018-01-01 00:00:15 OK *-01 00:00:00`
Ghost commented 5 years ago

After all I wrote you should get something like

2018-01-01 00:10:31 OK *-01 00:00:00 -- will be on after some time after holding BTN1

EDID EEPROM:128 CRC=00 OK --I2C chip reads EDIT from your monitor

0ff0 1000 2ff0 3000 4ff0 5000 6ff0 7000 -- This are reading from ADC

OK OK OK OK OK OK OK OK -- When ADC pass -- need some time

DAC: L3210 OK R3210 OK V3210 OK -- Probably only EMARD knows what this is :)

BTN:12___ SW:1234 LED:___4___0 -- You can press and hold BTNs and change SW to see if this changes

After all I wrote you should get something like 2018-01-01 00:10:31 OK *-01 00:00:00 -- will be on after some time after holding BTN1 EDID EEPROM:128 CRC=00 OK --I2C chip reads EDIT from your monitor 0ff0 1000 2ff0 3000 4ff0 5000 6ff0 7000 -- This are reading from ADC OK OK OK OK OK OK OK OK -- When ADC pass -- need some time DAC: L3210 OK R3210 OK V3210 OK -- Probably only EMARD knows what this is :) BTN:_12____ SW:1234 LED:___4___0 -- You can press and hold BTNs and change SW to see if this changes
Ghost commented 5 years ago

'After a minute it was like this (counting):'

Great, RTC clock is working!

'After a minute it was like this (counting):' Great, RTC clock is working!
Ghost commented 5 years ago

And yes if you connect OLED it will show some colors on selftest ....

And yes if you connect OLED it will show some colors on selftest ....
jebba commented 5 years ago
Poster
Owner

I ordered some CR1225 batteries.

I ordered some CR1225 batteries.
jebba commented 5 years ago
Poster
Owner

No OLED on hand. Do you have one you recommend?

No OLED on hand. Do you have one you recommend?
jebba commented 5 years ago
Poster
Owner

I added an SD card so now that part reads:

SD: HC OK

I added an SD card so now that part reads: `SD: HC OK`
jebba commented 5 years ago
Poster
Owner

Also, there is the row of 4-digit sets, and below it is a row of eight "OK".

Also, there is the row of 4-digit sets, and below it is a row of eight "OK".
jebba commented 5 years ago
Poster
Owner

Ya, it is writing output to /dev/ttyUSB0 like this:


2018-01-01 00:02:31  OK  *-01 00:00:00
EDID EEPROM:128 CRC=00 OK
0000 1fff 2002 3fff 4005 5fff 6000 7fff
 OK   OK   OK   OK   OK   OK   OK   OK 
DAC: L3210  OK  R3210  OK  V3210  OK 
BTN:_______ SW:1234 LED:7___3___
FLASH: 17 OK   OLED: 35   SD: HC OK


Ya, it is writing output to `/dev/ttyUSB0` like this: <pre> 2018-01-01 00:02:31 OK *-01 00:00:00 EDID EEPROM:128 CRC=00 OK 0000 1fff 2002 3fff 4005 5fff 6000 7fff OK OK OK OK OK OK OK OK DAC: L3210 OK R3210 OK V3210 OK BTN:_______ SW:1234 LED:7___3___ FLASH: 17 OK OLED: 35 SD: HC OK </pre>
Ghost commented 5 years ago

So it seams all is working on your board!

You can test BTNs and SW here -- if you flip DIP switch you will see it in missing in SW:
If you hold button you will see no. under BTN:

Oled ---

We had some slow ones, and faster ones but links changed so I am not sure...
I usually just order by description

Ordered few times from here:

https://www.diymore.cc/products/diymore-0-95-inch-7-pin-full-color-65k-ssd1331-96x64-resolution-spi-oled-display-module-for-arduino?_pos=1&_sid=5f305607b&_ss=r

And this is just random search:

https://www.ebay.com/itm/0-95-inch-SPI-Full-Color-OLED-Display-Module-SSD1331-96X64-LCD-for-Arduino/232386221931?epid=4024512118&hash=item361b4c576b:g:6uEAAOSwi8VZT7TH

https://www.ebay.com/itm/0-95-inch-SPI-FULL-Color-OLED-Display-Module-SSD1331-96x64-for-Arduino-RGB/323481141255?epid=6031377961&hash=item4b50fa8007:g:9BUAAOSwMxBctPyG

So it seams all is working on your board! You can test BTNs and SW here -- if you flip DIP switch you will see it in missing in SW: If you hold button you will see no. under BTN: Oled --- We had some slow ones, and faster ones but links changed so I am not sure... I usually just order by description Ordered few times from here: https://www.diymore.cc/products/diymore-0-95-inch-7-pin-full-color-65k-ssd1331-96x64-resolution-spi-oled-display-module-for-arduino?_pos=1&_sid=5f305607b&_ss=r And this is just random search: https://www.ebay.com/itm/0-95-inch-SPI-Full-Color-OLED-Display-Module-SSD1331-96X64-LCD-for-Arduino/232386221931?epid=4024512118&hash=item361b4c576b:g:6uEAAOSwi8VZT7TH https://www.ebay.com/itm/0-95-inch-SPI-FULL-Color-OLED-Display-Module-SSD1331-96x64-for-Arduino-RGB/323481141255?epid=6031377961&hash=item4b50fa8007:g:9BUAAOSwMxBctPyG
jebba commented 5 years ago
Poster
Owner

This one is more expensive, but is local, so no international shipping:

https://www.sparkfun.com/products/11315

Good?

Adafruit has this one:

https://www.adafruit.com/product/684

This one is more expensive, but is local, so no international shipping: https://www.sparkfun.com/products/11315 Good? Adafruit has this one: https://www.adafruit.com/product/684
jebba commented 5 years ago
Poster
Owner

DIP switches all work.

DIP switches all work.
jebba removed the Needs Cluebat label 5 years ago
Ghost commented 5 years ago

This sparkfun OLED is serial, we need SPI for this
I think Adafruit has different pinout so I think this one is not an option...

Will try to search more ...

This sparkfun OLED is serial, we need SPI for this I think Adafruit has different pinout so I think this one is not an option... Will try to search more ...
Ghost commented 5 years ago

EMARD will push new ScopeIO bitstream, to get HDMI running...

EMARD will push new ScopeIO bitstream, to get HDMI running...
jebba commented 5 years ago
Poster
Owner

Ok, looks like it hasn't been pushed yet(?), but I'll keep an eye out. I'm watching:

https://github.com/emard/ulx3s-bin/blob/master/fpga/scope/scope-m85f-usb.zip

Ok, looks like it hasn't been pushed yet(?), but I'll keep an eye out. I'm watching: https://github.com/emard/ulx3s-bin/blob/master/fpga/scope/scope-m85f-usb.zip
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: forksand/fs-ulx3s#30
Loading…
There is no content yet.