<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=4&amp;t=1611" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2007-08-12T20:21:24+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=4&amp;t=1611</id>
<entry>
<author><name><![CDATA[NovaOne]]></name></author>
<updated>2007-08-12T20:21:24+01:00</updated>
<published>2007-08-12T20:21:24+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10343#p10343</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10343#p10343"/>
<title type="html"><![CDATA[SP03 - No Luck]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10343#p10343"><![CDATA[
I also noticed you have added the Start_Speech and say_hello  routines which are just the FillSpeechBuffer routine split in two?<br /><br /><br />Just add this after GOSUB FillSpeechBuffer in the Main loop:<br /><br /><br />I2cAddr = &amp;Hc4 'SP03 default address <br />I2cReg = 0 'Command Register <br />I2cData = &amp;H40 'Speak Buffer command <br />GOSUB I2cByteWrite <br /><br />Or you could delete the contents of your Start_Speech routine and insert the above code. Then GOSUB Start_Speech after GOSUB FillSpeechBuffer<br /><br />Chris<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=663">NovaOne</a> — Sun Aug 12, 2007 8:21 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[NovaOne]]></name></author>
<updated>2007-08-12T19:49:21+01:00</updated>
<published>2007-08-12T19:49:21+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10342#p10342</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10342#p10342"/>
<title type="html"><![CDATA[SP03 - No Luck]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10342#p10342"><![CDATA[
You are missing a few of my original lines:<br /><br />You should have filled the speech buffer, but<br /><blockquote class="uncited"><div><br />The datasheet then seems to say that if you wish to speak the contents of the buffer, you send the SPKBUF command &amp;H40 <br /><br />I2cAddr = &amp;Hc4 'SP03 default address <br />I2cReg = 0 'Command Register <br />I2cData = &amp;H40 'Speak Buffer command <br />GOSUB I2cByteWrite<br /></div></blockquote><br /><br />The orignal code I posted <span style="font-weight: bold">does work</span>, please compare your code with my original for any more mistakes.<br /><br />Also to speek predefined phrases:<br /><blockquote class="uncited"><div><br />Using the free configuration program you can load upto 30 predefined phrases into memory. This should play a phrase back:  <br /><br />I2cAddr = &amp;Hc4 'SP03 default address <br />I2cReg = 0 'Command Register <br />I2cData = &amp;H01 'Speak 1st predefined phrase <br />GOSUB I2cByteWrite<br /></div></blockquote><br /><br />I'll try to help as much as i can...<br /><br />Chris<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=663">NovaOne</a> — Sun Aug 12, 2007 7:49 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JavaRN]]></name></author>
<updated>2007-08-12T19:21:04+01:00</updated>
<published>2007-08-12T19:21:04+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10340#p10340</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10340#p10340"/>
<title type="html"><![CDATA[SP03 - No Luck]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1611&amp;p=10340#p10340"><![CDATA[
I've connected everything for my SP03, but I cannot communicate.  I tested the connections with a multimeter and everything seems ok the parts seems to be connected in the right way.  I am including a copy of the program I am using to connect to the SP03, if anyone can see any errors (logical) please tell me because I cannot find anything wrong:<br /><br />(Note:  This is not my work, I got it from NovaOne, just a copy and paste, may be I forgot something)<br /><br />' Constants and vars for I2C comm<br />CONST SDA = 15 'Use port 15 for Data, constant SDA<br />CONST SCL = 16 'Use port 16 for Clock, constant SCL<br /><br />DIM I2cBuf AS BYTE 'Buffer Byte<br />DIM I2cAddr AS BYTE 'Address Byte<br />DIM I2cReg AS BYTE 'Register Byte<br />DIM I2cData AS BYTE 'Data Byte<br /><br /><br />DIM I2cBit AS BYTE 'Bit index for shifting loops<br />DIM I2cTx AS BYTE 'Transmitted Byte<br />DIM I2cRx AS BYTE 'Recieved Byte<br /><br /><br />DELAY 6000<br />MUSIC &quot;c&quot;<br /><br />Main:<br /><br />I2cAddr = &amp;Hc4 'SP03 default address<br /><br />GOSUB FillSpeechBuffer<br /><br /><br /><br />GOTO main<br /><br /><br />FillSpeechBuffer:<br />GOSUB I2cStart 'Start sequence<br />I2cBuf = I2cAddr<br />GOSUB I2cOutByte 'Send SP03 address<br />I2cBuf = 0<br />GOSUB I2cOutByte 'Select Command Register<br />GOSUB I2cOutByte 'Send NOP<br />GOSUB I2cOutByte 'Max volume = Zero??<br />I2cBuf = &amp;H05<br />GOSUB I2cOutByte 'Speech Speed<br />I2cBuf = &amp;H03<br />GOSUB I2cOutByte 'Speech Pitch<br />'** Followed by the ASCII characters (85 maximum) of the words you would like RN to say for example, Hello<br />I2cBuf = &amp;H48 'H<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H65 'e<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H6C 'l<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H6C 'l<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H06F 'o<br />GOSUB I2cOutByte<br />I2cBuf = 0 'Nul<br />GOSUB I2cOutByte<br />GOSUB I2cStop<br />RETURN<br /><br />' Start speech<br />Start_Speech:<br />GOSUB I2cStart 'Start sequence<br />I2cBuf = I2cAddr<br />GOSUB I2cOutByte 'Send SP03 address<br />I2cBuf = 0<br />GOSUB I2cOutByte 'Select Command Register<br />GOSUB I2cOutByte 'Send NOP<br />I2cBuf = 0<br />GOSUB I2cOutByte 'Max volume = Zero??<br />I2cBuf = &amp;H05<br />GOSUB I2cOutByte 'Speech Speed<br />I2cBuf = &amp;H03<br />GOSUB I2cOutByte 'Speech Pitch<br />RETURN<br /><br />' Say Something<br />say_hello:<br />I2cBuf = &amp;H48 'H<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H65 'e<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H6C 'l<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H6C 'l<br />GOSUB I2cOutByte<br />I2cBuf = &amp;H06F ' o<br />GOSUB I2cOutByte<br />I2cBuf = 0 'Nul<br />GOSUB I2cOutByte<br />GOSUB I2cStop<br /><br />RETURN<br /><br /><br />' Start the I2C communcation<br />I2cStart:<br />OUT SDA,1 'Ensure data and clock lines are both high<br />OUT SCL,1<br />OUT SDA,0 'Sent start bit, ie lower data line while clock line is high<br />OUT SCL,0 'Lower clock line ready to start clocking data.<br />RETURN<br /><br />' Stop the I2C communication<br />I2cStop:<br />OUT SCL,1<br />OUT SDA,1 'Sent stop bit, ie raise data line while clock high<br />RETURN <br /><br />I2cByteWrite:<br />GOSUB I2cStart 'Send start bit<br />I2cBuf = I2cAddr<br />GOSUB I2cOutByte 'Send module address<br />I2cBuf = I2cReg<br />GOSUB I2cOutByte 'Send the register number you wish to read<br />I2cBuf = I2cData<br />GOSUB I2cOutByte 'Send Data<br />GOSUB I2cStop 'Send stop bit<br />RETURN<br /><br />' reading a byte from the I2C device<br />I2cByteRead:<br />GOSUB I2cStart 'Send start bit<br />I2cBuf = I2cAddr<br />GOSUB I2cOutByte 'Send module address<br />I2cBuf = I2cReg<br />GOSUB I2cOutByte 'Send the register number you wish to read<br /><br />GOSUB I2cStart 'Send the required repeated start bit<br />I2cBuf = I2cAddr OR 1 'set write enable bit<br />GOSUB I2cOutByte 'Send the module address with write enable bit set<br /><br />GOSUB I2cInByte 'Read required data<br />I2cData = I2cBuf 'copy data from buffer Byte<br />GOSUB I2cStop 'Send stop bit<br />RETURN<br /><br />' Output a byte to the I2C device<br />I2cOutByte:<br /><br />FOR I2cBit = 0 TO 7<br />I2cTx = I2cBuf AND &amp;H80 'Mask off all but the Most significant bit<br />IF I2cTx &lt;&gt; 0 THEN 'Test the BSB and set up data ie<br />OUT SDA,1 'data = 1<br />ELSE<br />OUT SDA,0 'data = 0<br />ENDIF<br /><br />OUT SCL, 1<br />OUT SCL, 0 'Clock the data out<br /><br />I2cBuf = I2cBuf &lt;&lt; 1<br />NEXT I2cBit<br /><br />OUT SDA, 0<br />OUT SCL, 1<br />OUT SCL, 0 'clock in the Ack' bit, and ignore it.<br />RETURN<br /><br /><br />' Reading a byte from the I2C device<br />I2cInByte:<br /><br />I2cBuf =0 'clear input buffer byte<br />OUT SDA, 1<br /><br />I2cRx = IN(SDA) 'release data line for input<br />FOR I2cBit = 0 TO 7<br />OUT SCL, 1<br />I2cRx = IN(SDA) 'Read one bit of the byte<br />OUT SCL, 0 'Pull clock low, ready for next bit<br />I2cBuf = I2cBuf &lt;&lt; 1 'Shift the Data buffer one bit left<br /><br />IF I2cRx &lt;&gt; 0 THEN<br />I2cBuf = I2cBuf +1 'if the data is a one set the Least Significant bit in the buffer<br />ENDIF<br />NEXT I2cBit<br /><br />OUT SDA, 0<br />OUT SCL, 1<br />OUT SCL, 0 'clock in the Ack' bit, and ignore it.<br />RETURN<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=546">JavaRN</a> — Sun Aug 12, 2007 7:21 pm</p><hr />
]]></content>
</entry>
</feed>