Closed TurBoss closed 1 year ago
does the ID change every time you try ?
i think this is a problem with SPI. you can try to set the SPI-divider to 256 in rio.c:
//bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_256);
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_128);
I think that is a bad setting in my board config clock speed, need to figure..
I tried changing that setting to 256 but this time got a different code in the message
strange if it's work with the python tool if you changed the firmware, you have also to update the rio.h and recompile the hal-component.
ahh, and you need min. one Joint, one DIN, DOUT, VIN and VOUT until i have a fix for the hal-component
hello,
i could not get it to work each time i press e-stop i get a different payload
I'll wait for the improvements. Thank you so much
I don't know what I could improve at this point. I think it is a connection problem, maybe too long cable or too high spi speed.
I'll check wiring
thanks
changing rio.c to bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_256); and recompile
does not help ?
Hello,
I tried soldering some headers to a PCB and got it like before, the qt app works but not linuxcnc, I tried changing that option in rio.c and recompile with halcompile but got different payload errors
:)
:( hmm stange, can you send me your config please ?
sure here it is:
{
"name": "ICEBreakerV1.0e",
"description": "Small and low cost FPGA educational and development board",
"toolchain": "icestorm",
"family": "ice40",
"type": "up5k",
"package": "sg48",
"clock": {
"speed": "120000000",
"pin": "35"
},
"interface": [
{
"type": "spi",
"pins": {
"MOSI": "42",
"MISO": "43",
"SCK": "38",
"SEL": "36"
}
}
],
"din": [
{
"debounce": true,
"pin": "10"
},
{
"debounce": true,
"pin": "20"
},
{
"debounce": true,
"pin": "19"
},
{
"debounce": true,
"pin": "18"
}
],
"dout": [
{
"pin": "23"
},
{
"pin": "25"
},
{
"pin": "26"
},
{
"pin": "21"
},
{
"pin": "27"
}
],
"vin": [
{
"type": "frequency",
"pin": "44",
"pullup": true
}
],
"vout": [
{
"type": "pwm",
"pin": "37",
"invert_pwm": true
},
{
"type": "pwm",
"pin": "11",
"invert_pwm": true
}
],
"joints": [
{
"comment": "J9.1+3+4",
"type": "stepper",
"cl": false,
"pins": {
"dir": "3",
"step": "4",
"enable": "48"
}
},
{
"comment": "J9.1+3+4_2",
"type": "stepper",
"cl": false,
"pins": {
"dir": "2",
"step": "46",
"enable": "47"
}
},
{
"comment": "J9.1+3+4_3",
"type": "stepper",
"cl": false,
"pins": {
"dir": "32",
"step": "34",
"enable": "28"
}
}
]
}
Hmm, looks ok , this should generate a working rio.h file
hello,
I noticed having one more zero in the clock speed... :(
but if I configure 3 DOUT the python tool moves one more that is not in the json conf :/
Thanks
I have update the tool a little bit, it's really bad but is helpful for testing :)
Ahh, Ok, so you have a clock of 12Mhz ?
maybe to slow for the fast SPI clock in the hal-component, but no problem (i hope):
"clock": { "osc": "12000000", "speed": "50000000", "pin": "35" },
the 'osc' ist you real clock speed and the 'speed' option is what you want to have,
this acitvates the internal PLL to push the clock speed up.
I think 50Mhz is ok, but you can also try 100Mhz
If I add the osc option i get this error
(venv) turboss@raspberrypi:~/LinuxCNC-RIO $ make
python3 buildtool.py configs/ICEBreakerV1.0e/config.json
generating files in Output/ICEBreakerV1.0e
generating linux-cnc config
generating linux-cnc component
generating firmware
generating qtgui
generating doc
(cd Output/ICEBreakerV1.0e/Firmware/ ; make)
make[1]: Entering directory '/home/turboss/LinuxCNC-RIO/Output/ICEBreakerV1.0e/Firmware'
yosys -q -l yosys.log -p 'synth_ice40 -top rio -json rio.json' vout_pwm.v vin_frequency.v quad_encoder.v joint_stepper.v joint_stepper_nf.v interface_spislave.v debouncer.v pll.v rio.v
nextpnr-ice40 -q -l nextpnr.log --up5k --package sg48 --json rio.json --pcf pins.pcf --asc rio.asc
ERROR: PLL 'mypll.uut' couldn't be placed anywhere, no suitable BEL found. Did you mean to use a PAD PLL ?
PLL bel 'X12/Y31/pll_3' cannot be used as it conflicts with input 'sysclk_in$sb_io' on pin '35'.
ERROR: Packing design failed.
0 warnings, 2 errors
make[1]: *** [Makefile:12: rio.asc] Error 255
make[1]: Leaving directory '/home/turboss/LinuxCNC-RIO/Output/ICEBreakerV1.0e/Firmware'
make: *** [Makefile:39: firmware] Error 2
(venv) turboss@raspberrypi:~/LinuxCNC-RIO $
I'm very new to FPGA :)
Thank you
ok, thats also new too me, my oss-cad-suite is a little bit to old and iceppl is missing parameter (-p). I have add a newer version of icepll (files/icepll) and add an exception to the firmware generator, hope this will now work for this case. Please try it again
Do you run the build on a workstation or on raspberry ?
I run he build from the pi itself
now got this one :)
python3 buildtool.py configs/ICEBreakerV1.0e/config.json
generating files in Output/ICEBreakerV1.0e
generating linux-cnc config
generating linux-cnc component
generating firmware
sh: 1: files/icepll: Exec format error
generating qtgui
generating doc
aaaa, sorry, new update :) i have running 2 versions on my system, the one in the oss-cad-suite works fine.
You are running direct on the raspberry, i build it for amd64, sorry
okay got this and looks like what i had in config
but still no way to get the estop out :/ the other time that got followin errors was becouse i commented that on hal :/
just notice that i'm getting the same payload now
Bad SPI payload = 32303a30
Bad SPI payload = 32303a30
Bad SPI payload = 32303a30
Bad SPI payload = 32303a30
Bad SPI payload = 32303a30
should i build from pc and try... :face_with_spiral_eyes:
i don't think it makes a different on PC
in binary, it looks like a speed issue: 0x32303a30 00110010001100000011101000110000 0x64617461 01100100011000010111010001100001
can you try to set the speed again:
and restart linuxcnc
this will slow down the spi speed to under 1Mhz
and only to be sure, you have to stop the python tool if you running linuxcnc
yes yes only one app at time
i have ordered an icebreaker board in china, hopefully in 2 weeks i will know more :)
:O awesome thank you so much!
i need it anyway, i want to design a board and maybe use the up5k for it
thank you for investing so much time in this project
don't worry I'm having lots of fun
I found the issue
may fault by having a offset in the iceprog tool
big face palm :=)
can I set this as fixed :D
Thank you so much :D
Wait what ? does it work now ?
yes it does
i was had an offset of 1M in the iceprog from another project and forgot to remove :_)
Just finished soldering the protoboard I'll try to get a video
cooool !!!!
here a short long video :D
Very cool, thank you !
and i like your GUI, have to test it
Hello,
I'm trying to get the linuxcnc configs to run with the icebreaker board, but I'm unable to reset the E-STOP
I get this error:
Bad SPI payload = 32303a30
Thanks