7c81 and 2nd PWMgen problems

More
31 Dec 2021 20:20 #230410 by llamatrails
I'm trying to configure the 2nd PWMgen on my 7c81.  I used pncconf to configure it, and changed the appropriate lines to run on the Raspberry Pi.

When I start linuxcnc, it errors out with "./7c81.hal:32: parameter or pin 'hm2_7c81.0.gpio.020.is_output' not found".

I can start linuxcnc if I comment out the 2nd PWMgen pin settings:
# --- SPINDLE-ENABLE ---
setp [HMOT](CARD0).gpio.020.is_output true
net spindle-enable  =>     [HMOT](CARD0).gpio.020.out

If I comment out the 1st PWMgen pin settings, I get the same error, even though the only difference is the gpio pin number, which the attached linuxcnc.report file shows as configured.  Also attached is the 7c81.hal file, as generated by pncconf with the HMOT changed.

What am I missing?

TIA, Rick
Attachments:

Please Log in or Create an account to join the conversation.

More
31 Dec 2021 20:38 - 31 Dec 2021 21:36 #230412 by PCW
Replied by PCW on topic 7c81 and 2nd PWMgen problems
You are trying to use a PWM pin as GPIO, that is,
GPIO.020 is a PWM output if PWMGen 1 is enabled so
not available for GPIO output use:

hm2/hm2_7c81.0: IO Pin 020 (P2-02/DB25-14): PWMGen #1, pin Out0 (PWM or Up) (Output)

(if your bitfile is not what pncconf expects it will not know
that GPIO.020 is unavailable for output use, so you need
to setup and connect GPIO by editing the hal file)
Last edit: 31 Dec 2021 21:36 by PCW. Reason: clarify

Please Log in or Create an account to join the conversation.

More
31 Dec 2021 21:55 - 31 Dec 2021 22:18 #230415 by llamatrails
I am trying to use pin 020 as a spindle PWM output.  My 1st spindle on pin 007 works perfectly.

All I have to go by is what pncconf generated for me as in the linuxcnc.report that I attached shows.

Why didn't it squawk on the PWMGen 0 which is configured exactly the same on pin 007, as a GPIO out?

My bitfile is for the dual G540 configuration, pncconf is told it is a 5i25. Attached is the mesaflash readhmid output.

How should I change the [HMOT](CARD0).gpio.020.out ?
Would it be [HMOT](CARD0).pwm.020.out or something else?  I haven't been able to find docs for this.

Thanks again, Rick
Attachments:
Last edit: 31 Dec 2021 22:18 by llamatrails. Reason: clarify

Please Log in or Create an account to join the conversation.

More
31 Dec 2021 22:25 - 31 Dec 2021 22:28 #230418 by PCW
Replied by PCW on topic 7c81 and 2nd PWMgen problems
When you enable PWMgen 1 GPIO.020 is PWM output
and cannot be used as a general purpose output

Your hal file is trying to use GPIO.020 as a general; purpose
spindle enable output::

# --- SPINDLE-ENABLE ---
setp [HMOT](CARD0).gpio.020.is_output true
net spindle-enable => [HMOT](CARD0).gpio.020.out

But this conflicts with GPIO.020's use as a PWM output.
(if PWM 1 is enabled in the hal file)

The 7C81 has different GPIO pin mappings than a
5I25 so as I said you need to see what GPIO connects
to which DB25 pins and chose appropriate GPIO
numbers

PWM 0 has no issues because you are using GPIO.007 for spindle
enable and GPIO.007 (DB-25 pin 17) is not used for anything other
than GPIO.

If you wanted to use the same DB25 pin for the second spindle enable,
you would use GPIO.026 which is DB25 pin 17 on P2
Last edit: 31 Dec 2021 22:28 by PCW.

Please Log in or Create an account to join the conversation.

More
31 Dec 2021 23:15 #230421 by llamatrails
Thanks again, Happy New Year !

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.089 seconds
Powered by Kunena Forum