Shadyman has joined #beagle
mattb00ne has joined #beagle
<mattb00ne> heyoooooeeee
<mattb00ne> question for the zmatt how can set the LD compare from a PRU program
<mattb00ne> need to drive the motors from the PRU, I am looking in the header files in the project but not sure how to find what I am looking for.
<zmatt> yeah my python code uses different names for registers since the official ones generally look like someone hit their keyboard with their fists
<zmatt> are you referring to eCAP or eHRPWM ? (and if eCAP, the one in pruss or a different one?)
<zmatt> assuming the peripheral is setup properly from python and you just want to change the pwm values, the simplest way is to just use some macros for the individual registers: https://pastebin.com/VnPg6kMR
<mattb00ne> hmmm
<mattb00ne> ok
<mattb00ne> Pwmss( "/dev/uio/pwmss1" ).pwm that is the eHRPWM right
<mattb00ne> that is what I init and I control speed by changing the LD compare
<zmatt> I've included macros to query the configured period, though be aware that reading peripheral registers, especially outside pruss, is relatively slow so it may be more appropriate to hardcode the period (especially since being flexible about it would probably require division, which you really want to avoid on pru)
<zmatt> that's epwm1 yes (or ehrpwm1, though the "hr" part is never actually used and currently not supported by py-uio)
<zmatt> with these macros you can simply assign a value to EPWM1A or EPWM1B
<mattb00ne> great that is what I am looking for
starblue has quit [Ping timeout: 265 seconds]
starblue has joined #beagle
thinkfat has joined #beagle
thinkfat_ has quit [Ping timeout: 260 seconds]
lucas_ has joined #beagle
lucascastro has quit [Ping timeout: 260 seconds]
akaWolf has quit [Ping timeout: 265 seconds]
sts-q has quit [Ping timeout: 252 seconds]
lucas__ has joined #beagle
lucas_ has quit [Ping timeout: 265 seconds]
thinkfat has quit [Read error: Connection reset by peer]
vagrantc has quit [Quit: leaving]
ikarso has quit [Quit: Connection closed for inactivity]
akaWolf has joined #beagle
mattb00ne has quit [Quit: Client closed]
buzzmarshall has quit [Quit: Konversation terminated!]
otisolsen70 has joined #beagle
<johanhenselmans> Hello, I am trying to set P9.21 to GPIO and enable the pin. So I did “config-pin P9.21 gpio”. According to docs, that should be gpio3. But if I look in /sys/class/gpio, there is no gpio3. (Linux 5.10.65-ti-r24). zmatt’s bbb-pin-utils show-pins shows “P9.21 / spi boot in 85 fast rx 7 gpio 0.03 ocp/P9_21_pinmux (pinmux_P9_21_gpio_pin)”. Any ideas what I am doing wrong?
CrazyEddy has quit [Ping timeout: 264 seconds]
giort has joined #beagle
giort has quit [Quit: giort]
<zmatt> pins default to gpio, you don't need to config-pin them (and in fact avoid mode "gpio" unless you know what you're doing since it (annoyingly) means "gpio with internal pull-up/down disabled")
<zmatt> you're running a kernel which is not yet officially supported, my guess would be the gpio-of-helper driver (which is what's normally responsible for exporting gpios to sysfs based on DT configuration) hasn't been forward-ported yet
sts-q has joined #beagle
Shadyman has quit [Remote host closed the connection]
vd has quit [Quit: Client closed]
vd has joined #beagle
otisolsen70 has quit [Quit: Leaving]
<rcn-ee> zmatt, weird, r24 has all the gun gpio stuff forward ported...
johanhenselmans has quit [Quit: johanhenselmans]
<zmatt> ok maybe my guess is wrong then
florian has quit [Quit: Ex-Chat]
<zmatt> not enough info and he left so *shrug*
argonautx has joined #beagle
vagrantc has joined #beagle
buzzmarshall has joined #beagle
johanhenselmans has joined #beagle
ikarso has joined #beagle
giort has joined #beagle
giort has quit [Client Quit]
ikarso has quit [Quit: Connection closed for inactivity]
argonautx has quit [Quit: Leaving]
vagrantc has quit [Quit: leaving]
CrazyEddy has joined #beagle
otisolsen70 has joined #beagle
mattb00ne has joined #beagle
<mattb00ne> zmatt: I am doing something wrong here my python: https://pastebin.com/6itVmpyh and my c code https://pastebin.com/KsAJFsEJ
<mattb00ne> confirmed wiring is good
<mattb00ne> and if I manually spin the encoder is working so it is not hardware related but the motor is not spinning with my use of those macros
<zmatt> your period is round(100e6 / 1 / 10000), which is 10000, not 100
<zmatt> (you calculate the period at line 39 of the python script)
<zmatt> also the period is unsigned 16-bit (uint16_t), not signed 32-bit (int32_t)
vd has quit [Quit: Ping timeout (120 seconds)]
<zmatt> does assigning an int32_t to EPWM1A, which is an uint16_t, not produce a compiler warning? it should
vd has joined #beagle
zjason has quit [Read error: Connection reset by peer]
<mattb00ne> no error
<mattb00ne> let me fix that that period calculation
zjason has joined #beagle
<mattb00ne> lol zjason
<mattb00ne> side note going through a switch should let me have internet access and ssh to the beaglebone right? currently I can only do one or the other.
<mattb00ne> brb
<zmatt> I mean, accessing both is a simple matter of being connected to both
<zmatt> and yeah weird, clpru seems to issue no error or warning for narrowing integer conversions, not even with "non-serious warnings" enabled (--issue_remarks)
<zmatt> annoying
mattb00ne has quit [Ping timeout: 256 seconds]
mattb00ne has joined #beagle
<mattb00ne> that worked
<mattb00ne> that worked
<mattb00ne> scared myself silly
<mattb00ne> period is full blast
<mattb00ne> lol
otisolsen70 has quit [Quit: Leaving]
lucascastro has joined #beagle
lucas__ has quit [Ping timeout: 260 seconds]
johanhenselmans has quit [Quit: johanhenselmans]
rcn-ee has quit [Remote host closed the connection]
rcn-ee has joined #beagle
<GenTooMan> has TI changed it's PRU support with new processors?
troth has quit [Ping timeout: 260 seconds]
<zmatt> GenTooMan: what do you mean?
vd has quit [Ping timeout: 256 seconds]
vd has joined #beagle
troth has joined #beagle