On Sunday, 25 June 2017 16:45:55 UTC+2, Bas de Bruijn wrote:
>
> Hi,
>
> This is a question to the mesa/De0 nano SOC FPGA guru's
> Would it be possible to measure current from a DC motor driven by a mesa
> 7i30 daughter card by means of (example)
> https://www.pololu.com/product/1185
>
> I noticed the De0 Nano SoC has an arduino header (which should contain 6
> analog input pins)
>
> How hard would it be to have the De0 fpga read these pins next to handling
> the 7i30?
>
> Is there a Mesa equivalent for reading analog pins?
>
>
Sorry for the incomplete answer:
Yes (I have a prusa-i3 mesa based config up and running on the De0-nano-soc
using the built in ADC converter).
Mostly (I have been unable to figure out how to commit it back into
mainline machinekit).
Highlights of the process:
The ADC converter is wired directly into the fpga so the fpga part (in
quartus) was about moving the terasic / university fifo based adc core into
the mesa tom level file and exporting the wires back out through the top,
plus giving the adc a fixed address of 0x0300 for control and 0x0304 for
data readout.
Somewhere in these commits / branches:
Add adc to quartus project.
https://github.com/the-snowwhite/mksocfpga-hm3_dev/commit/e30bba22c16d1edf9938c916d9a39ea8d567084a
https://github.com/the-snowwhite/machinekit/commits/hm3soc-adc
https://github.com/the-snowwhite/machinekit/commits/adc_work2
https://github.com/the-snowwhite/Hm2-soc_FDM/commits/current?after=cf2b4b10f4d49d77273aa71971c8fbf8591294d4+34
https://github.com/the-snowwhite/mksocfpga-hm3_dev/commits/cap-sense
https://github.com/the-snowwhite/mksocfpga-hm3_dev/commit/425d5decb1882adae717bbc5505c429499212849
The adc fifo ip core was conservatively setup to scan all 8 adc chanels
when triggered and then place the data one readout at a time on the read
register when read.
The adc fifo has some more programmable functionality partly discribed in
my initial tests here:
https://github.com/the-snowwhite/mksocfpga-hm3_dev/tree/hm3-adc/SW/MK/kernel-drivers
On the machinekit side I then added a driver module that add pins for each
channel to the hm2 module and re-triggers the read for each cycle of the
base clock (1khz).
Commits here.
Machinekit De0-Nano-soc adc module
src/hal/drivers/mesa-hostmot2/nano_soc_adc.c
https://github.com/the-snowwhite/machinekit/commit/5c45d6250c26d85e9b13ffca816b2310d4f8
Then I modified the bbb temp user component to scale the temp probe read
outs:
Mesa temp user component
src/hal/user_comps/hal_temp_atlas.py
https://github.com/the-snowwhite/machinekit/commit/6f93a410d7d954a13b6e7294765b182492a399c6
Lastly some links to the prusa-i3 config:
https://github.com/the-snowwhite/Hm2-soc_FDM/commits/current?after=cf2b4b10f4d49d77273aa71971c8fbf8591294d4+34
If there is interest and with a helping hand I could attempt to generate
some clean commits to add the adc functionality to master
I have however not been able to understand or get the added soc-mesa fw-id
to work.
Cheers,
> Bas
>
Best wishes Michael
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github:
https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.