Jump to content

mess

Programmer
  • Posts

    141
  • Joined

  • Last visited

Everything posted by mess

  1. yes, I just tried with an empty skeleton, I replaced the MIOS_LCD_PrintCString with PrintPreConfigString (with the text_welcome_0[] declared in main.c)
  2. Everything works now, I made some stupid errors on my veroboard din module ::)
  3. Is it possible to invoke MIOS studio from the command prompt with parameters so that it sends a hex file?
  4. MIOS_LCD_PrintPreconfString C_DECLARATION void MIOS_LCD_PrintPreconfString(unsigned char len, code char *str) DESCRIPTION prints a preconfigured string C_IN Pointer to String in <str> Stringlength in <len> C_EXAMPLE // defined somewhere *outside* the function! const unsigned char text_welcome_0[] = { "Hello World!" }; // within the function: print string MIOS_LCD_CursorSet(0x00 + 0); MIOS_LCD_[b]PrintString[/b](12, text_welcome_0); // please see also the MIOS_LCD_PrintCString function! I think this should be // within the function: print string MIOS_LCD_CursorSet(0x00 + 0); MIOS_LCD_[b]PrintPreconfString[/b](12, text_welcome_0); ? I tried this example but instead of displaying hello world I get 12 times the play symbol (first character of special char set) MIOS_LCD_PrintCString does work as expected...
  5. I guess I did miss the encoder example, thanks TK ;D
  6. I would like to help with testing :-)
  7. I tried some of those programs in the past, with varying results... right now I use the save function of my browser but it's not the nicest solution I was hoping that the wiki itself had a feature to export the source or something like that... my primary goal is to archive my own wiki page because it's my only documentation at the moment (except from the source code)
  8. Thank you guys for your help :) :D I tried this already, same result -> this seems to be the solution, since I have no MIOS asm background I was even unaware of this table (always seemed a mystery how MIOS identified encoders ::)) so if I summarise encoder handling in MIOS C: - connect encoder to shift register, first pin on an even pin number - add an encoder entry in mios_tables.inc - add a line in Init() in main.c: // set encoder speed mode of datawheel MIOS_ENC_SpeedSet(ENCODER_NR, DATAWHEEL_SPEED_MODE, DATAWHEEL_SPEED_DIVIDER); - handle encoder events in ENC_NotifyChange(...) I will try this when I get home tonight...
  9. Is there an easy way to store wiki pages offline? this would be really helpfull as I don't always have internet access when working on a MB project...
  10. The WIKI page would be most helpfull as the performance topic has come up several times a little off topic, but I think that the SRIO problem with the debounce method and a ledmatrix would also be useful WIKI info...
  11. another option is to implement a performance counter, each time the Tick() routine is executed you increment a counter then this counter is periodically displayed and resetted for an example, see mbfm_load.inc in the midibox FM source package this method gives some extra load but I think that this could be neglected Michaël
  12. Hi Moxi, this looks like a nice application :) I don't think that you can avoid the if...else statements if you want to measure the performance see this post (first answer by TK): http://www.midibox.org/forum/index.php?topic=7335.0 it works fine with: void someroutine () { PORTDbits.RD4 = 1; //other code PORTDbits.RD4 = 0; } so when you connect your probe to J14 it's possible to measure the execution time the only disadvantage is that you need a scope for this...
  13. Hi, I'm trying to use a rotary encoder connected to pin 6 and 7 of my second din register... I've tried to use this encoder with this line in init(): // set encoder speed mode of datawheel MIOS_ENC_SpeedSet(14, DATAWHEEL_SPEED_MODE, DATAWHEEL_SPEED_DIVIDER); and this code in ENC_NotifyChange(...) if (encoder == 14) { unsigned int value; if (cs_layer == CS_LAYER_SFB) { CS_GetSFB(cs_sfb_mode); value = SFB_val; SFB_val = (MIOS_HLP_16bitAddSaturate(incrementer, &value, SFB_max))&0xFF; } else { //if no special function is selected the encoder changes the current bpm value = MCLOCK_BPMGet(); MCLOCK_BPMSet(MIOS_HLP_16bitAddSaturate(incrementer, &value, 255)&0xFF); } app_flags.DISPLAY_UPDATE_REQ = 1; } but the code seems to do nothing :(
  14. Hi Kapser, I 've made a POV display at school, with most code written in C we used a 8051 micro so I'm sure this should work on a pic processor (our processor was quite slow and limited) PM me if you need help with anything I can mail you our source if you want Michaël
  15. Aah, this would explain why my ledmatrix keeps flickering :) I thought I made some kind of wiring error very interesting topic :)
  16. Hi Stryd, In the meanwhile most of my code is rewritten, so I will PM you a new version this evening. My main goal at the moment is to implement the CS and some basic features without optimising any code... (this should be done in a few days) When the CS is done it's optimisation time :-) I've done some simple realtime stuff in the past with a 8051 based school project see this link (it's a pong game with a propellor display): http://users.skynet.be/sky92755/pongwerkt.mov (20MB), note that the image doesn't look stable because of my crappy camera I found it easier to modify the asm output from the Keil compiler than the gcc compiler... Maybe I should work on my pic18 assembler knowledge a bit, it's a lot more complicated then 8051 asm Any help is REALLY welcome, I'm looking forward to completing this project as soon as possible :)
  17. Ok I will try the scope method my seq works but the timing is not so stable at the moment...
  18. Hello, how can I measure the processor load of my code? I'm working on a seq based on clockbox so I tried to display the number of clock counters that need to be processed each tick but the numbers vary too fast to see any result... Is there a simulator for the 18F series? With the µVision IDE at school you can run your program in simulation to see the runtime of each procedure, I find such a feature very useful to find bottlenecks in C code...
  19. But if this is user error, the compiler should display a error on line xx message instead of these strange SIGSEGV messages? in the meanwhile I've replaced the function pointers with switch case statements it seems that the compiler should optimise these to jumptables...(sdcc manual) now the code compiles ok..
  20. The library is included, I can use arrays of unsigned chars with no errors... I haven't tried a nightly build because of this from the MIOS C Interface page: Maybe it's worth the try since SDCC 2.6.0 is released: I'm going to try this on another pc since I don't want to mess with my working config. to be continued... :) *edit: it seems that this bug is reported but not fixed yet see:http://sourceforge.net/tracker/index.php?func=detail&aid=1427663&group_id=599&atid=100599
  21. mess

    Clockbox

    Hi Bionix, I did some tests quick with midi over lan yesterday and midi sync works using tobybear's midibag toolkit and midi yoke. It seems to work ok... my test setup: pc1 fruityloops (enable send sync)-> midiyoke -> net2mid pc2 mid2net -> midiyoke -> fruityloops (enable midiyoke as controller) I used fruitystudio for a quick test but this should also work for other hosts on the other hand a clockbox is a nice alternative, no network headaches :-)
  22. I'm having some problems with function pointers: declarations //simple function pointer void (*testp1) (void); //array of function pointers void (*testp2[]) (void); //some dummy functions void testf1 (void) {int a = 8;} void testf2 (void) {int a = 9;} void testf3 (void) {int a = 10;} function using first function pointer, compiles ok void testPointerfunction1 () { testp1 = testf1; testf1(); } using function pointer array, see error below void testPointerfunction2 () { testp2[0] = &testf1; testp2[1] = &testf2; testp2[2] = &testf3; testp2[0](); } error message: Makefile generated. Makefile.bat generated. Assembling MIOS SDCC wrapper ========================================================================== Compiling pic18f452.c Processor: 18F452 ========================================================================== Compiling main.c Processor: 18F452 Caught signal 11: SIGSEGV ERROR! is it possible that the library doesn't support function pointer arrays?
  23. Hi, I'm struggling with coding a CS handler in C... it seems straightforward to handle parameters by translating the TC example to C (see http://www.midibox.org/forum/index.php?PHPSESSID=5e0c61976960c6db9364e9325330d7a7&topic=611.0) but how do you map buttons to functions? should this be implemented with a switch statement or with a table with function pointers? for example 4 buttons with 3 layers: Button 1 Button2 Button3 Button4 layer one: functionA functionB functionC functionD layer two: functionE functionF functionG functionH layer three: functionI functionJ functionK functionL with switch...case statements: switch (nr_of_layer) { case 0: switch (nr_of_button) { case 0: functionA(); case 1: functionB(); ... } case 1: switch (nr_of_button) { case 0: functionE(); case 1: functionF(); ... } .... } with functionpointers: //declaration of pointer array void (*Buttonfunctions[]) () = { functionA, functionB, functionC,functionD, functionE, functionF, functionG,functionH, functionI, functionJ, functionK,functionL, }; //usage *Buttonfunctions[button_nr * layer_nr](); please tell me if my question is not clear... Michaël
  24. I've started a wiki page about the seq: http://www.midibox.org/dokuwiki/doku.php?id=dseq32 page is still under construction :) Michaël
  25. I've made some layout drawings in paint and it's really frustrating :) so I'm definitly looking for a better tool
×
×
  • Create New...