lemonhorse Posted January 14, 2008 Report Share Posted January 14, 2008 Hi *!I want to get on with my MIDIBOX skills - someday I hope to find a way for Interfacing the AY-3-8912 Soundchip via MBHP, MIOS and Assembler. => http://en.wikipedia.org/wiki/AY-3-8912 My "MidiBox AY" (prototype) [just a MidiBoxKB and an MIDImon with no AY-3-8912 interface yet]related => http://www.midibox.org/dokuwiki/doku.php?id=midiboxkb_-_using_a_c64_keyboard_as_inputrelated => http://www.midibox.org/dokuwiki/midibox_pokeyI never did programming in Assembler yet. But I want to! :)So I'm thrilled to explore the PIC 18F452, Assembler and MIOS - step by step.Here my first beginner question:-----------------------------------------------------------------------------THE MIOS MEMORY MAPIs this sketch ok? Quote Link to comment Share on other sites More sharing options...
TK. Posted January 15, 2008 Report Share Posted January 15, 2008 Thats a good starting point! :)Note that 0x000..0x002 is reserved for MIOS internal variables, and 0x03..0x0f is allocated by MIOS_PARAMETER[123], TMP[12345] and IRQ_TMP[12345]So, free application space starts at 0x010Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 16, 2008 Author Report Share Posted January 16, 2008 Thank You Thorsten! :) Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 16, 2008 Author Report Share Posted January 16, 2008 MIOS is a text adventure yes, it is! ;)next step: exploring the application-code... MIOS - the MIDIbox Operating System [http://www.ucapps.de/mios_download.html]=> skeleton_v1_9...my speculations about mios.h ;; ========================================================================== ;; MIOS Special Function Registers ;; ========================================================================== MIOS_BOX_CFG0 EQU 0x000 MIOS_BOX_CFG1 EQU 0x001 MIOS_BOX_STAT EQU 0x002 MIOS_PARAMETER1 EQU 0x003 MIOS_PARAMETER2 EQU 0x004 MIOS_PARAMETER3 EQU 0x005 ;; ========================================================================== ;; temporary registers for main programs ;; ========================================================================== TMP1 EQU 0x006 TMP2 EQU 0x007 TMP3 EQU 0x008 TMP4 EQU 0x009 TMP5 EQU 0x00a ;; ========================================================================== ;; temporary registers for IRQs ;; ========================================================================== IRQ_TMP1 EQU 0x00b IRQ_TMP2 EQU 0x00c IRQ_TMP3 EQU 0x00d IRQ_TMP4 EQU 0x00e IRQ_TMP5 EQU 0x00f ;; ========================================================================== ;; free memory space for user application: ;; ========================================================================== ;; 0x010-0x37f no problem so far... ;; ========================================================================== ;; General constants ;; ========================================================================== ;; used by MIOS_MIDI_Interface* MIOS_MIDI_INTERFACE_COMMON EQU 0x00 MIOS_MIDI_INTERFACE_TO_HOST EQU 0x01 ;; used by MIOS_MIDI_Merger* MIOS_MIDI_MERGER_DISABLED EQU 0x00 MIOS_MIDI_MERGER_ENABLED EQU 0x01 MIOS_MIDI_MERGER_MBLINK_EP EQU 0x02 MIOS_MIDI_MERGER_MBLINK_FP EQU 0x03 ;; used by MIOS_ENC_PIN_TABLE MIOS_ENC_MODE_NON_DETENTED EQU 0x00 MIOS_ENC_MODE_DETENTED EQU 0x80 MIOS_ENC_MODE_DETENTED2 EQU 0x81 ;; used by MIOS_ENC_Speed* MIOS_ENC_SPEED_SLOW EQU 0 MIOS_ENC_SPEED_NORMAL EQU 1 MIOS_ENC_SPEED_FAST EQU 2 ;; used by MIOS_LCD_Type* MIOS_LCD_TYPE_CLCD EQU 0x00 MIOS_LCD_TYPE_GLCD0 EQU 0x01 MIOS_LCD_TYPE_GLCD1 EQU 0x02 MIOS_LCD_TYPE_GLCD2 EQU 0x03 MIOS_LCD_TYPE_GLCD3 EQU 0x04 MIOS_LCD_TYPE_GLCD4 EQU 0x05 MIOS_LCD_TYPE_MLCD EQU 0x06 MIOS_LCD_TYPE_GLCD_CUSTOM EQU 0x07 but...MIOS_MIDI_INTERFACE_COMMON EQU 0x00 => [Location: ?]MIOS_ENC_MODE_DETENTED EQU 0x80 => [Location: ?]MIOS_ENC_MODE_DETENTED2 EQU 0x81 => [Location: ?]MIOS_ENC_SPEED_SLOW EQU 0 => [Location: ?... ]MIOS_GLCD_FONT EQU 0x7cfc => [Location: ?... ]speculations ::) :MIOS_BOX_CFG0 EQU 0x000 is a DATA RAM address assignment - right?Is MIOS_ENC_SPEED_SLOW EQU 0 and MIOS_ENC_MODE_DETENTED2 EQU 0x81 a DATA RAM byte-content assignment? [somewhere within the MIOS DATA RAM area?]Is MIOS_GLCD_FONT EQU 0x7cfc a PROGRAM MEMORY address assignment? Quote Link to comment Share on other sites More sharing options...
TK. Posted January 16, 2008 Report Share Posted January 16, 2008 In general it has to be considered, that constant definitions (EQU) can either be addresses or just values which are used for different purposes. The assembler doesn't make a difference here.In distance to "#define", which you will also find sometimes in my applications, an EQU statement makes the definition public over the whole code. The assembler will replace the name by the constant definition during a second pass. A #define statement works only "below" the statement - therefore I'm only using it when I'm sure that it is defined early enough (inconsistently)MIOS_BOX_CFG0: yes, an address in data RAMMIOS_ENC_SPEED*: these are values which are used in mios_tables.inc (encoder speed modes)MIOS_GLCD_FONT: yes, thats an address in program memoryBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 18, 2008 Author Report Share Posted January 18, 2008 Sorry TK,I don't want to steal your precious time with basic assembler-questions ;)So perhaps I should read this first:MPASM Assembler Overview: MPASM™ Assembler, MPLINK™ Object Linker, MPLIB™ Object Librarian User’s Guidehttp://ww1.microchip.com/downloads/en/DeviceDoc/33014J.pdfPIC18FXX2 - Data Sheet:http://ww1.microchip.com/downloads/en/DeviceDoc/39564c.pdfAre there other usefull resources in this context ?Best Regards,- Lemonhorse Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 21, 2008 Author Report Share Posted January 21, 2008 TK:MIOS & Applications Re-Released for GPUTILS« on: 20.01.2008 at 16:33 »In order to get rid of the windows propritary MPASM assembler, I started to migrate MIOS and most of the applications to the GPUTILS toolchain. This freeware is available for all major operating systems (including Windows/Linux/Mac OS), and therefore should allow everbody to customize and rebuild an application without Windows installation.[...] http://www.midibox.org/forum/index.php/topic,10552.msg80333.html#msg80333He he - I'll never will keep step with You TK! ;)I'm absolutely happy about the GPUTILS adoption - because now I can carry out my MIOS experiments on Linux! :D But - is there a chance that:http://www.ucapps.de/mios/sm_example1_v2.zip +http://www.ucapps.de/mios/sm_example2_v1.zipwill be merged to GPUTILS compatibility? (now the code is just MPASM compatible right?) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted January 21, 2008 Report Share Posted January 21, 2008 If TK's scripts don't convert those with ease, I will help you to do it manually... it's not so hard, just a bit of search'n'replace (kinda) :) Quote Link to comment Share on other sites More sharing options...
TK. Posted January 21, 2008 Report Share Posted January 21, 2008 You don't need to do this, Stryd - I'm planning an official re-release of these applications as well - very soon (not today, as I got too many emails due to other issues... :-/)Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
TK. Posted January 21, 2008 Report Share Posted January 21, 2008 Ok, conversion for these particular applications already done:http://www.ucapps.de/mios/sm_example1_v2a.ziphttp://www.ucapps.de/mios/sm_example2_v1a.zipBest Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 22, 2008 Author Report Share Posted January 22, 2008 ...Thanks Stryd!Ok, conversion for these particular applications already done:http://www.ucapps.de/mios/sm_example1_v2a.ziphttp://www.ucapps.de/mios/sm_example2_v1a.zipBest Regards, Thorsten.I just installed GPUTILS. sm_example1_v2a is up and running :)Thanks TK! 8) Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 23, 2008 Author Report Share Posted January 23, 2008 Note:gputils (0.13.2)James Bowman and Craig Franklin, May 5, 2005http://gputils.sourceforge.net/gputils.pdf Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 27, 2008 Author Report Share Posted January 27, 2008 Quote Link to comment Share on other sites More sharing options...
TK. Posted January 27, 2008 Report Share Posted January 27, 2008 The direct execution of "gpasm" is not recommented, instead just type "make" to process the Makefile.There are some applications, which got additional parameters in this file.Another point is, that I'm planning to change the file structure of applications soon (uniformed structure, hostet on a SVN server, include files like "mios.h" or "mios_vectors.inc" won't be located in the application main directory anymore)So, please wait a little bit with such docs, they will be expired once the update has been done.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 27, 2008 Author Report Share Posted January 27, 2008 sorry - do you want me to remove the picture to minimize the confusion TK? or sould i post a update of this diagram later on? (I just thought perhaps my MIOS notes are usefull for other MIOS asm newbies... ) Quote Link to comment Share on other sites More sharing options...
TK. Posted January 27, 2008 Report Share Posted January 27, 2008 Please update the diagrams later - they are great, and they are definitely useful for newbies! :)Best Regards, Thorsten.P.S.: I hope, that after the upcoming changes no additional changes have to be expected anymore Quote Link to comment Share on other sites More sharing options...
stryd_one Posted February 11, 2008 Report Share Posted February 11, 2008 (I just thought perhaps my MIOS notes are usefull for other MIOS asm newbies... )Definitely! thankyou! :) Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted February 15, 2008 Author Report Share Posted February 15, 2008 Another EXPLORATION SNAPSHOT (BASIC INTERNAL DATA FLOW, SYMBOLIC, DETAIL) A MIOS/asm detail map ;) (any errors, suggestion?...) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted February 15, 2008 Report Share Posted February 15, 2008 Thats perrty.As far as I can see, no errors.. I made a suggestion then realised it's already there :D Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted February 15, 2008 Author Report Share Posted February 15, 2008 ADD: [WREG]<---->[PC] ? Quote Link to comment Share on other sites More sharing options...
stryd_one Posted February 15, 2008 Report Share Posted February 15, 2008 I made a suggestion then realised it's already there :DAnd that makes it more obvious ;) Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted February 15, 2008 Author Report Share Posted February 15, 2008 thanks for ya feedback stryd_one! :)now that this is verified - i'm more anxious for new MIOS adventures :D Quote Link to comment Share on other sites More sharing options...
jimhenry Posted August 17, 2008 Report Share Posted August 17, 2008 To confirm, is this a good concise statement of the data RAM usage: ;; Data memory layout (Data RAM) ;; 0x000-0x00f reserved memory for MIOS ;; 0x010-0x37f free memory for user applications ;; 0x380-0x5ff reserved memory for MIOS ;; 0x600-0xf7f free memory for user applications on 18F4620 ;; 0xf80-0xfff special function registers (SFR) Quote Link to comment Share on other sites More sharing options...
TK. Posted August 19, 2008 Report Share Posted August 19, 2008 Yes, it's correct for PIC18F452 and PIC18F4620, but not for PIC18F4685, where 0x60..0x7f and 0xd00..0xf7f are reserved for the ECAN peripheral.Underhttp://svnmios.midibox.org/listing.php?repname=svn.mios&path=%2Ftrunk%2Fetc%2Flkr%2Fyou will find linker scripts which contain a complete list of available memory locationsThese scripts are automatically selected by the Makefile mechaisms when compiling C programs.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
lemonhorse Posted January 7, 2009 Author Report Share Posted January 7, 2009 // $Id: p18f452.lkr 298 2008-04-26 21:04:02Z stryd_one $// linker script for a MIOS project: ... CODEPAGE NAME=vectors START=0x2C00 END=0x2FFF PROTECTED CODEPAGE NAME=page START=0x3000 END=0x7FFF ... Does it [sTART=0x3000 END=0x7FFF] imply:PROGRAMM MEMORY SPACE for USER APPLICATION (18f452) [HEX BYTES = 0x4FFF] / [DEC. BYTES = 20.479] ==> [WORDS = 10.239] ? 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.