7c81 Bitfile
- cornholio
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 998
- Thank you received: 348
14 Aug 2023 03:19 #277908
by cornholio
7c81 Bitfile was created by cornholio
What would need to be modified to the 7c81 source to run on a Spartan 6 dev board with a 100Mhz clock ? Mimas - Spartan 6 FPGA Development Board
The Clock pin is connected to IO_L36N_GCLK14_0 (is correct to assume this is a global clock pin).
I understand that I'd have to edit the pin constraints file.
The only reason I'm asking this is I've got some time on my hands, unemployment isn't fun and I need something to occupy my mind in between looking for work. Voltage translation is no issue as I have some boards left over from the BBB & MK experiment.
Cheers
The Clock pin is connected to IO_L36N_GCLK14_0 (is correct to assume this is a global clock pin).
I understand that I'd have to edit the pin constraints file.
The only reason I'm asking this is I've got some time on my hands, unemployment isn't fun and I need something to occupy my mind in between looking for work. Voltage translation is no issue as I have some boards left over from the BBB & MK experiment.
Cheers
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17882
- Thank you received: 4781
14 Aug 2023 14:10 #277958
by PCW
Replied by PCW on topic 7c81 Bitfile
If the input clock is 100 MHz you would need to adjust the 2 DCMs in TopGCSPIHostMot2:
(plus any changes needed in the .ucf file to match your dev boards pinout)
ClockMultH : DCM
generic map (
CLKDV_DIVIDE => 2.0,
CLKFX_DIVIDE => 2,
-- CLKFX_MULTIPLY => 8, -- 8 FOR 200 MHz <<<<<<<<<<<<<<<<<<<<<<<
CLKFX_MULTIPLY => 4, -- 4 FOR 200 MHz with 100MHz source <<<<<<<<<<<<<<<<<<<<<<<
CLKIN_DIVIDE_BY_2 => FALSE,
CLKIN_PERIOD => 20.0,
CLKOUT_PHASE_SHIFT => "NONE",
CLK_FEEDBACK => "1X",
DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS",
DFS_FREQUENCY_MODE => "LOW",
DLL_FREQUENCY_MODE => "LOW",
DUTY_CYCLE_CORRECTION => TRUE,
FACTORY_JF => X"C080",
PHASE_SHIFT => 0,
STARTUP_WAIT => FALSE)
port map (
CLK0 => clk0_0, --
CLKFB => clk0_0, -- DCM clock feedback
CLKFX => clkfx0,
CLKIN => CLK, -- Clock input (from IBUFG, BUFG or DCM)
PSCLK => '0', -- Dynamic phase adjust clock input
PSEN => '0', -- Dynamic phase adjust enable input
PSINCDEC => '0', -- Dynamic phase adjust increment/decrement
RST => '0' -- DCM asynchronous reset input
);
BUFG_inst0 : BUFG
port map (
O => fclk, -- Clock buffer output
I => clkfx0 -- Clock buffer input
);
ClockMultM : DCM
generic map (
CLKDV_DIVIDE => 2.0,
CLKFX_DIVIDE => 2,
-- CLKFX_MULTIPLY => 4, -- 4 FOR 100 MHz <<<<<<<<<<<<<<<<<<<<<<
CLKFX_MULTIPLY => 2, -- 2 FOR 100 MHz with 100 Mhz source <<<<<<<<<<<<<<<<<<<<<<
CLKIN_DIVIDE_BY_2 => FALSE,
CLKIN_PERIOD => 20.0,
CLKOUT_PHASE_SHIFT => "NONE",
CLK_FEEDBACK => "1X",
DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS",
DFS_FREQUENCY_MODE => "LOW",
DLL_FREQUENCY_MODE => "LOW",
DUTY_CYCLE_CORRECTION => TRUE,
FACTORY_JF => X"C080",
PHASE_SHIFT => 0,
STARTUP_WAIT => FALSE)
port map (
CLK0 => clk0_1, --
CLKFB => clk0_1, -- DCM clock feedback
CLKFX => clkfx1,
CLKIN => CLK, -- Clock input (from IBUFG, BUFG or DCM)
PSCLK => '0', -- Dynamic phase adjust clock input
PSEN => '0', -- Dynamic phase adjust enable input
PSINCDEC => '0', -- Dynamic phase adjust increment/decrement
RST => '0' -- DCM asynchronous reset input
);
BUFG_inst1 : BUFG
port map (
O => clklow, -- Clock buffer output
I => clkfx1 -- Clock buffer input
);
-- End of DCM_inst instantiation
(plus any changes needed in the .ucf file to match your dev boards pinout)
ClockMultH : DCM
generic map (
CLKDV_DIVIDE => 2.0,
CLKFX_DIVIDE => 2,
-- CLKFX_MULTIPLY => 8, -- 8 FOR 200 MHz <<<<<<<<<<<<<<<<<<<<<<<
CLKFX_MULTIPLY => 4, -- 4 FOR 200 MHz with 100MHz source <<<<<<<<<<<<<<<<<<<<<<<
CLKIN_DIVIDE_BY_2 => FALSE,
CLKIN_PERIOD => 20.0,
CLKOUT_PHASE_SHIFT => "NONE",
CLK_FEEDBACK => "1X",
DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS",
DFS_FREQUENCY_MODE => "LOW",
DLL_FREQUENCY_MODE => "LOW",
DUTY_CYCLE_CORRECTION => TRUE,
FACTORY_JF => X"C080",
PHASE_SHIFT => 0,
STARTUP_WAIT => FALSE)
port map (
CLK0 => clk0_0, --
CLKFB => clk0_0, -- DCM clock feedback
CLKFX => clkfx0,
CLKIN => CLK, -- Clock input (from IBUFG, BUFG or DCM)
PSCLK => '0', -- Dynamic phase adjust clock input
PSEN => '0', -- Dynamic phase adjust enable input
PSINCDEC => '0', -- Dynamic phase adjust increment/decrement
RST => '0' -- DCM asynchronous reset input
);
BUFG_inst0 : BUFG
port map (
O => fclk, -- Clock buffer output
I => clkfx0 -- Clock buffer input
);
ClockMultM : DCM
generic map (
CLKDV_DIVIDE => 2.0,
CLKFX_DIVIDE => 2,
-- CLKFX_MULTIPLY => 4, -- 4 FOR 100 MHz <<<<<<<<<<<<<<<<<<<<<<
CLKFX_MULTIPLY => 2, -- 2 FOR 100 MHz with 100 Mhz source <<<<<<<<<<<<<<<<<<<<<<
CLKIN_DIVIDE_BY_2 => FALSE,
CLKIN_PERIOD => 20.0,
CLKOUT_PHASE_SHIFT => "NONE",
CLK_FEEDBACK => "1X",
DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS",
DFS_FREQUENCY_MODE => "LOW",
DLL_FREQUENCY_MODE => "LOW",
DUTY_CYCLE_CORRECTION => TRUE,
FACTORY_JF => X"C080",
PHASE_SHIFT => 0,
STARTUP_WAIT => FALSE)
port map (
CLK0 => clk0_1, --
CLKFB => clk0_1, -- DCM clock feedback
CLKFX => clkfx1,
CLKIN => CLK, -- Clock input (from IBUFG, BUFG or DCM)
PSCLK => '0', -- Dynamic phase adjust clock input
PSEN => '0', -- Dynamic phase adjust enable input
PSINCDEC => '0', -- Dynamic phase adjust increment/decrement
RST => '0' -- DCM asynchronous reset input
);
BUFG_inst1 : BUFG
port map (
O => clklow, -- Clock buffer output
I => clkfx1 -- Clock buffer input
);
-- End of DCM_inst instantiation
The following user(s) said Thank You: cornholio
Please Log in or Create an account to join the conversation.
- cornholio
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 998
- Thank you received: 348
14 Aug 2023 23:01 #278010
by cornholio
Replied by cornholio on topic 7c81 Bitfile
Thank you Sir you are a Gent.
Please Log in or Create an account to join the conversation.
- cornholio
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 998
- Thank you received: 348
21 Aug 2023 11:19 - 21 Aug 2023 11:33 #278604
by cornholio
Replied by cornholio on topic 7c81 Bitfile
Your help was great, after a bit of looking through the Xilinx docks I managed to work out the correct pin for COM_CSCLK as my board has the clk input on IO_L36N_GCLK14_0. Most of the clocking docs were a bit over my head, but I bungled my way through.
So far I can communicate with the board, via halrun.
The next query is probably above and beyond.
I would like 1 Spindle encoder, 1 MPG for each X & Z on the lathe and upto 5 simple quad encoders for Feed Override, Rapid Override, Spindle Overrride, Jog Speed & Max Velocity.
For the spindle encoder I guess quadencounter would be the best option and I was thinking of linuxcnc.org/docs/2.9/html/man/man9/host...ml#inm%20and%20inmux
for the rest.
I've had a look at this file PIN_7I85x2_34.vhd and the a pin file related to it. Looking at this snippet....
Questions are:
What is the function of this line:
And can I get away without the IDX entry for each ? Or have I got my wires crossed ? Any help is really appreciated.
So far I can communicate with the board, via halrun.
The next query is probably above and beyond.
I would like 1 Spindle encoder, 1 MPG for each X & Z on the lathe and upto 5 simple quad encoders for Feed Override, Rapid Override, Spindle Overrride, Jog Speed & Max Velocity.
For the spindle encoder I guess quadencounter would be the best option and I was thinking of linuxcnc.org/docs/2.9/html/man/man9/host...ml#inm%20and%20inmux
for the rest.
I've had a look at this file PIN_7I85x2_34.vhd and the a pin file related to it. Looking at this snippet....
IOPortTag & x"01" & MuxedQCountSelTag & MuxedQCountSel0Pin, -- I/O 10 PIN 7 PIN 13
IOPortTag & x"01" & MuxedQCountTag & MuxedQCountQAPin, -- I/O 11 PIN 8 PIN 15
IOPortTag & x"01" & MuxedQCountTag & MuxedQCountQBPin, -- I/O 12 PIN 9 PIN 17
IOPortTag & x"01" & MuxedQCountTag & MuxedQCountIDXPin, -- I/O 13 PIN 10 PIN 19
IOPortTag & x"02" & MuxedQCountTag & MuxedQCountQAPin, -- I/O 14 PIN 11 PIN 21
IOPortTag & x"02" & MuxedQCountTag & MuxedQCountQBPin, -- I/O 15 PIN 12 PIN 23
IOPortTag & x"02" & MuxedQCountTag & MuxedQCountIDXPin, -- I/O 16 PIN 13 PIN 25
Questions are:
What is the function of this line:
MuxedQCountSelTag & MuxedQCountSel0Pin
And can I get away without the IDX entry for each ? Or have I got my wires crossed ? Any help is really appreciated.
Last edit: 21 Aug 2023 11:33 by cornholio.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17882
- Thank you received: 4781
21 Aug 2023 14:14 - 21 Aug 2023 17:50 #278617
by PCW
Replied by PCW on topic 7c81 Bitfile
I would not use a 7I85 as as example as that uses muxed encoders inputs.
I would use the inm input module for inputs/mpgs and the normal, non muxed
encoder for the spindle encoders.
You can use inmux to save interface pins but that requires external 74hct251
(or similar) muxes. inm works directly on inputs.
And no, you don't need an Idx pin on encoders unless its needed by the machine.
(typically needed for spindle synchronized moves or if you want to home to index)
For an example config that has most of this stuff, take a look at
PIN_7I96inmD_51.vhd
I would use the inm input module for inputs/mpgs and the normal, non muxed
encoder for the spindle encoders.
You can use inmux to save interface pins but that requires external 74hct251
(or similar) muxes. inm works directly on inputs.
And no, you don't need an Idx pin on encoders unless its needed by the machine.
(typically needed for spindle synchronized moves or if you want to home to index)
For an example config that has most of this stuff, take a look at
PIN_7I96inmD_51.vhd
Last edit: 21 Aug 2023 17:50 by PCW. Reason: clarify
Please Log in or Create an account to join the conversation.
- cornholio
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 998
- Thank you received: 348
22 Aug 2023 15:22 #278712
by cornholio
Replied by cornholio on topic 7c81 Bitfile
Thanks, works like a charm,
Please Log in or Create an account to join the conversation.
- cornholio
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 998
- Thank you received: 348
04 Sep 2023 08:54 - 04 Sep 2023 13:21 #279802
by cornholio
Replied by cornholio on topic 7c81 Bitfile
Is there any trickery involved in getting Smart serial to work.
When loading the hm2_rpspi driver the RX TX TXEN pins are just showing as gpio. There's no searching for any SmartSerial devices. Even when I use sserial_port_0=0x00000000
I know it work the first time I built firmware, cos when I loaded the driver it searched for Smartserial deivces.
I've attached my Pin file....maybe I just don't get it ATM
The files below are from a later firmware where the TXEN were removed.
When loading the hm2_rpspi driver the RX TX TXEN pins are just showing as gpio. There's no searching for any SmartSerial devices. Even when I use sserial_port_0=0x00000000
I know it work the first time I built firmware, cos when I loaded the driver it searched for Smartserial deivces.
I've attached my Pin file....maybe I just don't get it ATM
The files below are from a later firmware where the TXEN were removed.
Last edit: 04 Sep 2023 13:21 by cornholio. Reason: attached file shows TXEN but next lot of firmware I removed them
Please Log in or Create an account to join the conversation.
- cornholio
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 998
- Thank you received: 348
04 Sep 2023 13:18 #279825
by cornholio
Replied by cornholio on topic 7c81 Bitfile
Added some extra info
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17882
- Thank you received: 4781
04 Sep 2023 14:55 #279836
by PCW
Replied by PCW on topic 7c81 Bitfile
If the hostmot2 driver does not find a sserial remote device
it leave the associated pins as plain GPIO.
it leave the associated pins as plain GPIO.
The following user(s) said Thank You: cornholio
Please Log in or Create an account to join the conversation.
- cornholio
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 998
- Thank you received: 348
04 Sep 2023 21:24 #279887
by cornholio
Replied by cornholio on topic 7c81 Bitfile
Thanks I might have to cobble up a RS-422 interface and try my 7i73. So at least I can confirm the Smartserial port is trying to talk to something.
Cos ATM it doesnt want to talk to the dev board with 7i90 sserial firmware.
Should I get a message from hostmot2 that it can't find anything or does it just go on it's merry way ?
Cos ATM it doesnt want to talk to the dev board with 7i90 sserial firmware.
Should I get a message from hostmot2 that it can't find anything or does it just go on it's merry way ?
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.114 seconds