Re: [Machinekit] C instantiable components and hal_pru_generic

2020-04-30 Thread John Allwine
I'm not convinced of that. Since the register table is fully allocated it 
would likely require swapping registers out to scratch pads and assigning 
pin numbers that are larger than a byte (this would significantly affect 
the SET_CLR_BIT and PINTABLE implementation) and at the very least adding 
twice as many memory writes. I don't fully understand the ramifications of 
making some of those changes, but it would certainly have a performance 
penalty by writing to more registers, even if it is easy to implement. I'm 
concerned with performance, so any modifications that slow down 
hal_pru_generic I'd like to avoid. I'm trying to reach high step 
frequencies with 5 different axes. I'm hoping to achieve them with 
hal_pru_generic, so I'm thinking of even adding build macros so 
hal_pru_generic could have access to PRU code that doesn't perform any 
memory writes (but rather uses only direct outputs). I'm still testing 
what's feasible, but being able to divide up that work between different 
PRUs could also be key, so I like the idea of hal_pru_generic being 
instantiable. 

On Thursday, April 30, 2020 at 3:28:51 PM UTC-6, Charles Steinkuehler wrote:
>
> I think it would be easier to extend the existing logic to simply write 
> to more registers, but an icomp version of hal_pru_generic could still 
> be helpful.  With four PRU cores in the BBAI, I can definitely see the 
> benefit to having more than one PRU running either to divide the work or 
> to allow the PRUs to run with different cycle times. 
>
> On 4/29/2020 10:13 PM, John Allwine wrote: 
> > Is there documentation on how to write an instantiable HAL component in 
> C? I’ve been making modifications to hal_pru_generic to work on the 
> BeagleBone AI. hal_pru_generic is implemented in such a way that only 4 
> GPIO ports can be used. The BBB only has 4 GPIO ports, so any pin on the P8 
> and P9 headers can be used on a single instance of hal_pru_generic. The 
> BeagleBone AI has 8 GPIO ports, so without significant changes to 
> hal_pru_generic, not all pins on the P8 and P9 headers can be accessed from 
> a single instance. The BeagleBone AI does expose many more pins as direct 
> outputs, but I’m unable to instantiate more than one instance of 
> hal_pru_generic in order to take advantage of certain pin configurations. 
> Is it possible to make hal_pru_generic instantiable? 
> > 
>
> -- 
> Charles Steinkuehler 
> cha...@steinkuehler.net  
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/50289540-1f4a-4903-912d-a9c27aed7839%40googlegroups.com.


Re: [Machinekit] C instantiable components and hal_pru_generic

2020-04-30 Thread Charles Steinkuehler
I think it would be easier to extend the existing logic to simply write 
to more registers, but an icomp version of hal_pru_generic could still 
be helpful.  With four PRU cores in the BBAI, I can definitely see the 
benefit to having more than one PRU running either to divide the work or 
to allow the PRUs to run with different cycle times.


On 4/29/2020 10:13 PM, John Allwine wrote:

Is there documentation on how to write an instantiable HAL component in C? I’ve 
been making modifications to hal_pru_generic to work on the BeagleBone AI. 
hal_pru_generic is implemented in such a way that only 4 GPIO ports can be 
used. The BBB only has 4 GPIO ports, so any pin on the P8 and P9 headers can be 
used on a single instance of hal_pru_generic. The BeagleBone AI has 8 GPIO 
ports, so without significant changes to hal_pru_generic, not all pins on the 
P8 and P9 headers can be accessed from a single instance. The BeagleBone AI 
does expose many more pins as direct outputs, but I’m unable to instantiate 
more than one instance of hal_pru_generic in order to take advantage of certain 
pin configurations. Is it possible to make hal_pru_generic instantiable?



--
Charles Steinkuehler
char...@steinkuehler.net

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/06fff1e3-924b-73a7-9d12-676f3f023330%40steinkuehler.net.


RE: [Machinekit] C instantiable components and hal_pru_generic

2020-04-30 Thread bas
That was pretty silly,
Here it is: 
https://github.com/machinekit/machinekit-hal/tree/master/src/hal/icomp-example

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/001601d61ef3%240ac4bc80%24204e3580%24%40basdebruijn.com.


RE: [Machinekit] C instantiable components and hal_pru_generic

2020-04-30 Thread John Allwine
Thanks Bas, but I don’t think your link came through!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/f2529915-8c70-42ea-8e77-2fa79a6c9009%40googlegroups.com.


RE: [Machinekit] C instantiable components and hal_pru_generic

2020-04-30 Thread bas
Hi John,

This is the best place I can find.

Bas

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/00d001d61eec%24773c6450%2465b52cf0%24%40basdebruijn.com.