Emic2 & PICAXE

Can somebody tell me why this program is not working?
I don't seem to be getting a ":" back from the Emic2 nor does it speak anything.
If I plug it into a BOE the Emic2 works perfectly ... so it must be
; Emic2&PICAXE
#picaxe 28X2 ; Define the µProcessor IC Type
hsersetup B9600_32, %10 ; 9600 baud, inverted polarity
symbol Ready = b0
; BEGIN Main Body * * * * * * * * * * * * * * * * * * * * *
main:
pause 5000
do
gosub speak1
loop
end
; END Main Body * * * * * * * * * * * * * * * * * * * * **
; BEGIN Subroutines * * * * * * * * * * * * * * * * * * **
ReadyChk:
hserin 0,Ready
debug b0
if Ready <> ":" then return ; Waiting for the Emic2 to send its ":" character as being READY
endif
return
speak1:
hserout 0,("S", "Hello")
gosub ReadyChk
hserout 0,("S", "My name is the Emic 2")
gosub ReadyChk
return
end
; END Subroutines * * * * * * * * * * * * * * * * * * * **
I don't seem to be getting a ":" back from the Emic2 nor does it speak anything.
If I plug it into a BOE the Emic2 works perfectly ... so it must be
; Emic2&PICAXE
#picaxe 28X2 ; Define the µProcessor IC Type
hsersetup B9600_32, %10 ; 9600 baud, inverted polarity
symbol Ready = b0
; BEGIN Main Body * * * * * * * * * * * * * * * * * * * * *
main:
pause 5000
do
gosub speak1
loop
end
; END Main Body * * * * * * * * * * * * * * * * * * * * **
; BEGIN Subroutines * * * * * * * * * * * * * * * * * * **
ReadyChk:
hserin 0,Ready
debug b0
if Ready <> ":" then return ; Waiting for the Emic2 to send its ":" character as being READY
endif
return
speak1:
hserout 0,("S", "Hello")
gosub ReadyChk
hserout 0,("S", "My name is the Emic 2")
gosub ReadyChk
return
end
; END Subroutines * * * * * * * * * * * * * * * * * * * **
Comments
then this
ser.TX(pst#NL) repeat until ser.RxCheck == ":"
Not all my work, I got hints off the OBEX (actually a lot more than hints)
Aaron
Hi,
IF U read the code I posted you can see I am sending an "S" before the text ... Just as the manual prescribes.
That's not an hserout or hserin command ??? totally useless solution for my PICAXE chip.
I'm looking for a solution not a WAG.
http://www.picaxeforum.co.uk/forumdisplay.php?2-Active-PICAXE-Forum
Hi,
You are assuming that people that use a PICAXE µController do not buy Parallax peripheral components and that PICAXE users do not use the forum here ???
True it is will be a simple PICAXE BASIC solution, but I'm asking in both forums for help. There are intelligent people in both forums so this increases my chances of a solution despite non-solution suggestions by people that do not know the answer to the original question.
I see you posted your PicAxe question in the PicAxe forum. Best of luck with your project.
Hi,
It's a PICAXE question about a Parallax component.
The forum is for people to look for answers from friendly helpers not criticism about their questions or calling them rude. What is rude is you posting on other ideas other than a solution to the original question.
I do not know the language of PICAXE but this is a program in Propeller Spin that works. Much of the code came from Joe Grand, the designer of the EMIC 2. As you can see the command to the EMIC is sent as a text byte prior to the string being sent. I also tried to put the command in the same line IE (sText) but could not get it to work. Upon studying Spin objects I found the separate line way and it works.
If you don't get the info you need in the PICAXE language, you may have to convert the Spin for your mC and figure it out.
Aaron
CON { uses EMIC 2 to say temperature read from TC74 No extra COGs used for EMIC a few laughs added for demo purposes Much code comes from objects by Joe Grand and Rogersyd See below for TERMS OF USE } _clkmode = xtal1 + pll16x '80 MHz system clock _xinfreq = 5_000_000 EMIC_TX = 6 'serial output (connects to Emic 2 SIN) EMIC_RX = 7 'serial input (connects to Emic 2 SOUT) [use 10k series resistor] SDA_pin = 21 'for TC74 SCL_pin = 20 Bitrate = 100_000 VAR word kelvin byte temper,F 'storage for I2C read and value converted to fahrenheit OBJ pst : "Parallax serial Terminal" ' Debug Terminal fds : "FullDuplexserial" I2C : "I2C PASM driver v1.3" PUB init 'start objects I2C.start(SCL_pin,SDA_pin,bitrate) fds.start(7,6,0,9600) pst.start(9600) 'no pst display in this program except parser change and ":"s (ready) main PUB Main 'NOTE there are grammer and spelling mods to make speach sound better ' and more that could be made (I'm trying to learn DECtalk) 'repeat 2 temper:=(I2C.read(I2C#TC74,00)) 'get temperature from TC74 F:= temper*9/5+32 'convert to fahrenheit pst.Str(String("changing to DECtalk parser")) ' also works same w/ Epson parser fds.TX("P") 'send command for parser change fds.dec(0) 'select DECtalk fds.TX(pst#NL) 'this line and the next needed for EMIC 2 operation repeat until fds.RxCheck == ":" pst.Str(String(13,":")) fds.tx("S") 'send command for speach fds.Str(string("the temperature is")) fds.dec(F) 'say the variable fds.str(string("degrees faran heit.")) fds.TX(pst#NL) repeat until fds.RxCheck == ":" waitcnt(clkfreq*3+cnt) 'repeat every 3 second (if repeat loop) temper:=(I2C.read(I2C#TC74,00)) F:= temper*9/5+32 'convert to fahrenheit kelvin:=temper+273 'convert to kelvin fds.tx("S") fds.Str(string("the temperature is")) fds.dec(F) fds.str(string("degrees faran heit")) fds.dec(temper) 'say temperture in celcius fds.str(string("degrees centigrade, and")) fds.dec(kelvin) 'say temperture in kelvin fds.str(string("degrees kelvin.")) fds.TX(pst#NL) repeat until fds.RxCheck == ":" waitcnt(clkfreq+cnt) fds.tx("S") fds.str(string("I'm pretty smart, ain't I? By the way, who, is, Kelvin.")) fds.TX(pst#NL) repeat until fds.RxCheck == ":" waitcnt(clkfreq+cnt) fds.tx("S") fds.str(String(" I'm also getting hungry from all this calculation work.")) fds.TX(pst#NL) repeat until fds.RxCheck == ":" fds.tx("S") fds.str(string(" What, do you have, to eete, in this place. If you need sugestions, I have some.")) fds.TX(pst#NL) repeat until fds.RxCheck == ":" waitcnt(clkfreq+cnt) fds.tx("S") waitcnt(clkfreq+cnt) Fds.str(string("A juicy steak, and ice cream for dessert, would be nice.")) fds.TX(pst#NL) repeat until fds.RxCheck == ":" fds.tx("S") fds.str(string("I'll let you know, when I'm ready, to go back to work. Do not bauther me, in the mean time.")) fds.TX(pst#NL) repeat until fds.RxCheck == ":" DAT {{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ }}
http://www.picaxeforum.co.uk/showthread.php?26333-Emic2-amp-PICAXE&p=269064#post269064
The program is working except that the Emic2 seems to only return a character 13 (=cr) instead of a : (=58) ??? No matter how fast or how slow I watch the 9600 BAUD serial IN port I never see the 58 character :
I've tried having Emic2 speak very short messages and very long messages (D1) which is about 31-seconds long ... but I still cannot seem to get a 58 character.
I wonder if that "hippy" is on in the same as our"Hippy" ?
Pretty sure it is based on posts I've seen from him before...
Don't know why - all of the SPIN code programs I've seen have do this after sending data
repeat until serial.RxCheck == ":"
Here is an mp3 of Edelweis and the EMIC input is attached
http://ronczap.home.insightbb.com/EDELWEIS.mp3