mikromedia-for-pic18fj and mp3

Post your requests and ideas on the future development of Visual TFT Software.
Post Reply
Author
Message
soltron
Posts: 5
Joined: 24 Jan 2011 07:09

mikromedia-for-pic18fj and mp3

#1 Post by soltron » 11 Jun 2012 06:51

hello,
I just bought the board-for-mikromedia pic18fj,
I was looking for an example of mp3 player written in visual tft MIKROBASIC
thanks
Marco

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: mikromedia-for-pic18fj and mp3

#2 Post by dejan.odabasic » 12 Jun 2012 12:44

Hello,

please take a look at PlayerMp3 project on LibStock:
http://www.libstock.com/projects/view/32/playermp3

For now code is written only in mikroC.

Best regards.

henk59
Posts: 9
Joined: 02 Jan 2015 16:17

Re: mikromedia-for-pic18fj and mp3

#3 Post by henk59 » 02 Jan 2015 16:34

Well shortly I have received the mmb 18FJ Rev. 1.10

The microC Pro compiler giv' pages full declaration faults and errors starting at first TFT screen, a big list.
Compiler stops and no Hex is created due many issues.

The original hex from the author giv' only a pure white screen, nothing more.

And the PlayerMP3 second generation; well I can't load the Hex file because it will overwrite the protected Bootloader,
so it refuse to flash the memory!

And also here the microC Pro compiler produce also declaration faults and errors.

How to to go further?
Because my main goal is a nice working MP3 player from mmb 18FJ.

henk59
Posts: 9
Joined: 02 Jan 2015 16:17

Re: mikromedia-for-pic18fj and mp3

#4 Post by henk59 » 08 Jan 2015 16:35

Oke, I spend some hours and it seems to be the hardware from 1.05 to 1.10 is quite different.
I/O lines to the LCD are changed, but I could correct this in source, so the LCD is working.

The sound chip vs1011 to vs1053 however is different, but somehow compatible.
The big difference is that the DCLK lines and the SDATA lines are unused(?) resp. GPIO2 and GPIO3
and several IO pins are tied via 10KOhm to ground.

So the mp3.c part must be rewritten, and I try to learn "C" so it will cost many hours when I get some results in month's or years...
I hope that I'll get some help here.

Thanks.

henk.

User avatar
darko.minic
Posts: 747
Joined: 01 Dec 2014 11:10

Re: mikromedia-for-pic18fj and mp3

#5 Post by darko.minic » 09 Jan 2015 15:17

Hello,

You can try to replace part of code related to TFT module connections
and Touch Panel module connections with this part of code:

Code: Select all

// TFT module connections
char TFT_DataPort at PORTJ;
sbit TFT_RST at LATD3_bit;
sbit TFT_BLED at LATC2_bit;
sbit TFT_RS at LATE0_bit;
sbit TFT_CS at LATD2_bit;
sbit TFT_RD at LATH1_bit;
sbit TFT_WR at LATH2_bit;
char TFT_DataPort_Direction at TRISJ;
sbit TFT_RST_Direction at TRISD3_bit;
sbit TFT_BLED_Direction at TRISC2_bit;
sbit TFT_RS_Direction at TRISE0_bit;
sbit TFT_CS_Direction at TRISD2_bit;
sbit TFT_RD_Direction at TRISH1_bit;
sbit TFT_WR_Direction at TRISH2_bit;
// End TFT module connections

// Touch Panel module connections
sbit DriveX_Left at LATA0_bit;
sbit DriveX_Right at LATD7_bit;
sbit DriveY_Up at LATA1_bit;
sbit DriveY_Down at LATD4_bit;
sbit DriveX_Left_Direction at TRISA0_bit;
sbit DriveX_Right_Direction at TRISD7_bit;
sbit DriveY_Up_Direction at TRISA1_bit;
sbit DriveY_Down_Direction at TRISD4_bit;
// End Touch Panel module connections
Also you should replace TFT initialization routine with:

Code: Select all

TFT_Init_ILI9341_8bit(320, 240);
Regards,
Darko

henk59
Posts: 9
Joined: 02 Jan 2015 16:17

Re: mikromedia-for-pic18fj and mp3

#6 Post by henk59 » 09 Jan 2015 23:14

Thank you Darko.
I had this already sofar, as you can read already above.

Spend many hours to get the mp3.c right, but the compiler beats me with every " void MP3_SCI_Write(char adress, unsign int data_in) "
statement, I'll think it's editor related because I edit the file on my Apple computer but somehow the editor/compiler produce in al those edit parts an error.
Like, void missing ; or , ( } you name it but it is there.

I transfer most routine from vs1011 into the right routine for the 1053.
I can't see the errors sofar but the compiler does.
If I can't find it, I will on request upload both files Mp3.c and PlayerMP3.c
I don't wont to mesh up the topic on forehand.

Regards.
Henk.

henk59
Posts: 9
Joined: 02 Jan 2015 16:17

Re: mikromedia-for-pic18fj and mp3

#7 Post by henk59 » 11 Jan 2015 20:25

In the situation the compiler wont start is because a vanished " } " I spend many hours to see that, because the copy/paste thing, it wasn't included.

Now it's playing the songs, I have edit many parts in mp3.c and a few lines in PlayerMp3.c and a little bit in some .h files.
The Touch-Screen is difficult to invoke but doable.

a novice or better a beginner... like me. :roll:

User avatar
darko.minic
Posts: 747
Joined: 01 Dec 2014 11:10

Re: mikromedia-for-pic18fj and mp3

#8 Post by darko.minic » 12 Jan 2015 10:58

Hello Henk,

Did you managed to find solution for your problem?

I have replaced part of code related to TFT module connections and Touch Panel module connections,
and TFT initialization routine as I mentioned in post before.

Project compiles successfully, Touchpanel and TFT working, and MP3 player play songs as well.
So if you still have problem I can send you my rewritten project.

Regards,
Darko

henk59
Posts: 9
Joined: 02 Jan 2015 16:17

Re: mikromedia-for-pic18fj and mp3

#9 Post by henk59 » 12 Jan 2015 11:08

Hello Darko.

Sure, so I can compare and learn.

I have still an aligment problem with touch-control, only the Play (touch-button) works fine,
the rest of the buttons is more difficult to find the touch pad itself.

You may mail it to me, but better upload on Libstock. :)
Thank you so much.

Henk.

User avatar
darko.minic
Posts: 747
Joined: 01 Dec 2014 11:10

Re: mikromedia-for-pic18fj and mp3

#10 Post by darko.minic » 13 Jan 2015 14:07

Hello Henk,

In attachment you can find rewritten example for MP3 Player.

Alignment problem with touch-control should be fixed, so you can compare with your example.

Regards,
Attachments
PlayerMp3.zip
(812.06 KiB) Downloaded 306 times

henk59
Posts: 9
Joined: 02 Jan 2015 16:17

Re: mikromedia-for-pic18fj and mp3

#11 Post by henk59 » 13 Jan 2015 15:16

Hello Darko.

Indeed the touch is working fine, I'll studie this (I can't find easy to learn routine's at this moment elsewhere).

But it play, but NOT a sound to hear, so that part isn't working here on my mmb.
I'll upload my adapted mp3.c wich is rewritten to vs1053 but renember is beta, in truely beginners style.
Attachments
Mp3.c.zip
(4.5 KiB) Downloaded 226 times

User avatar
darko.minic
Posts: 747
Joined: 01 Dec 2014 11:10

Re: mikromedia-for-pic18fj and mp3

#12 Post by darko.minic » 14 Jan 2015 09:20

Hello Henk,

You should now try to implement your part of code which is rewritten (for vs1053) in code that I send you.
After that you should hear music.

Best regards,

henk59
Posts: 9
Joined: 02 Jan 2015 16:17

Re: mikromedia-for-pic18fj and mp3

#13 Post by henk59 » 14 Jan 2015 10:46

Hello Darko.

Yes, Indeed.

But I have to include the SPI1 init in PlayerMp3.c and just before MP3_Init()
This has to be done because the SPI1 must be setup before it goes to init MP3,
Because the SDATA and the DCLK aren't used.

Code: Select all

// Initialize
//
void Init()
{
//
SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV16, _SPI_DATA_SAMPLE_END, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);
// just before MP3_Init();
  MP3_Init();
} 
Then the music plays, with your code.
Thank you for your time and effort.

Best regards,
Henk.

Post Reply

Return to “Visual TFT Wish List”