Jump to content

nsunier

Programmer
  • Posts

    53
  • Joined

  • Last visited

Posts posted by nsunier

  1. Hi mr_DK,

    At this time, I've received 2 samples from SK. One with RGB backlight and another one with "only" red/green backlight.

    I've stopped the development due to the lack of time. But for sure I'll continue. At this time I've only partially developed the architecture of a VHDL design for a Xilinx Spartan3 FPGA and built a small PCB to fit these 2 samples with my FPGA developer's kit.

    Have you knowledge of VHDL design?

  2. I'm not convinced that a serial interface is a good solution. There is a lot of information to transmit in order to update the complete display information: about 110 bytes per button. The idea is to allow up to 20 buttons. At first I'm considering parallel interface. I think it should not be a problem to affect a CORE module to only manage these buttons (like motor faders which require many resources). MIDI-link could be used to allow using other features like LCD, faders, ...

    What do you think about that?

  3. I'm wondering if I it's a good idea or not to develop a CPLD or a FPGA to interface the screenkeys. The functions to include in this component are listed below:

    • generate and distribute the continuous clock to the screenkeys without monopolizing the uC
    • the screenkeys are write-only, then the CPLD/FPGA will have independant registers which could be written and read by the uC
    • the screenkeys button pressed is a simple contact then I could add a register which contains this information

    What do you think about the points above?

    Now, I need some informations about the MIDIBOX architecture. What is the "best" communication interface which could be simply added to the existing PIC-based system and to the new ARM-based one?

    Please feel free to add all your questions/comments. I want to design something which could really be useful and which is well thought in harmony with the existing system.

  4. I'm sorry but I can't find the topic called: "programmer's lounge". Can you give the direct link?

    About the MBHP_CORE_STM32 module: this design is much more powerful than the PIC-based one.

    1. I think it would be better to directly start with this new concept. Is it a good idea? Is the design sufficiently mature and stable?

    2. Even if some features are disabled by using the SPI ports, it is not a problem. I'm planning to use 2 or 3 CORE modules in chain (MIDI-link). Can I mix ARM-based CORE modules with PIC-based ones?

    3. Have you (or anyone) designed a working printed circuit board? If yes, can I get the files in order to make them? It is not a problem for me to solder SMD parts.

    Best regards, Nathanael

  5. Hi TK,

    Thanks for your answer. Not all is clear for me but I'll try it by myself and than ask you for more specific details.

    It will be probably in a couple of weeks because I still not have received my ordered CORE module. In addition I need some time to experiment.

    In the meantime can you tell me more about MBHP_CORE_STM32? What is this new project? Are you planning to upgrade the core module with a new uC (still a PIC)? If yes, I've you an idea of the release date? If it isn't in a too long time, I probably would have better to go directly with this new architecture!?

    Best regards, Nathanael

  6. Hello,

    This message is specially intended for TK.

    I intend to develop an interface for screenkeys. I've acquired two of these buttons.

    It's simply a synchronous  serial data communication interface (clock + data). The only negative point is that clock has to be permanent in order to refresh the LCD. The faster is the clock (50kHz min to 4MHz max), the faster will be the access and the display refresh rate.

    But before beginning, I would like to know the opinion of TK. What are the hardware and software possibilities of a core module? I would not like to develop a hardware and/or a software which goes against the architecture developed by TK.

    Thanks for your help.

  7. Hi,

    in this case the ALL is relatively useless, but in general, a Union has the advantage of reading all states at once.

    So, for example if you have 8 bits that store 8 different settings, this union can be adressed as an 8bit number and easily stored and read back.

    see: your favorite C-book -> Union ;)

    best,

    Michael

    Hi Michael,

    Ok, now I understand well.

    Is it possible to define a 9bit or 67bit structure? Or is it limited to a single 8bit data?

    Best regards,

    nsunier

  8. I haven't noticed about this very useful function. Thank you! ;)

    I've another question about the example header "main.h":

    // status of analog toolbox application
    typedef union {
      struct {
        unsigned ALL:8;
      };
      struct {
        unsigned DISPLAY_UPDATE_REQ:1;  // requests a display update
      };
    } app_flags_t;

    What is the function of the 8 bits named "ALL"?

    Best regards,

    nsunier

  9. My C course is several years old and I don't remember very clearly one thing.

    I've defined an array: unsigned char cur_but_solo[96]={0}; In my code, sometimes I set one value of this array to 1 or reset to 0. At the end, I want to check is this array is still equal to {0} without using a for loop. Is there a "clean" way to proceed?

    Best regards,

    nsunier

  10. The GLCD_FONT_NORMAL font is initialized in the void DISPLAY_Init(void) function. When do you display your copyright message? Before when this function is called?

    For the reboot message, yes it's acceptable.

    Best regards,

    nsunier

    EDIT

    Oups! :'( I've read too quicly your previous answer. If I put the initialization in the Init() function, it works!

  11. It's just a question.

    I've added the new font (and disabled all unused ones: like I was already doing). And I get this message:

    rm -rf _output/*
    rm -rf _output
    rm -rf *.cod *.map *.lst
    rm -rf *.hex
    mkdir -p _output
    sh ./bin/mios-sdcc -c -mpic16 -p18f4620 --fommit-frame-pointer --optimize-goto --optimize-cmp --disa
    ble-warning 85 --obanksel=2 -pleave-reset-vector  -I./src -I ./include/c -I ./modules/glcd_font -DDE
    BUG_MODE=0  modules/libdev/pic18f4620.c -o _output/pic18f4620.o
    ./bin/mios-gpasm modifies _output/pic18f4620.asm, result in _output/pic18f4620__mios-gpasm-tmp.asm
    sh ./bin/mios-gpasm -c -p p18f4620 -I./src -I ./include/asm -I ./modules/app_lcd/ks0108 -I ./modules
    /glcd_font -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I ./modules/mios_wrapper modul
    es/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
    sh ./bin/mios-gpasm -c -p p18f4620 -I./src -I ./include/asm -I ./modules/app_lcd/ks0108 -I ./modules
    /glcd_font -DDEBUG_MODE=0   modules/app_lcd/ks0108/app_lcd.asm -o _output/app_lcd.o
    sh ./bin/mios-sdcc -c -mpic16 -p18f4620 --fommit-frame-pointer --optimize-goto --optimize-cmp --disa
    ble-warning 85 --obanksel=2 -pleave-reset-vector  -I./src -I ./include/c -I ./modules/glcd_font -DDE
    BUG_MODE=0  main.c -o _output/main.o
    ./bin/mios-gpasm modifies _output/main.asm, result in _output/main__mios-gpasm-tmp.asm
    sh ./bin/mios-gpasm -c -p p18f4620 -I./src -I ./include/asm -I ./modules/app_lcd/ks0108 -I ./modules
    /glcd_font -DDEBUG_MODE=0   modules/glcd_font/glcd_font_normal.asm -o _output/glcd_font_normal.o
    sh ./bin/mios-gpasm -c -p p18f4620 -I./src -I ./include/asm -I ./modules/app_lcd/ks0108 -I ./modules
    /glcd_font -DDEBUG_MODE=0   modules/glcd_font/glcd_font_big.asm -o _output/glcd_font_big.o
    sh ./bin/mios-gpasm -c -p p18f4620 -I./src -I ./include/asm -I ./modules/app_lcd/ks0108 -I ./modules
    /glcd_font -DDEBUG_MODE=0   modules/glcd_font/glcd_font_meter_icons_v_big.asm -o _output/glcd_font_m
    eter_icons_v_big.o
    gplink -s ./etc/lkr/p18f4620.lkr -m -o project.hex _output/pic18f4620.o _output/mios_wrapper.o _outp
    ut/app_lcd.o _output/main.o _output/glcd_font_normal.o _output/glcd_font_big.o _output/glcd_font_met
    er_icons_v_big.o
    error: no target memory available for section ".MIOS_EEPROM_ReadPage"
    make: *** [project.hex] Error 1

    Where is the extra available memory of the PIC18F4620?

    Best regards,

    nsunier

  12. I've installed the latest version of SDCC (v2.8.0) instead of the old one (v2.5.0). I've added the p18f4620.lkr file to the etc/lkr directory. And I've succeeded in compiling the code.

    I can add a little bit of code and it still works. But after adding some extra lines, the MIOS Studio writed this message: "Sending block 00007D00-00007DFF" -> corruption of the display font. I can't understand!! In the Microchip description there is written that PIC18F4620 has twice the memory of the PIC18F452. And I haven't add twice the initial code!?

    PIC18F452

    Flash: 32 Kbytes

    RAM: 1,536

    EEPROM: 256 bytes

    PIC18F4620

    Flash: 64 Kbytes

    RAM: 3,968

    EEPROM: 1024 bytes

    What's going wrong?

    Best regards,

    nsunier

  13. I've burned a PIC18F4620 with the bootloader v1.2b; loaded the MIOS.

    I've a problem to recompile my code for the new processor. I've changed in Makefile.orig file the following lines:

    PROCESSOR = p18f452 -> PROCESSOR = p18f4620

    OBJS = pic18f452.o mios_wrapper.o app_lcd.o main.o -> OBJS = pic18f4620.o mios_wrapper.o app_lcd.o main.o

    When I do a make I get this message:

    rm -rf _output/*
    rm -rf _output
    rm -rf *.cod *.map *.lst
    rm -rf *.hex
    mkdir -p _output
    sh ./bin/mios-sdcc -c -mpic16 -p18f4620 --fommit-frame-pointer --optimize-goto --optimize-cmp --disa
    ble-warning 85 --obanksel=2 -pleave-reset-vector  -I./src -I ./include/c -I ./modules/glcd_font -DDE
    BUG_MODE=0  modules/libdev/pic18f4620.c -o _output/pic18f4620.o
    Processor: 18f4620
    '18f4620' was not found.
    Valid devices are:
    p18f242   p18f248   p18f252   p18f258
    p18f442   p18f448   p18f452   p18f458
    p18f1220  p18f2220  p18f2550  p18f4331
    p18f4455  p18f6520  p18f6620  p18f6680
    p18f6720  p18f8520  p18f8620  p18f8680
    p18f8720
    make: *** [_output/pic18f4620.o] Error 1

    In the Makefile.orig file, there is written: LKR_FILE  = $(MIOS_PATH)/etc/lkr/$(PROCESSOR).lkr

    In the ./etc/lkr/ directory I can only found the p18f452.lkr file

    Is there a file missing?

    Best regards,

    nsunier

  14. The upload of the working application give me this log:

    Starting upload of project.hex
    Sending block 00003000-000030FF
    Received Checksum: 7B - OK
    Sending block 00003100-000031FF
    Received Checksum: 60 - OK
    Sending block 00003200-000032FF
    Received Checksum: 40 - OK
    Sending block 00003300-000033FF
    Received Checksum: 2F - OK
    Sending block 00003400-000034FF
    Received Checksum: 01 - OK
    Sending block 00003500-000035FF
    Received Checksum: 33 - OK
    Sending block 00003600-000036FF
    Received Checksum: 13 - OK
    Sending block 00003700-000037FF
    Received Checksum: 73 - OK
    Sending block 00003800-000038FF
    Received Checksum: 52 - OK
    Sending block 00003900-000039FF
    Received Checksum: 3A - OK
    Sending block 00003A00-00003AFF
    Received Checksum: 65 - OK
    Sending block 00003B00-00003BFF
    Received Checksum: 20 - OK
    Sending block 00003C00-00003CFF
    Received Checksum: 6D - OK
    Sending block 00003D00-00003DFF
    Received Checksum: 32 - OK
    Sending block 00003E00-00003EFF
    Received Checksum: 35 - OK
    Sending block 00003F00-00003FFF
    Received Checksum: 04 - OK
    Sending block 00004000-000040FF
    Received Checksum: 50 - OK
    Sending block 00004100-000041FF
    Received Checksum: 70 - OK
    Sending block 00004200-000042FF
    Received Checksum: 55 - OK
    Sending block 00004300-000043FF
    Received Checksum: 55 - OK
    Sending block 00004400-000044FF
    Received Checksum: 71 - OK
    Sending block 00004500-000045FF
    Received Checksum: 6B - OK
    Sending block 00004600-000046FF
    Received Checksum: 52 - OK
    Sending block 00004700-000047FF
    Received Checksum: 11 - OK
    Sending block 00004800-000048FF
    Received Checksum: 08 - OK
    Sending block 00004900-000049FF
    Received Checksum: 6E - OK
    Sending block 00004A00-00004AFF
    Received Checksum: 30 - OK
    Sending block 00004B00-00004BFF
    Received Checksum: 21 - OK
    Sending block 00004C00-00004CFF
    Received Checksum: 19 - OK
    Sending block 00004D00-00004DFF
    Received Checksum: 57 - OK
    Sending block 00004E00-00004EFF
    Received Checksum: 04 - OK
    Sending block 00004F00-00004FFF
    Received Checksum: 6A - OK
    Sending block 00005000-000050FF
    Received Checksum: 3F - OK
    Sending block 00005100-000051FF
    Received Checksum: 4D - OK
    Sending block 00005200-000052FF
    Received Checksum: 6D - OK
    Sending block 00005300-000053FF
    Received Checksum: 4E - OK
    Sending block 00005400-000054FF
    Received Checksum: 0B - OK
    Sending block 00005500-000055FF
    Received Checksum: 38 - OK
    Sending block 00005600-000056FF
    Received Checksum: 1E - OK
    Sending block 00005700-000057FF
    Received Checksum: 74 - OK
    Sending block 00005800-000058FF
    Received Checksum: 01 - OK
    Sending block 00005900-000059FF
    Received Checksum: 0C - OK
    Sending block 00005A00-00005AFF
    Received Checksum: 2A - OK
    Sending block 00005B00-00005BFF
    Received Checksum: 0A - OK
    Sending block 00005C00-00005CFF
    Received Checksum: 1A - OK
    Sending block 00005D00-00005DFF
    Received Checksum: 4D - OK
    Sending block 00005E00-00005EFF
    Received Checksum: 41 - OK
    Sending block 00005F00-00005FFF
    Received Checksum: 63 - OK
    Sending block 00006000-000060FF
    Received Checksum: 5D - OK
    Sending block 00006100-000061FF
    Received Checksum: 7F - OK
    Sending block 00006200-000062FF
    Received Checksum: 47 - OK
    Sending block 00006300-000063FF
    Received Checksum: 7A - OK
    Sending block 00006400-000064FF
    Received Checksum: 79 - OK
    Sending block 00006500-000065FF
    Received Checksum: 5C - OK
    Sending block 00006600-000066FF
    Received Checksum: 07 - OK
    Sending block 00006700-000067FF
    Received Checksum: 05 - OK
    Sending block 00006800-000068FF
    Received Checksum: 74 - OK
    Sending block 00006900-000069FF
    Received Checksum: 63 - OK
    Sending block 00006A00-00006AFF
    Received Checksum: 3B - OK
    Sending block 00006B00-00006BFF
    Received Checksum: 5C - OK
    Sending block 00006C00-00006CFF
    Received Checksum: 31 - OK
    Sending block 00006D00-00006DFF
    Received Checksum: 04 - OK
    Sending block 00006E00-00006EFF
    Received Checksum: 0E - OK
    Sending block 00006F00-00006FFF
    Received Checksum: 62 - OK
    Sending block 00007000-000070FF
    Received Checksum: 36 - OK
    Sending block 00007100-000071FF
    Received Checksum: 70 - OK
    Sending block 00007200-000072FF
    Received Checksum: 7D - OK
    Sending block 00007300-000073FF
    Received Checksum: 49 - OK
    Sending block 00007400-000074FF
    Received Checksum: 1C - OK
    Sending block 00007500-000075FF
    Received Checksum: 18 - OK
    Sending block 00007600-000076FF
    Received Checksum: 17 - OK
    Sending block 00007700-000077FF
    Received Checksum: 1A - OK
    Sending block 00007800-000078FF
    Received Checksum: 3F - OK
    Sending block 00007900-000079FF
    Received Checksum: 1E - OK
    Sending block 00007A00-00007AFF
    Received Checksum: 5F - OK
    Sending block 00007B00-00007BFF
    Received Checksum: 6E - OK
    Upload process complete
    Upper block address: 00007B00-00007BFF And the not working one (just by adding two simple if statements in the void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) function):
    Starting upload of project.hex
    Sending block 00003000-000030FF
    Received Checksum: 0C - OK
    Sending block 00003100-000031FF
    Received Checksum: 60 - OK
    Sending block 00003200-000032FF
    Received Checksum: 40 - OK
    Sending block 00003300-000033FF
    Received Checksum: 2F - OK
    Sending block 00003400-000034FF
    Received Checksum: 01 - OK
    Sending block 00003500-000035FF
    Received Checksum: 33 - OK
    Sending block 00003600-000036FF
    Received Checksum: 13 - OK
    Sending block 00003700-000037FF
    Received Checksum: 73 - OK
    Sending block 00003800-000038FF
    Received Checksum: 52 - OK
    Sending block 00003900-000039FF
    Received Checksum: 3A - OK
    Sending block 00003A00-00003AFF
    Received Checksum: 65 - OK
    Sending block 00003B00-00003BFF
    Received Checksum: 20 - OK
    Sending block 00003C00-00003CFF
    Received Checksum: 6D - OK
    Sending block 00003D00-00003DFF
    Received Checksum: 32 - OK
    Sending block 00003E00-00003EFF
    Received Checksum: 35 - OK
    Sending block 00003F00-00003FFF
    Received Checksum: 04 - OK
    Sending block 00004000-000040FF
    Received Checksum: 50 - OK
    Sending block 00004100-000041FF
    Received Checksum: 70 - OK
    Sending block 00004200-000042FF
    Received Checksum: 55 - OK
    Sending block 00004300-000043FF
    Received Checksum: 55 - OK
    Sending block 00004400-000044FF
    Received Checksum: 71 - OK
    Sending block 00004500-000045FF
    Received Checksum: 6B - OK
    Sending block 00004600-000046FF
    Received Checksum: 52 - OK
    Sending block 00004700-000047FF
    Received Checksum: 11 - OK
    Sending block 00004800-000048FF
    Received Checksum: 08 - OK
    Sending block 00004900-000049FF
    Received Checksum: 6E - OK
    Sending block 00004A00-00004AFF
    Received Checksum: 30 - OK
    Sending block 00004B00-00004BFF
    Received Checksum: 21 - OK
    Sending block 00004C00-00004CFF
    Received Checksum: 19 - OK
    Sending block 00004D00-00004DFF
    Received Checksum: 57 - OK
    Sending block 00004E00-00004EFF
    Received Checksum: 04 - OK
    Sending block 00004F00-00004FFF
    Received Checksum: 6A - OK
    Sending block 00005000-000050FF
    Received Checksum: 3F - OK
    Sending block 00005100-000051FF
    Received Checksum: 4D - OK
    Sending block 00005200-000052FF
    Received Checksum: 6D - OK
    Sending block 00005300-000053FF
    Received Checksum: 4E - OK
    Sending block 00005400-000054FF
    Received Checksum: 0B - OK
    Sending block 00005500-000055FF
    Received Checksum: 38 - OK
    Sending block 00005600-000056FF
    Received Checksum: 1E - OK
    Sending block 00005700-000057FF
    Received Checksum: 74 - OK
    Sending block 00005800-000058FF
    Received Checksum: 01 - OK
    Sending block 00005900-000059FF
    Received Checksum: 0C - OK
    Sending block 00005A00-00005AFF
    Received Checksum: 2A - OK
    Sending block 00005B00-00005BFF
    Received Checksum: 0A - OK
    Sending block 00005C00-00005CFF
    Received Checksum: 1A - OK
    Sending block 00005D00-00005DFF
    Received Checksum: 4D - OK
    Sending block 00005E00-00005EFF
    Received Checksum: 41 - OK
    Sending block 00005F00-00005FFF
    Received Checksum: 63 - OK
    Sending block 00006000-000060FF
    Received Checksum: 5D - OK
    Sending block 00006100-000061FF
    Received Checksum: 7F - OK
    Sending block 00006200-000062FF
    Received Checksum: 47 - OK
    Sending block 00006300-000063FF
    Received Checksum: 7A - OK
    Sending block 00006400-000064FF
    Received Checksum: 79 - OK
    Sending block 00006500-000065FF
    Received Checksum: 5C - OK
    Sending block 00006600-000066FF
    Received Checksum: 65 - OK
    Sending block 00006700-000067FF
    Received Checksum: 7D - OK
    Sending block 00006800-000068FF
    Received Checksum: 09 - OK
    Sending block 00006900-000069FF
    Received Checksum: 41 - OK
    Sending block 00006A00-00006AFF
    Received Checksum: 1B - OK
    Sending block 00006B00-00006BFF
    Received Checksum: 25 - OK
    Sending block 00006C00-00006CFF
    Received Checksum: 7F - OK
    Sending block 00006D00-00006DFF
    Received Checksum: 74 - OK
    Sending block 00006E00-00006EFF
    Received Checksum: 6E - OK
    Sending block 00006F00-00006FFF
    Received Checksum: 45 - OK
    Sending block 00007000-000070FF
    Received Checksum: 5A - OK
    Sending block 00007100-000071FF
    Received Checksum: 39 - OK
    Sending block 00007200-000072FF
    Received Checksum: 0B - OK
    Sending block 00007300-000073FF
    Received Checksum: 4A - OK
    Sending block 00007400-000074FF
    Received Checksum: 09 - OK
    Sending block 00007500-000075FF
    Received Checksum: 65 - OK
    Sending block 00007600-000076FF
    Received Checksum: 5D - OK
    Sending block 00007700-000077FF
    Received Checksum: 5C - OK
    Sending block 00007800-000078FF
    Received Checksum: 6C - OK
    Sending block 00007900-000079FF
    Received Checksum: 57 - OK
    Sending block 00007A00-00007AFF
    Received Checksum: 50 - OK
    Sending block 00007B00-00007BFF
    Received Checksum: 68 - OK
    Sending block 00007C00-00007CFF
    Received Checksum: 42 - OK
    Upload process complete

    Upper block address: 00007C00-00007CFF

    So it's clearly an overwrite!! What should I do? To change my PIC?

    I don't understand very well what you told me about .lst and .map files. Should I post them? Which files exactly? main.lst and project.map?

    Best regards,

    nsunier

  15. I'm currently writing an application based on the example code provided by TK.

    All was working like a charm until today. Sometimes, when I add some code concerning the LCD display the MIOS_GLCD_FONT seems to be corrupted. The other fonts provided in .\modules\glcd_font directory works well.

    I've two section in the void DISPLAY_Tick(void) function:

    • display AIN changes
    • display DIN changes

    Here is my function (the DIN part is still under development):

    /////////////////////////////////////////////////////////////////////////////
    //  This function is called in the mainloop when no temporary message is shown
    //  on screen. Print the realtime messages here
    /////////////////////////////////////////////////////////////////////////////
    void DISPLAY_Tick(void) __wparam
    {
    	// do nothing if no update has been requested
      if( !app_flags.DISPLAY_UPDATE_REQ )
        return;                  
                                 
      // clear request           
      app_flags.DISPLAY_UPDATE_REQ = 0;
    
    	switch (last_ain_func) // pot related display update
      {
        case 1:  // current pot = submaster
          // print pot name
          MIOS_GLCD_FontInit(GLCD_FONT_BIG);
          MIOS_GLCD_GCursorSet(16,0);
          MIOS_LCD_PrintCString(pot_name[last_ain_pin]);
          
          // print pot value
          MIOS_GLCD_GCursorSet(16,4);
          MIOS_LCD_PrintBCD3(cur_pot_values[pot_event_map[last_ain_pin][0]]);
          
          // print pot meter value
          MIOS_GLCD_FontInit(GLCD_FONT_METER_ICONS_V_BIG);
          MIOS_GLCD_GCursorSet(0,0);
          MIOS_LCD_PrintChar(pot_meter[cur_pot_values[pot_event_map[last_ain_pin][0]]][0]);
          
        	// set LED
    	    if (cur_pot_values[pot_event_map[last_ain_pin][0]]>1)
    	    	MIOS_DOUT_PinSet(led_map[pot_event_map[last_ain_pin][0]][0], 0x01);
    	    else
    	    	MIOS_DOUT_PinSet(led_map[pot_event_map[last_ain_pin][0]][0], 0x00);
        	
        	break;
        
        case 2:  // current pot = grandmaster
          // print pot name
          MIOS_GLCD_FontInit(GLCD_FONT_BIG);
          MIOS_GLCD_GCursorSet(16,0);
          MIOS_LCD_PrintCString(pot_name[last_ain_pin]);
          
          // print pot value
          MIOS_GLCD_GCursorSet(16,4);
          MIOS_LCD_PrintBCD3(cur_pot_values[pot_event_map[last_ain_pin][0]]);
          
          // print pot meter value
          MIOS_GLCD_FontInit(GLCD_FONT_METER_ICONS_V_BIG);
          MIOS_GLCD_GCursorSet(0,0);
          MIOS_LCD_PrintChar(pot_meter[cur_pot_values[pot_event_map[last_ain_pin][0]]][0]);
          
        	// set LED
    	    if (cur_pot_values[pot_event_map[last_ain_pin][0]]>1)
    	    	MIOS_DOUT_PinSet(led_map[91][0], 0x01);
    	    else
    	    	MIOS_DOUT_PinSet(led_map[91][0], 0x00);
      
        	break;
        	
        default:
        	break;
      }
      last_ain_func=0;
    
      switch (last_din_func) // buton related display update
      {
        case 1:  // current button = flash
          // print pot name
          MIOS_GLCD_FontInit(GLCD_FONT_BIG);
          MIOS_GLCD_GCursorSet(16,0);
          MIOS_LCD_PrintCString(but_name[last_din_pin][0]);
    
        	break;
    
        default:
        	break;
      }
      last_din_func=0;
    }
    The big arrays (like pot_event_map, ...) are defined inside Flash memory:
    const unsigned char pot_event_map[64][4] = {
      // {real channel, function, MIDI message, MIDI number}
      //
      // function: 0   - no action
      //           1   - submaster
      //           2   - grandmaster
      //
      // MIDI message: 0xb0 - control change
      //
      // Base Control defined in BL MIDI Control is equal to 70 (-> 70+...)
      //
      { 0, 1, 0xb0, 70+ 0},  // Submaster 1 
      { 1, 1, 0xb0, 70+ 1},  // Submaster 2 
      { 2, 1, 0xb0, 70+ 2},  // Submaster 3 
      { 3, 1, 0xb0, 70+ 3},  // Submaster 4 
      { 4, 1, 0xb0, 70+ 4},  // Submaster 5 
      { 5, 1, 0xb0, 70+ 5},  // Submaster 6 
      { 6, 1, 0xb0, 70+ 6},  // Submaster 7 
      { 7, 1, 0xb0, 70+ 7},  // Submaster 8 
      { 8, 1, 0xb0, 70+ 8},  // Submaster 9 
      { 9, 1, 0xb0, 70+ 9},  // Submaster 10
      {10, 1, 0xb0, 70+10},  // Submaster 11
      {11, 1, 0xb0, 70+11},  // Submaster 12
      {12, 1, 0xb0, 70+12},  // Submaster 13
      {13, 1, 0xb0, 70+13},  // Submaster 14
      {14, 1, 0xb0, 70+14},  // Submaster 15
      {15, 1, 0xb0, 70+15},  // Submaster 16
      {24, 0, 0xb0, 70+ 0},  //             
      {25, 0, 0xb0, 70+ 0},  //             
      {26, 0, 0xb0, 70+ 0},  //             
      {27, 0, 0xb0, 70+ 0},  //             
      {28, 0, 0xb0, 70+ 0},  //             
      {29, 0, 0xb0, 70+ 0},  //             
      {30, 0, 0xb0, 70+ 0},  //             
      {31, 0, 0xb0, 70+ 0},  //             
      {32, 0, 0xb0, 70+ 0},  //             
      {33, 0, 0xb0, 70+ 0},  //             
      {34, 0, 0xb0, 70+ 0},  //             
      {35, 0, 0xb0, 70+ 0},  //             
      {36, 0, 0xb0, 70+ 0},  //             
      {37, 0, 0xb0, 70+ 0},  //             
      {38, 0, 0xb0, 70+ 0},  //             
      {39, 0, 0xb0, 70+ 0},  //             
      {16, 1, 0xb0, 70+16},  // Submaster 17
      {17, 1, 0xb0, 70+17},  // Submaster 18
      {18, 1, 0xb0, 70+18},  // Submaster 19
      {19, 1, 0xb0, 70+19},  // Submaster 20
      {20, 1, 0xb0, 70+20},  // Submaster 21
      {21, 1, 0xb0, 70+21},  // Submaster 22
      {22, 1, 0xb0, 70+22},  // Submaster 23
      {23, 1, 0xb0, 70+23},  // Submaster 24
      {40, 0, 0xb0, 70+ 0},  //             
      {41, 0, 0xb0, 70+ 0},  //             
      {42, 0, 0xb0, 70+ 0},  //             
      {43, 0, 0xb0, 70+ 0},  //             
      {44, 0, 0xb0, 70+ 0},  //             
      {45, 0, 0xb0, 70+ 0},  //             
      {46, 0, 0xb0, 70+ 0},  //             
      {47, 0, 0xb0, 70+ 0},  //             
      {48, 0, 0xb0, 70+ 0},  //             
      {49, 0, 0xb0, 70+ 0},  //             
      {50, 0, 0xb0, 70+ 0},  //             
      {51, 0, 0xb0, 70+ 0},  //             
      {52, 2, 0xb0, 70+24},  // Grand Master
      {53, 0, 0xb0, 70+ 0},  // not connected            
      {54, 0, 0xb0, 70+ 0},  // not connected            
      {55, 0, 0xb0, 70+ 0},  // not connected            
      {56, 0, 0xb0, 70+ 0},  // not connected            
      {57, 0, 0xb0, 70+ 0},  // not connected            
      {58, 0, 0xb0, 70+ 0},  // not connected            
      {59, 0, 0xb0, 70+ 0},  // not connected            
      {60, 0, 0xb0, 70+ 0},  // not connected            
      {61, 0, 0xb0, 70+ 0},  // not connected            
      {62, 0, 0xb0, 70+ 0},  // not connected            
      {63, 0, 0xb0, 70+ 0},  // not connected            
      };
      
    const unsigned char pot_name[64][8] = {
      // 7 caracters + '0' = 8
      "Sub.  1",  // Submaster 1 
      "Sub.  2",  // Submaster 2 
      "Sub.  3",  // Submaster 3 
      "Sub.  4",  // Submaster 4 
      "Sub.  5",  // Submaster 5 
      "Sub.  6",  // Submaster 6 
      "Sub.  7",  // Submaster 7 
      "Sub.  8",  // Submaster 8 
      "Sub.  9",  // Submaster 9 
      "Sub. 10",  // Submaster 10
      "Sub. 11",  // Submaster 11
      "Sub. 12",  // Submaster 12
      "Sub. 13",  // Submaster 13
      "Sub. 14",  // Submaster 14
      "Sub. 15",  // Submaster 15
      "Sub. 16",  // Submaster 16
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "Sub. 17",  // Submaster 17
      "Sub. 18",  // Submaster 18
      "Sub. 19",  // Submaster 19
      "Sub. 20",  // Submaster 20
      "Sub. 21",  // Submaster 21
      "Sub. 22",  // Submaster 22
      "Sub. 23",  // Submaster 23
      "Sub. 24",  // Submaster 24
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "       ",  //             
      "GMaster",  // Grand Master
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      "       ",  // not connected            
      };
    
    const unsigned char but_event_map[96][5] = {
      // {real channel, function, MIDI message, MIDI number, MIDI value}
      //
      // function: 0 - no action
      //           1 - flash
      //           2 - recall preset
      //           3 - read and send all pot state
      //           4 - add/kill
      //
      // MIDI message: 0xb0 - control change
      //               0xc0 - program (patch) change
      //
      // Base Control defined in BL MIDI Control is equal to 70 (-> 70+...)
      //
      {0,  1, 0xb0, 70+ 0, 0x7f},  // Flash 1 
      {1,  1, 0xb0, 70+ 1, 0x7f},  // Flash 2 
      {2,  1, 0xb0, 70+ 2, 0x7f},  // Flash 3 
      {3,  1, 0xb0, 70+ 3, 0x7f},  // Flash 4 
      {4,  1, 0xb0, 70+ 4, 0x7f},  // Flash 5 
      {5,  1, 0xb0, 70+ 5, 0x7f},  // Flash 6 
      {6,  1, 0xb0, 70+ 6, 0x7f},  // Flash 7 
      {7,  1, 0xb0, 70+ 7, 0x7f},  // Flash 8 
      {9,  1, 0xb0, 70+ 9, 0x7f},  // Flash 10
      {8,  1, 0xb0, 70+ 8, 0x7f},  // Flash 9 
      {11, 1, 0xb0, 70+11, 0x7f},  // Flash 12
      {10, 1, 0xb0, 70+10, 0x7f},  // Flash 11
      {13, 1, 0xb0, 70+13, 0x7f},  // Flash 14
      {12, 1, 0xb0, 70+12, 0x7f},  // Flash 13
      {15, 1, 0xb0, 70+15, 0x7f},  // Flash 16
      {14, 1, 0xb0, 70+14, 0x7f},  // Flash 15
      {24, 2, 0xc0,     0,    0},  // Recall preset 1        
      {25, 2, 0xc0,     1,    0},  // Recall preset 2        
      {26, 2, 0xc0,     2,    0},  // Recall preset 3        
      {27, 2, 0xc0,     3,    0},  // Recall preset 4        
      {28, 2, 0xc0,     4,    0},  // Recall preset 5        
      {29, 2, 0xc0,     5,    0},  // Recall preset 6        
      {30, 2, 0xc0,     6,    0},  // Recall preset 7        
      {31, 2, 0xc0,     7,    0},  // Recall preset 8        
      {33, 2, 0xc0,     9,    0},  // Recall preset 10                           
      {32, 2, 0xc0,     8,    0},  // Recall preset 9                           
      {35, 2, 0xc0,    11,    0},  // Recall preset 12                           
      {34, 2, 0xc0,    10,    0},  // Recall preset 11                           
      {37, 2, 0xc0,    13,    0},  // Recall preset 14                           
      {36, 2, 0xc0,    12,    0},  // Recall preset 13                           
      {39, 2, 0xc0,    15,    0},  // Recall preset 16                           
      {38, 2, 0xc0,    14,    0},  // Recall preset 15                           
      {17, 1, 0xb0, 70+17, 0x7f},  // Flash 18                   
      {16, 1, 0xb0, 70+16, 0x7f},  // Flash 17                   
      {19, 1, 0xb0, 70+19, 0x7f},  // Flash 20                   
      {18, 1, 0xb0, 70+18, 0x7f},  // Flash 19                   
      {41, 2, 0xc0,    17,    0},  // Recall preset 18                           
      {40, 2, 0xc0,    16,    0},  // Recall preset 17                           
      {43, 2, 0xc0,    19,    0},  // Recall preset 20                           
      {42, 2, 0xc0,    18,    0},  // Recall preset 19                           
      {50, 0, 0xb0,     0,    0},  //                            
      {49, 0, 0xb0,     0,    0},  //                            
      {52, 0, 0xb0,     0,    0},  //                             
      {51, 0, 0xb0,     0,    0},  //                            
      {58, 0, 0xb0,     0,    0},  //                            
      {59, 0, 0xb0,     0,    0},  //                            
      {60, 0, 0xb0,     0,    0},  //                            
      {57, 4, 0xb0,     0,    0},  // Add / kill (solo)                           
      {65, 0, 0xb0,     0,    0},  //                            
      {64, 0, 0xb0,     0,    0},  //                            
      {67, 0, 0xb0,     0,    0},  //                            
      {66, 0, 0xb0,     0,    0},  //                            
      {69, 0, 0xb0,     0,    0},  // not connected                            
      {48, 3, 0xb0,     0,    0},  // Read and send all pot state                                       
      {70, 0, 0xb0,     0,    0},  // not connected                                       
      {71, 0, 0xb0,     0,    0},  // not connected                                       
      {72, 0, 0xb0,     0,    0},  // not connected                                       
      {73, 0, 0xb0,     0,    0},  // not connected                                       
      {74, 0, 0xb0,     0,    0},  // not connected                                       
      {75, 0, 0xb0,     0,    0},  // not connected                                       
      {76, 0, 0xb0,     0,    0},  // not connected                                       
      {77, 0, 0xb0,     0,    0},  // not connected                                       
      {78, 0, 0xb0,     0,    0},  // not connected                                       
      {79, 0, 0xb0,     0,    0},  // not connected                           
      {21, 1, 0xb0, 70+21, 0x7f},  // Flash 22                   
      {20, 1, 0xb0, 70+20, 0x7f},  // Flash 21                   
      {23, 1, 0xb0, 70+23, 0x7f},  // Flash 24                   
      {22, 1, 0xb0, 70+22, 0x7f},  // Flash 23                   
      {45, 2, 0xc0,    21,    0},  // Recall preset 22                           
      {44, 2, 0xc0,    20,    0},  // Recall preset 21                           
      {47, 2, 0xc0,    23,    0},  // Recall preset 24                           
      {46, 2, 0xc0,    22,    0},  // Recall preset 23                           
      {54, 0, 0xb0,     0,    0},  //                            
      {53, 0, 0xb0,     0,    0},  //                            
      {56, 0, 0xb0,     0,    0},  //                            
      {55, 0, 0xb0,     0,    0},  //                            
      {62, 0, 0xb0,     0,    0},  //                            
      {61, 0, 0xb0,     0,    0},  //                            
      {68, 0, 0xb0,     0,    0},  //                            
      {63, 0, 0xb0,     0,    0},  //                            
      {80, 0, 0xb0,     0,    0},  // not connected                           
      {81, 0, 0xb0,     0,    0},  // not connected                           
      {82, 0, 0xb0,     0,    0},  // not connected                           
      {83, 0, 0xb0,     0,    0},  // not connected                           
      {84, 0, 0xb0,     0,    0},  // not connected                           
      {85, 0, 0xb0,     0,    0},  // not connected                           
      {86, 0, 0xb0,     0,    0},  // not connected                           
      {87, 0, 0xb0,     0,    0},  // not connected                           
      {88, 0, 0xb0,     0,    0},  // not connected                           
      {89, 0, 0xb0,     0,    0},  // not connected                           
      {90, 0, 0xb0,     0,    0},  // not connected                           
      {91, 0, 0xb0,     0,    0},  // not connected                           
      {92, 0, 0xb0,     0,    0},  // not connected                           
      {93, 0, 0xb0,     0,    0},  // not connected                                       
      {94, 0, 0xb0,     0,    0},  // not connected                           
      {95, 0, 0xb0,     0,    0},  // not connected         
      };
      
    const unsigned char but_name[96][2][9] = {
    	// 2 rows of
    	// 8 caracters + '0' = 9
    	{"Sub.  1 ","        "},  // Flash 1 
      {"Sub.  2 ","        "},  // Flash 2 
      {"Sub.  3 ","        "},  // Flash 3 
      {"Sub.  4 ","        "},  // Flash 4 
      {"Sub.  5 ","        "},  // Flash 5 
      {"Sub.  6 ","        "},  // Flash 6 
      {"Sub.  7 ","        "},  // Flash 7 
      {"Sub.  8 ","        "},  // Flash 8 
      {"Sub. 10 ","        "},  // Flash 10
      {"Sub.  9 ","        "},  // Flash 9 
      {"Sub. 12 ","        "},  // Flash 12
      {"Sub. 11 ","        "},  // Flash 11
      {"Sub. 14 ","        "},  // Flash 14
      {"Sub. 13 ","        "},  // Flash 13
      {"Sub. 16 ","        "},  // Flash 16
      {"Sub. 15 ","        "},  // Flash 15
      {"Recall  ","Preset 1"},  // Recall preset 1        
      {"Recall  ","Preset 2"},  // Recall preset 2        
      {"Recall  ","Preset 3"},  // Recall preset 3        
      {"Recall  ","Preset 4"},  // Recall preset 4        
      {"Recall  ","Preset 5"},  // Recall preset 5        
      {"Recall  ","Preset 6"},  // Recall preset 6        
      {"Recall  ","Preset 7"},  // Recall preset 7        
      {"Recall  ","Preset 8"},  // Recall preset 8        
      {"Recall  ","Preset10"},  // Recall preset 10                           
      {"Recall  ","Preset 9"},  // Recall preset 9                           
      {"Recall  ","Preset12"},  // Recall preset 12                           
      {"Recall  ","Preset11"},  // Recall preset 11                           
      {"Recall  ","Preset14"},  // Recall preset 14                           
      {"Recall  ","Preset13"},  // Recall preset 13                           
      {"Recall  ","Preset16"},  // Recall preset 16                           
      {"Recall  ","Preset15"},  // Recall preset 15                           
      {"Sub. 18 ","        "},  // Flash 18                   
      {"Sub. 17 ","        "},  // Flash 17                   
      {"Sub. 20 ","        "},  // Flash 20                   
      {"Sub. 19 ","        "},  // Flash 19                   
      {"Recall  ","Preset18"},  // Recall preset 18                           
      {"Recall  ","Preset17"},  // Recall preset 17                           
      {"Recall  ","Preset20"},  // Recall preset 20                           
      {"Recall  ","Preset19"},  // Recall preset 19                           
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                             
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"Solo ON ","Solo OFF"},  // Add / kill (solo)                           
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  // not connected                            
      {"        ","        "},  // Read and send all pot state                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                           
      {"Sub. 22 ","        "},  // Flash 22                   
      {"Sub. 21 ","        "},  // Flash 21                   
      {"Sub. 24 ","        "},  // Flash 24                   
      {"Sub. 23 ","        "},  // Flash 23                   
      {"Recall  ","Preset22"},  // Recall preset 22                           
      {"Recall  ","Preset21"},  // Recall preset 21                           
      {"Recall  ","Preset24"},  // Recall preset 24                           
      {"Recall  ","Preset23"},  // Recall preset 23                           
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  //                            
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected                                       
      {"        ","        "},  // not connected                           
      {"        ","        "},  // not connected 
      };

    When I disable the switch(last_ain_func) or switch(last_ain_func) there isn't any problem. But when I enable both it works but it just like if the MIOS_GLCD_FONT was corrupted: the MIOS is rebooting and the © T.K. aren't visible (blank display or erratic characters). All the other parts are still working (other fonts, AIN, DIN, DOUT, MIDI send, ...). I have to reload the MIOS itself in order to get back the display.

    What could be the problem? Too much code inside this function? (I've tried to put this portion of code inside the void Tick(void) function: same problem). I'm very lost inside this problem. Any idea is welcome.

    EDIT

    This problem is not only due to the void DISPLAY_Tick(void) function. When I just add an if statement in the void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) function it produces the same problem.

    Do you think my code is too big and overwrite the memory area used for the MIOS_GLCD_FONT? I'm using a PIC18F452. How can I verify this?

    Best regards,

    nsunier

  16. In this new structure, I can't find main.h

    I was using it to define these parameters

    /////////////////////////////////////////////////////////////////////////////
    // Global definitions
    /////////////////////////////////////////////////////////////////////////////
    
    #define AIN_NUMBER_INPUTS     53    // 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        12    // 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
    and
    /////////////////////////////////////////////////////////////////////////////
    // Global Types
    /////////////////////////////////////////////////////////////////////////////
    
    // status of analog toolbox application
    typedef union {
      struct {
        unsigned ALL:8;
      };
      struct {
        unsigned DISPLAY_UPDATE_REQ:1;  // requests a display update
      };
    } app_flags_t;
    
    
    /////////////////////////////////////////////////////////////////////////////
    // Export global variables
    /////////////////////////////////////////////////////////////////////////////
    extern app_flags_t app_flags;
    
    #endif /* _MAIN_H */

    How can I do the same thing in the new structure?

×
×
  • Create New...