Hi all! i am working on a project where i need to control an external ADC chip with an unusual SPI interface. in other risks (and other compilers) i did this with inline assembly succesfully. With UV2 it seems not to work so well...NOT AT ALL ACTUALLY! I suppose it is my fault, but i decided to create a library file for this purpose, as a driver for the ADC. there is only one simple function to implement , which refreshes the ADC with new value.i prefer to use assembly language for this purpose. i have written the asm code and the ADC.A51 file is ready and assembled succesfully. now i need some help on how to turn this into a library...actually i need a detailed description cause i seem to have trouble with basics.i use the output options to tell UV2 to turn my file into a lib file , and so it does.but i guess i need some init code to include in my asm file and a header file. so questions: 1.what else do i need to include/declare in my asm file so that the file is ready to be used for library? 2. how to create a header file? ............IN OTHER WORDS I NEED A STEP BY STEP TUTORIAL on how to create a lib (from my asm subroutine) FROM SCRATCH! thanx in advance Alex
would it be easier if you gave me an example file for lib and header? there is tons of examples right here at the Keil site and the below, actually, is an extract from a .h file. #define SWSPI_PORT 0x20 // soft-SPI port address #define CLK 0 //clock pin number #define SDI 1 // SDI (data) pin number which would tell the compiler that the library function when refering to CLK , means P1.0,SDI means P1.1 That works, but require "presence at compile time" which you can not have for a library. Erik