#linuxcnc-devel | Logs for 2016-09-12

Back
[05:06:26] -linuxcnc-github:#linuxcnc-devel- [13linuxcnc] 15nicokid commented on issue #161: I changed the code so as to retain the original background color and change it to red only if an error occurs. I think a more efficient way.... 02https://github.com/LinuxCNC/linuxcnc/pull/161#issuecomment-246297554
[05:19:17] -linuxcnc-github:#linuxcnc-devel- [13linuxcnc] 15nicokid commented on issue #161: I forgot to add the style. Sorry I still little familiarity with git.... 02https://github.com/LinuxCNC/linuxcnc/pull/161#issuecomment-246300506
[10:03:18] <cradek> jmkasunich: https://www.jwz.org/blog/2016/09/physical-pong/
[10:03:24] <cradek> jmkasunich: reminds me of your projects
[12:07:43] <jepler> static int wait_for_xfer(struct s3c64xx_spi_driver_data *sdd,
[12:07:43] <jepler> struct spi_transfer *xfer, int dma_mode)
[12:07:43] <jepler> {
[12:07:48] <jepler> /* millisecs to xfer 'len' bytes @ 'cur_speed' */
[12:07:48] <jepler> ms = xfer->len * 8 * 2000 / sdd->cur_speed;
[12:07:48] <jepler> ms += 10; /* some tolerance */
[12:07:58] <jepler> hm selecting timeouts using a millisecond scale probably isn't the greatest idea
[12:09:13] <cradek> and add 10ms for good measure
[12:10:57] <cradek> http://i1.kym-cdn.com/photos/images/newsfeed/000/234/765/b7e.jpg
[12:11:09] <jepler> cpu_relax();
[12:16:53] <skunkworks> cpu_chillax();
[12:18:43] <pcw_home> why is it waiting at all? I can see waiting for a SPI register bit or interrupt or memory flag for DMA completion but time?
[12:19:31] <jepler> if (dma_mode) {
[12:19:31] <jepler> val = msecs_to_jiffies(ms) + 10;
[12:19:32] <jepler> val = wait_for_completion_timeout(&sdd->xfer_completion, val);
[12:19:36] <jepler> the value is an upper bound to wait for dma
[12:19:52] <jepler> or, in another branch, for the fifo to empty
[12:20:41] <pcw_home> So its a timeout while polling the actual DMA done status?
[12:20:46] <jepler> yes I think so
[12:26:04] <pcw_home> looks like 2X the transfer time +10 ms is the timeout. Wonder if DMA can actually be held up that long
[12:26:44] <jepler> I am not hitting any 10ms timeouts in practice
[12:26:55] <jepler> I don't think, anyway
[12:27:21] <jepler> I'm more interested in why the typical case is 500us spent per servo period reading & writing
[12:27:41] <jepler> I should hook up the other device I have with spi (u3) and check its servo numbers
[12:27:55] <jepler> maybe I'm mistaken about the performance I got, a year or two ago..
[12:27:56] <pcw_home> what SPI clock speed are you using?
[12:28:02] <jepler> 24MHz if the setting is right
[12:28:30] <jepler> checking that the speed is right would be another excellent idea
[12:28:54] <cradek> we should be able to tell from that scope photo, if we could find the url again
[12:29:07] <pcw_home> if its 24 Mhz I might expect 200 or so usec if its even reasonably efficient
[12:29:13] <jepler> https://goo.gl/photos/E6bVh6GDFtv3Vjfm8 except I had the speed turned way down for testing purposes
[12:29:21] <pcw_home> scope was 4 MHz
[12:29:53] <jepler> scope's frequency measurement said 1MHz
[12:29:58] <pcw_home> or 1 Mhz
[12:30:12] <jepler> I don't know for sure what rate I had specified (in mesaflash) at that point, but 1MHz is possible
[12:30:27] <jepler> afk for lunch
[13:44:07] <jepler> looks like I have an SV11 configuration, packet sizes 76 and 136 bytes if I'm interpreting strace right
[13:45:42] <jepler> that would all take 70us if it was perfectly fast
[14:16:37] <pcw_mesa> wonder where the time goes?
[14:19:13] <jepler> me too!
[14:19:24] <jepler> but wondering where the time goes is practically a human condition, soooo
[14:31:05] <jepler> pcw_mesa: I saw the 7i92m mentioned on irc a few days ago. is it any different from the 7i90 from linuxcnc's point of view?
[14:35:50] <pcw_mesa> 7I92M is a 7I92 (Ethernet 2X parallel port) with a male DB25 as it main I/O connectior (so can be plugged directly to breakouts with female DB25s or drives like the MX3660)
[14:38:13] <jepler> ah now the "M" becomes clear, I hadn't figured it out yet
[14:41:51] <pcw_mesa> also have a 7I93 which is sort of a Ethernet 7I43 (just 2 50 pin connectors)
[14:43:18] <pcw_mesa> I did make a 7I91 (Cubieboard mechanical SPI interfaced card) but didn't make it a product
[14:47:58] <jepler> this time around I just made a little adapter board from the PI-style 40-pin connector to your 26-pin SPI connector
[15:04:07] <pcw_mesa> wasn't someone working on a a RasPi SPI interface FPGA thing (hmm maybe brand M)
[15:04:20] <jepler> yes, we have hm2_rpspi in master branch too
[15:04:36] <jepler> the odroid xu4's level shifting daughterboard puts the SPI pins in the same location as the pi
[15:05:42] <pcw_mesa> does hm2_rpspi have a bare metal driver?
[15:05:48] <jepler> yes
[15:05:59] <jepler> it memory maps the SPI registers and pokes at them
[15:06:05] <jepler> that's why it didn't re-use the existing hm2_spi code
[15:06:49] <pcw_mesa> seems like it could except for the very lowest level
[15:08:56] <jepler> I am tempted to agree, and if I decide to do a register-level spi driver for xu4 I'll sure be looking into unifying what would otherwise be 3 separate implementations of "the spi part"
[15:09:31] <jepler> otoh, hm2_rpspi.c is just 2.7% of the total (wc -l) lines in mesa-hostmot2 so maybe it's no big deal
[15:11:17] <jepler> https://www.metafilter.com/162218/Why-Flying-is-so-Expensive-SYTL-10-min-31-sec
[15:11:30] <jepler> er that's a good link but I meant to paste https://blog.heypete.com/2016/09/11/investigating-fake-max3232-ttl-to-rs-232-chips/
[15:20:54] * jepler gasps at the milling machine being used on irreplacable computer parts http://www.righto.com/2016/09/restoring-ycombinators-xerox-alto-day-6.html
[15:25:07] * pcw_mesa worries that mice teeth are milling at his (somewhat less) irreplaceable computer parts in the basement
[15:27:13] <cradek> jepler: that's just the extender
[15:28:51] <cradek> the comment is right: sector pulses every 3.33 microseconds would be > 1 million rpm
[15:30:49] <cradek> reminds me of debugging a heathkit H8 a few years ago - me with the schematic calling out chip and pin numbers, my friend with the logic probe
[15:31:05] <cradek> yes we got it to work - I think it turned out to be a bad chip too
[16:13:11] <jepler> you can have an experience like that today! http://rc2014.co.uk/
[16:14:40] <jepler> I think I mentioned this thing before -- it's the Z80 machine that you can hook a who Raspberry PI to, just to use the PI as a serial terminal..
[16:16:03] <jepler> a *whole*
[19:09:49] <kirk_wallace> In case anyone might be interested in my latest G76 documentation: http://www.wallacecompany.com/t_tmp/G76_doc/G76.html
[19:10:20] <kirk_wallace> The second half is still pretty rough.