Jump to content

Help and suggestion


superdavies
 Share

Recommended Posts

Hi to everyone

Few months ago I started my midbox project, a very, very simple one.

Apart for the electronic part of the project that is really good explaned with schematics, photos, suggestion and so on, the "software" part of the site, in my opinion is not as equal!

Let me explain: I'm not very familiar with software development, but i'm quite a person in a good understanding feeling, as for electronics or mechanics and other things, just a brief study and I can understand all.

I wrote a couple of message in the forum tryin' to have some advice for the writing of my first application, how to do and so on, I red and studied ALL the midibox.org, uCApps.de, and the forum too but I still can't understand the right way to change (or create ) my own apps.

I need a very simple configuration for my midibox: 40 pots, 20 buttons, 20 leds, no lCD, no banksticks a simple midicontroller for use with softsynth softwares: so I thought that a good starting point may be the ain64_din128_dout128_v1_3.zip for the reason That I need only to reduce the number of pots, buttons and leds.

I downloades the zip, I downloaded also activepearl, sdcc ecc ecc, i red the example, I downloaded also other apps, navigate thru the zips, open the files, studied them, tryin' to use the software but still can't understand!!! I don't think I'm stupid!!! But i'm really feel so!!!    :o

1) Can anyone can explain me step by step how to modify an application (in C)?

2) Suggestion!!! Starting thinking that maybe I'm not the only one with this problem, what do you think about making a possible upgrade for the site-part that talking about the apps? Maybe it's a good idea to make some kind of tutorial , step by step for people that is "stupid" as me? I promise that, if anyone can make me understand, I made it for the entire community!!! ;)

Excuse me for the long message but this is what I honestly think: uCApps.de is really GREAT, well done, lot of examples and so on, but the weak point is the expanation for the making of new applications...I wrote this one for trying to contribute! :)

Is there anyone that want to take my hand and explain the first steps? Maybe this is useful for other people!

Thank you very much!

Andrea from Italy

Link to comment
Share on other sites

Hi SuperDavies

Have you seen this? Application Development

Also, you might want to check this out: Function Reference List

I will post back with more soon (530am here, it's bedtime!) but for now, make sure you understand the 2nd link, especially the section on USER_* functions. The descriptions tell you how each of the functions in the main.c file in the skeleton are handled.

Briefly, It runs user_init on startup, then runs the interrupt handlers (look for "this is an interrupt service routine!") as the events occur (midi recieved, timer overrun, etc), services all the buttons, encoders, LED's ,LCD, etc, and then with any time left over (which is a LOT!) it runs user_tick.

When I wake up, perhaps there is something in particular you'd like me to explain, to act as an example?

Link to comment
Share on other sites

Hi

Thank you very much for your interesrt and your help! I really want to understand!!!

I red all the links but I still can't understand...maybe is a good thing to point me at the first step with an example.

Ok, I tell you the things I understand: mios user application need to be coded in C or ASM, in our case we use C; We have two possibilities ,(in my case) use the skeleton or use and existing apps and modify it.

Let's try the second because I think it's the best for me! As I need only 40 pots, 20 buttons and 20 leds and I don't need ant banksticks or LCD (but I have one ) maybe best thing is to use ain64_din128_dout128_v1_3.zip.

I have it, and in my opinion I need to modify such files that is in this zip...but I have main.c,main.h, cmios.h which one I need to modify? I already have the activeperl, gputils, sdcc ecc but I really don't know how to handled with them.

???

Can plese explain, in my needing, how to do this?

Thank you very much!

Andrea

Link to comment
Share on other sites

Well, that application is in ASM not C, so there is no main.c, but main.asm, and that is where you can make the changes:

	;; use 64 pots
	movlw	64
	call	MIOS_AIN_NumberSet
You can probably guess that this should be changed to:
	;; use 40 pots
	movlw	40
	call	MIOS_AIN_NumberSet
And...
	;; define number of shift registers: for 128 buttons and LEDs, we need
	;; 16 registers. Btw.: thats the maximum number of supported DIN/DOUTs
	movlw	16
	call	MIOS_SRIO_NumberSet
Each Shift Register handles 8 digital IO, so 16 SR's means 128 IO... You want 20, so you need 3 SR's, so change it to:
	;; define number of shift registers: for 20 buttons and LEDs, we need
	;; 3 registers. 
	movlw	3
	call	MIOS_SRIO_NumberSet

Done! As you can see, sometimes a great deal of information can be taken from reading the comments from TK in the source files. I know that it can be a heavy read, but it is a good way to learn :)

Link to comment
Share on other sites

Hi

Thank you very much for your help.

Ok, after all, see some light! In hte mios-download section there are two ain64_din128_dout128...one coded in C one coded in ASM, since now I only used the one coded in C but doesn't matter, let's try use the one you suggested me coded in asm! Now I try to do as you told me, this evening I'll return to you with my results!

Thank you very, very much!!!

Andrea

Link to comment
Share on other sites

Sorry my mistake! The C version would definitely be preferable as C is MUCH easier to work with...

If you look in main.h (The Header file for the main.c program) You will find the same options with explanations in the comments also:

/////////////////////////////////////////////////////////////////////////////
// Global definitions
/////////////////////////////////////////////////////////////////////////////

#define AIN_NUMBER_INPUTS     64    // number of used analog inputs (0..64)
#define AIN_MUXED_MODE         1    // set this to 1 if AIN modules are used
#define AIN_DEADBAND           7    // define deadband here (higher values reduce the effective resolution but reduce jitter)
                                    // 7 is ideal for value range 0..127 (CC events)

#define NUMBER_OF_SRIO        16    // how many shift registers chained at the DIN/DOUT port (min 1, max 16)

#define DIN_DEBOUNCE_VALUE    10    // 0..255
#define DIN_TS_SENSITIVITY     0    // optional touch sensor sensitivity: 0..255

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...