Emic2 & PICAXE
wperko
Posts: 66
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
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
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
Here is an mp3 of Edelweis and the EMIC input is attached
http://ronczap.home.insightbb.com/EDELWEIS.mp3