ultra Posted May 7, 2008 Report Share Posted May 7, 2008 perhaps this should be in the "assembler" category, but i really know nothing about that language and i'm hoping for a c related response. also the application i'm writing for my control surface will be in c.i want to use two cores together with mbnet for my control surface application. basically, i just want simple communication for this purpose:core 1 tells core 2 what layer it's on, so core 2 can change states appropriately.core 2 tells core 1 what knob/switch has been changed, so core 1 can send out the commands on that interface.are there any programming examples out there? i've searched the forum and ucapps and i haven't come up with anything. i've also tried looking at the sidv2 software but it's a bit beyond my understanding. is mbnet considered to be just for advanced programmers, or is it just that not many have used it so there isn't much information out there yet? any help at all on how to get started with this would be much appreciated!ultra Quote Link to comment Share on other sites More sharing options...
ilmenator Posted May 7, 2008 Report Share Posted May 7, 2008 I think mbnet is rather new - AFAIK it's only been used in the SIDv2 until now. But actually I see lots of applications. Once I get around re-designing the MB UC I could use it there, too. It's very attractive to have a return-channel (as opposed to the MIDI chain solution).Sorry I can't be of more help than just manifesting my interest in a C interface :-\.Best regards, ilmenator Quote Link to comment Share on other sites More sharing options...
stryd_one Posted May 7, 2008 Report Share Posted May 7, 2008 perhaps this should be in the "assembler" category, but i really know nothing about that language and i'm hoping for a c related response. also the application i'm writing for my control surface will be in c.I would very much like to have a C-wrapped ASM CAN implementation, but there isn't one yet. It's also quite possible to make a performant library written in native C, but... Why bother when the ASM is already done :)core 1 tells core 2 what layer it's oncore 2 tells core 1 what knob/switch has been changedTotally doable. I guess you've already seen the MIDIbox Network page? You may have noticed that it's a master/slave arrangement, so you should keep that in mind. Instead of a X tells Y: 'A' ... Y tells X: 'B'it's more of a:X tells Y: 'A', and asks about stuff, and then Y replies: 'B'You could do this by reading RAM from the slave after writing some...or you could implement your own extension to the MBNet protocol by using the special TOS flags 16...127, where your master can send a payload (bank), and request a payload in response (which button's pushed) ... or you could use a multi-master environment where each core takes turns being the master.... Each has it's benefits and drawbacks.As illy mentioned, the only example in use right now is SIDv2, so I can understand why it's not sinking in right away! Is there anything in particular you want to know? The whole story is a bit long heh. Have you scoped the wikipedia article on CAN and the philips datasheet on it? It helps a lot to understand how CAN itself works. A lot of the hard work is taken care of by the protocol itself (and the hardware support for it in the 4685). You might also find Microchip Appnotes AN738 © and AN853 (ASM) interesting, although keep in mind that they are intended for a different architecture so they may just confuse matters... But maybe they'll help show how the registers are used. Reading the 4685 datasheet is an absolute must, you'll need to get to know what the registers are. If you can memorise them all in less than a few weeks, you're a bigger geek than I :) Once you've done that, have a look at the mbnet.inc file and it might make a bit of sense ...Uhm...what else? Quote Link to comment Share on other sites More sharing options...
zaboomafoo Posted May 9, 2008 Report Share Posted May 9, 2008 You could do this by reading RAM from the slave after writing some...or you could implement your own extension to the MBNet protocol by using the special TOS flags 16...127, where your master can send a payload (bank), and request a payload in response (which button's pushed) ... or you could use a multi-master environment where each core takes turns being the master.... Each has it's benefits and drawbacks.I would like to use MBNet for my control surface. Simple messaging, same as the original poster. Any simple examples (C or assembler) would be much appreciated.Regards,Frank Quote Link to comment Share on other sites More sharing options...
zaboomafoo Posted May 12, 2008 Report Share Posted May 12, 2008 this might help:http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1999&ty=&dty=§ion=&NextRow=&ssUserText=an878AN878 has a complete C library of functions for handling CAN. I don't have midibox hardware to try it. Did somebody tried that?Regards,Frank Quote Link to comment Share on other sites More sharing options...
stryd_one Posted May 12, 2008 Report Share Posted May 12, 2008 Hi Frank, that's similar to the appnotes I posted above (wonder why yours wasn't in the search I ran?). It's actually more appropriate as it's for ECAN not CAN, so thankyou!As with those other appnotes, that's a different thing to MBNet though, so it would only really be useful for learning what the registers do. Quote Link to comment Share on other sites More sharing options...
ultra Posted May 13, 2008 Author Report Share Posted May 13, 2008 thanks. i'm so new to c that i'm probably not going to bother with it. although this information is probably useful to anybody searching on this :).i got mblink to work right and it should serve my purposes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.