Hi William/Matt, If you're targetting for multiple devices, it is probably easier to put it into the test directory, it requires some annotation but it is not that hard, see wiki for more details http://code.google.com/p/jallib/wiki/jallib_testing the jallib.py script can generate the sample file based on the test file(s) and the board file(s) Albert
----- Original Message ----- From: "William" <[email protected]> To: "jallib" <[email protected]> Sent: Tuesday, September 01, 2009 12:07 AM Subject: [jallib] Re: SPI Matt, I'm new to JALLIB, but from what I have understood, we should just use the 'samples' directory for testing. Perhaps others will chime in with additional suggestions. SPI is a protocol, not limited to, nor defined by Microchip. For example: http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus and http://elm-chan.org/docs/spi_e.html So, when I make a reference to SPI Master mode 0,0, it has to do with the polarity of the clock signal and the phase of the clock signal, with respect to the data. The different chip vendors, such as Motorola/Freescale and Microchip, have different naming conventions which adds to my confusion. But basically there are 4 possible combinations and there seems to be consistency that the left-most number is the polarity and the right-most is the phase. Since the library itself is so small, perhaps you can just paste your proposed changes here and then I can merge them into SVN, would that be OK for now? If the main thing that is bugging you is the _init routine, I can just remove it completely for now, and put that code into my samples for CAN. Thank you, William On Aug 31, 3:16pm, mattschinkel <[email protected]> wrote: > May I open a new project in the project dir on SVN for this? Where can > we store our files so we can both edit them? > I would like to edit your lib, make an example file and show you the > result so you can edit or give your feedback. > > > I look forward to working with you to make this library better. > > great! > > > > > And I may be off in the weeds, but the file I checked in, was intended > > to be for picmicros that have a built-in SPI controller, and further, > > for use in Master mode. So, the register definitions are defined by > > the chip, for example 16f819.jal. > > Yes, this should be for only pics with built-in SPI, and only for > master mode, later on we can make a seperate spi_master_sw lib > > > Now, if you are considering other flavors of picmicro, which have > > built-in SPI hardware, but have different register definitions, then > > we need to deal with that somehow. I'd rather have separate SPI > > Master library files, than a single file that is complicated and hard > > to understand and maintain. > > I have tested it on 16F877, but I would also like it to work on 18F452 > as well as others in the future. What chips did you test on? > I think we could have only one lib file with many example files for > each chip, like there are with other libs/examples. I have an idea for > this using ALIAS > > > My thought was that SPI is (potentially) complicated, and that end- > > users would need to provide their own 'init' routine. I didn't have > > the time or resources to fully test all of the various ways that SPI > > can be used in Master mode, so I wrote a 'quick and dirty' 'init' > > routine (note the leading underscore in the name). > > The user can define those registers without an init routine, since the > user MUST define them, they should go in the example file. I think we > can test different master modes and note which ones have been tested > within the lib or example file, what do you think? Also, each chip may > have different types of "master modes". > > Matt. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jallib?hl=en -~----------~----~----~----~------~----~------~--~---
