193Re: [kminternals] KH-950i - interfacing - Anyone?
- Apr 6, 2012Ok. Progress made overnight.I've made some guesses at the 930 and seem to have come up with a winner (http://www.flickr.com/photos/kentfield/6904212212/)I'm assumed that the 930 only has 2K of internal memory, mapped 0x0000 to 0x07FF, as per Steve's document (https://github.com/adafruit/knitting_machine/blob/master/docs/file-data.txt#L324). This I've assumed produces 2 files when run on the PDDemulator, 00.dat and 01.dat. The emulator then concatenates these two files as file-01.dat as Becky kindly pointed out I'd missed in the documentation.The 950i behave differently. I get 32 files: 00.dat through 31.dat, which the PDDemulator bunches up as file-01.dat through file-16.dat.file-01.dat looks like Steve's document starts - with the 'catalogue' of pattens, and file-16.dat ends with the 'config' at the end of Steve's document - the current machine state I believe.So the 950i therefore has 32K of memory, 0x0000 through 0x7FFF, with the config block starting at 0x76E0, and the pattern data back filling from 0x76DF.So Ideally I need a change to the PDDemulator.py script which can take a flag saying we're talking to the 950i and create a 32K large memory image. I don't know yet if the insertpattern.py script will accept a large file like this as input - we'll see I guess! The the splitfile2track.py script will need to be able to split out a 32K image to 16 2K files - no idea yet if it will do that, time to find out I guess.I don't know a lot of Python - I do C, but I'll take a look, unless anyone jumps in and offers....Some of the bytes in the 'config' area (0x06e0 to 0x07ff on the 930) which Steve says are always the same are different on the 950i - I'd guess at least one of these says which machine this is, and maybe we could work the tools to autodetect this from the file if we can work this out.I get to play with my Aunt's KH-970i next weekend, maybe I can learn some more from this, and also a PPD pattern programming device, which should be able to create a disk image for each of the machines in theory, so perhaps can learn more from this.I'll keep you updated.KevinOn 5 April 2012 21:34, Kevin Blain <kevin.blain@...> wrote:Cool, thanks.Yeah, I'd clearly missed that, but deduced it from what I saw.When we try to knit the pattern we create, we get a blank pattern out. I think the 950i stores everything in a slightly different format to the 930, so I guess I'm testing the water here to find out if I'm going over new ground... If so I'll dive in!How many nn.dat files do you get, and how many file-nn.dat flies? We're getting file-01.dat through 16 or 'track1' from the machine, 17-32 for track2 and 00.dat to 31.dat as track 1 and 32.dat through 63.dat as track 2, but we also get 64.dat through 79.datThe latter group seem blank, but those in file-16.dat seem to contain 0x06e0 to 0x07ff data containing the machine setup data - though with differences to Steve's document.Worth me detailing it then?Kevin
On 5 Apr 2012, at 20:47, Becky Stern <becky.stern@...> wrote:
I can't help with 950-specific info, but the "file-01.dat" thing is documented in the tutorial on adafruit:
http://ladyada.net/learn/electroknit/backup.html (last part) &
It's a file that contains all the patterns, and it's made by the emulator, not the knitting machine. Hope that helps a little!
BeckyOn Thu, Apr 5, 2012 at 3:06 PM, Kevin <k.blain@...> wrote:
Let me introduce myself briefly, I'm an embedded electronic engineer by trade, with a girlfriend who has a knitting passion and now a KH950i.
So I've been playing with the excellent work by Becky, Steve, John, and others to try and get the thing to talk to me.
Where I'm at:
Reading and Writing disk images to the laptop seems to be going without much pain, the PDDemulate python script seems to do its job just fine.
Has anyone actually got it working properly with the 950i?
So far, there seems to be differences in the file contents to what I've been reading on the net, which is mostly 930 based information.
For example, the stucture of the 00.dat file looks like it follows the structure mentioned here: https://github.com/adafruit/knitting_machine/blob/master/docs/file-data.txt#L324 but moving on through the doc, where it looks at addresses 0x06e0 onwards, I don't see this, tough I see similar data in the 63.dat file
I also note that as well as having 00.dat and 01.dat, the contents of the two together appear in file-01.dat - this doesn't seem to be documented anywhere, is this unique to the 950i or has this info just missed documenting up till now?
- << Previous post in topic Next post in topic >>