Ron snagged my answer. I have already created an MP3 player with a VMusic2 Module, which I later gave away in TFOTTJB on my old website. I was toying with the idea of making a more robust one with the VMusic3 and a Propeller chip, but the BS2 could be used.
The CY-T16 command set looks harder to use than the VMUSIC2/3. But being in the Philippines, they may not have access to VMUSIC items. But it still could be done. I have not seen any BS2 code available for the CYT16.
Hi guys thanks again for the reply. Our problem now is we don't know on how to start the initial process of the program using basic stamp 2. We know on how the system will work and its process because we created the visual basic program in able for the user to access the system. Our old microcontroller is written in assembly language to control the CY-T16 module. Its hard for us to rewrite again the whole process using basic stamp 2. We just need to know on how the bs2 to control the CY-T16 module.
My comment was based on a module with a serial interface. As has been done with the VMusic 2 most serial MP3 modules can be controlled by the BASIC Stamp MCU. However if you're using a decoder IC by itself then the BS2 just doesn't have the resources to realize something like this.
I see someone linked a post by Scary Terry using the VMusic 2 with a BS2. If you're using a serial interface module that would be the best example on how one might go about this on a BS2. I would link my application, but I do not yet have all content back up on my website at this time.
Based on the attached file, all you have to do is issue serial commands to play, (SEROUT)etc.
Such as Playback "7E FF 06 0D 00 00 00 FE EE EF "
The default baud is 9600. The BS2 can send at 9600, but may have problems receiving at the rat. The module is supposed to be able to select baud rates, but I could not find and instructing to allow you to drop down to 4800.
The module is nor supported very well as a whole on the internet. It may have been cheap, but there are more supported modules out there like the VMUSIC 2/3 that have code for the BS2.
.
There seems to be this stigma with the BS2 and serial data reception at 9600 bps. In every application where I am communicating with the BS2 serially an the device supports it, I use 9600 baud and it has always worked flawlessly. The BS2 has no issues sending or receiving data at 9600 baud.
The issues happen when you start using certain formatters on the data which takes more time to process or if the data is coming in at a constant rate with no breaks. Neither of these situations are typical, yet everyone has just defaulted to warning that the BS2 can't receive well at 9600 bps. We should not propagate that stigma. :cool:
Be careful to keep the SERIN statements simple since the Basic Stamp is slow and the SERIN statement is marginal at 9600 Baud (it can miss characters).
Working send/receive at 9600 would work for the OP>
The issues happen when you start using certain formatters on the data which takes more time to process or if the data is coming in at a constant rate with no breaks.
The SERIN formatters really impressed me when I first read the PBASIC manual and I was disappointed when I learned that you have to be very careful using them because of data overrun problems. This is where a Propeller-based Stamp could really help.
The BS2p really excels here because not only is it faster, but you have the option to grab up to 126 bytes of data directly into SPRAM and deal with it from there. The BASIC Stamps can handle a lot more than people give them credit for, but formatting the incoming data stream can hinder performance. That and there's not a lot of variable space on a BS2 to deal with large chunks of incoming serial data.
Still, Parallax has made devices using the AppMod connector that ran at 19.2K and responded at that rate as well, just fine. Of course, you're dealing with relatively small packets of data. :nerd:
The SERIN formatters really impressed me when I first read the PBASIC manual and I was disappointed when I learned that you have to be very careful using them because of data overrun problems. This is where a Propeller-based Stamp could really help.
The good news is that some formatters (HEXn and DECn) work just fine at 9600. WAIT and WAITSTR don't.
The BS2p really excels here because not only is it faster, but you have the option to grab up to 126 bytes of data directly into SPRAM and deal with it from there. The BASIC Stamps can handle a lot more than people give them credit for, but formatting the incoming data stream can hinder performance. That and there's not a lot of variable space on a BS2 to deal with large chunks of incoming serial data.
Still, Parallax has made devices using the AppMod connector that ran at 19.2K and responded at that rate as well, just fine. Of course, you're dealing with relatively small packets of data. :nerd:
The fact that there is not a lot of variable space on the BS2 is why I thought that the SERIN formatters were so clever. They allow you to handle fairly complex strings without having to buffer all of the characters.
Hi guys thanks again for the reply. Our problem now is we don't know on how to start the initial process of the program using basic stamp 2. We know on how the system will work and its process because we created the visual basic program in able for the user to access the system. Our old microcontroller is written in assembly language to control the CY-T16 module. Its hard for us to rewrite again the whole process using basic stamp 2. We just need to know on how the bs2 to control the CY-T16 module.
Could you post the PIC code so we could take a look at it? That could be a start.
Hi guys thanks again for the reply. Our problem now is we don't know on how to start the initial process of the program using basic stamp 2. We know on how the system will work and its process because we created the visual basic program in able for the user to access the system. Our old microcontroller is written in assembly language to control the CY-T16 module. Its hard for us to rewrite again the whole process using basic stamp 2. We just need to know on how the bs2 to control the CY-T16 module.
You refer to it as a module...do you have a link to the exact product you purchased? That would also help.
Hi guys thanks again for the reply. Our problem now is we don't know on how to start the initial process of the program using basic stamp 2. We know on how the system will work and its process because we created the visual basic program in able for the user to access the system. Our old microcontroller is written in assembly language to control the CY-T16 module. Its hard for us to rewrite again the whole process using basic stamp 2. We just need to know on how the bs2 to control the CY-T16 module.
You refer to it as a module...do you have a link to the exact product you purchased? That would also help.
Hi guys thanks again for the reply. Our problem now is we don't know on how to start the initial process of the program using basic stamp 2. We know on how the system will work and its process because we created the visual basic program in able for the user to access the system. Our old microcontroller is written in assembly language to control the CY-T16 module. Its hard for us to rewrite again the whole process using basic stamp 2. We just need to know on how the bs2 to control the CY-T16 module.
Could you post the PIC code so we could take a look at it? That could be a start.
Is there any other way to start? because the source codes for pic is saved in dos computer and we dont have a floppy disk drive as of now.
Hi guys thanks again for the reply. Our problem now is we don't know on how to start the initial process of the program using basic stamp 2. We know on how the system will work and its process because we created the visual basic program in able for the user to access the system. Our old microcontroller is written in assembly language to control the CY-T16 module. Its hard for us to rewrite again the whole process using basic stamp 2. We just need to know on how the bs2 to control the CY-T16 module.
Could you post the PIC code so we could take a look at it? That could be a start.
Is there any other way to start? because the source codes for pic is saved in dos computer and we dont have a floppy disk drive as of now.
Of course there is another way, and based on the data sheet information this chip should work just fine for playing back MP3 files from an SD card. No doubt that the BS2 can send serial commands to control the CY-T16 V1.0 either. To get some idea of how to proceed we need to figure out if the BS2 has enough memory for the program and schedules, and if a Real Time Clock chip is needed for the scheduling.
So, how many events need to be stored, and do you need a clock chip?
Based on the attached file, all you have to do is issue serial commands to play, (SEROUT)etc.
Such as Playback "7E FF 06 0D 00 00 00 FE EE EF "
The default baud is 9600. The BS2 can send at 9600, but may have problems receiving at the rat. The module is supposed to be able to select baud rates, but I could not find and instructing to allow you to drop down to 4800.
The module is nor supported very well as a whole on the internet. It may have been cheap, but there are more supported modules out there like the VMUSIC 2/3 that have code for the BS2.
.
Mr.Publison, my question is bs2 can send that hexadecimal command? and how we can send that hexadecimals from bs2 to CY-T16 v1.1?? can u give us a sample for that? TIA
yes we do have gps module for the real time clock. I've already knew the process on how the basic stamp 2 receive data from gps. We need to export and save songs to the mp3 and sync the schedule so the device will compare its schedule to gps data time. that is all the process we need for the mp3 module.
Based on the attached file, all you have to do is issue serial commands to play, (SEROUT)etc.
Such as Playback "7E FF 06 0D 00 00 00 FE EE EF "
The default baud is 9600. The BS2 can send at 9600, but may have problems receiving at the rat. The module is supposed to be able to select baud rates, but I could not find and instructing to allow you to drop down to 4800.
The module is nor supported very well as a whole on the internet. It may have been cheap, but there are more supported modules out there like the VMUSIC 2/3 that have code for the BS2.
.
Mr.Publison, my question is bs2 can send that hexadecimal command? and how we can send that hexadecimals from bs2 to CY-T16 v1.1?? can u give us a sample for that? TIA
' {$STAMP BS2}
' {$PBASIC 2.5}
A VAR Byte
B VAR Byte
C VAR Byte
D VAR Byte
E VAR Byte
F VAR Byte
G VAR Byte
H VAR Byte
I VAR Byte
J VAR Byte
A = $7E
B = $FF
C = $06
D = $0F
E = $00
F = $01
G = $01
H = $FF
I = $E6
J = $EF
SEROUT 16,84,[A,B,C,D,E,F,G,H,I,J]
Is this possible that our CY T16 MP3 module will accept this codes from basic stamp 2? Attached file is the list of the serial commands examples for our MP3 module. Please see attachment.
You can also mix constants and variables. You can also send 16 bit words as two bytes (LSB,MSB). The Stamp Manual has examples of all the various options.
Best way to find out how well a Stamp will work for you would be to connect a BS2 and your MP3 module and experiment. Try sending some straightforward commands to the module, enough to select one track and play it ... then see what happens. Maybe you can try one of your existing PIC controllers and compare the signal to the module using the PIC to play one track vs the BS2.
Hi guys im back again, can you check this codes guys?
' {$STAMP BS2}
' {$PBASIC 2.5}
'----Variables
receive VAR Byte
song100 VAR Byte
song010 VAR Byte
song001 VAR Byte
command VAR Byte
'----Constant
play CON $7E
puse CON $A1
playPuse CON $A2
stp CON $A3
volAdj CON $A4
f10 CON $30
f01 CON $31
start CON $7E
datLen CON $07
baud CON 9213
'
I/O Definitions----
send PIN 0
'
Main Program
DO
'DEBUG "enter song hundred example song name 100.mp3 enter 1",CR
'DEBUGIN DEC1 receive
song100 = "0"
'DEBUG "enter song tens example song name 010.mp3 enter 1",CR
'DEBUGIN DEC1 receive
song010 = "0"
'DEBUG "enter song ones example song name 001.mp3 enter 1",CR
'DEBUGIN DEC1 receive
song001 = 3
DEBUG "enter 5 to play song",CR
DEBUGIN DEC1 receive
DEBUG ? song100,CR
DEBUG ? song010,CR
DEBUG ? song001,CR
Comments
Sir Chris do you think can u help us doing it with basic stamp 2? just an initial codes for me and cydelcamat to start our project..? TIA
I'm sorry, but I do not have the available resources to assist you in development of this project. To be honest re-reading some of the posts (seems there was more than one thread), I am unclear if you're using an MP3 decoder IC or a module such as: http://cashway.en.alibaba.com/product/1566099870-803056631/32GB_SD_Card_CY_T16_MP3_Player_Module_RS232_Control.html
My comment was based on a module with a serial interface. As has been done with the VMusic 2 most serial MP3 modules can be controlled by the BASIC Stamp MCU. However if you're using a decoder IC by itself then the BS2 just doesn't have the resources to realize something like this.
I see someone linked a post by Scary Terry using the VMusic 2 with a BS2. If you're using a serial interface module that would be the best example on how one might go about this on a BS2. I would link my application, but I do not yet have all content back up on my website at this time.
Such as Playback "7E FF 06 0D 00 00 00 FE EE EF "
The default baud is 9600. The BS2 can send at 9600, but may have problems receiving at the rat. The module is supposed to be able to select baud rates, but I could not find and instructing to allow you to drop down to 4800.
The module is nor supported very well as a whole on the internet. It may have been cheap, but there are more supported modules out there like the VMUSIC 2/3 that have code for the BS2.
.
There seems to be this stigma with the BS2 and serial data reception at 9600 bps. In every application where I am communicating with the BS2 serially an the device supports it, I use 9600 baud and it has always worked flawlessly. The BS2 has no issues sending or receiving data at 9600 baud.
The issues happen when you start using certain formatters on the data which takes more time to process or if the data is coming in at a constant rate with no breaks. Neither of these situations are typical, yet everyone has just defaulted to warning that the BS2 can't receive well at 9600 bps. We should not propagate that stigma. :cool:
Working send/receive at 9600 would work for the OP>
The BS2p really excels here because not only is it faster, but you have the option to grab up to 126 bytes of data directly into SPRAM and deal with it from there. The BASIC Stamps can handle a lot more than people give them credit for, but formatting the incoming data stream can hinder performance. That and there's not a lot of variable space on a BS2 to deal with large chunks of incoming serial data.
Still, Parallax has made devices using the AppMod connector that ran at 19.2K and responded at that rate as well, just fine. Of course, you're dealing with relatively small packets of data. :nerd:
The good news is that some formatters (HEXn and DECn) work just fine at 9600. WAIT and WAITSTR don't.
Could you post the PIC code so we could take a look at it? That could be a start.
You refer to it as a module...do you have a link to the exact product you purchased? That would also help.
:cool:
http://www.cashwaytechnology.com/eproducts/72.html here's the link for the module Mr. Chris Savage.
Is there any other way to start? because the source codes for pic is saved in dos computer and we dont have a floppy disk drive as of now.
Of course there is another way, and based on the data sheet information this chip should work just fine for playing back MP3 files from an SD card. No doubt that the BS2 can send serial commands to control the CY-T16 V1.0 either. To get some idea of how to proceed we need to figure out if the BS2 has enough memory for the program and schedules, and if a Real Time Clock chip is needed for the scheduling.
So, how many events need to be stored, and do you need a clock chip?
Mr.Publison, my question is bs2 can send that hexadecimal command? and how we can send that hexadecimals from bs2 to CY-T16 v1.1?? can u give us a sample for that? TIA
Have you downloaded the Basic Stamp Toolkit?
https://www.parallax.com/downloads/basic-stamp-editor-software-windows
It includes the Basic Stamp Manual in the help menu. Look under SEROUT. It shows it has a HEX qualifier for output.
As far as I can tell, it is not a module that is supported very well.
' {$PBASIC 2.5}
A VAR Byte
B VAR Byte
C VAR Byte
D VAR Byte
E VAR Byte
F VAR Byte
G VAR Byte
H VAR Byte
I VAR Byte
J VAR Byte
A = $7E
B = $FF
C = $06
D = $0F
E = $00
F = $01
G = $01
H = $FF
I = $E6
J = $EF
SEROUT 16,84,[A,B,C,D,E,F,G,H,I,J]
Is this possible that our CY T16 MP3 module will accept this codes from basic stamp 2? Attached file is the list of the serial commands examples for our MP3 module. Please see attachment.
SEROUT 18,84,[$7E,$FF,$06,$0F,$00,$01,$01,$FF,$E6,$EF]
You can also mix constants and variables. You can also send 16 bit words as two bytes (LSB,MSB). The Stamp Manual has examples of all the various options.
' {$STAMP BS2}
' {$PBASIC 2.5}
'----Variables
receive VAR Byte
song100 VAR Byte
song010 VAR Byte
song001 VAR Byte
command VAR Byte
'----Constant
play CON $7E
puse CON $A1
playPuse CON $A2
stp CON $A3
volAdj CON $A4
f10 CON $30
f01 CON $31
start CON $7E
datLen CON $07
baud CON 9213
'
I/O Definitions----
send PIN 0
'
Main Program
DO
'DEBUG "enter song hundred example song name 100.mp3 enter 1",CR
'DEBUGIN DEC1 receive
song100 = "0"
'DEBUG "enter song tens example song name 010.mp3 enter 1",CR
'DEBUGIN DEC1 receive
song010 = "0"
'DEBUG "enter song ones example song name 001.mp3 enter 1",CR
'DEBUGIN DEC1 receive
song001 = 3
DEBUG "enter 5 to play song",CR
DEBUGIN DEC1 receive
DEBUG ? song100,CR
DEBUG ? song010,CR
DEBUG ? song001,CR
IF receive = 5 THEN
GOSUB Play1
ENDIF
LOOP
Play1:
SEROUT 0,84,[$7E,$FF,$06,$0F,$00,$01,$01,$FF,$E6,$EF]
DEBUG HEX2 start,HEX2 datLEn,HEX2 play,HEX2 f10,HEX2 f01,HEX2 song100,HEX2 song010,HEX2 song001,HEX2 start,CR,CR
RETURN