Thank you very much for your explanation. Please forgive my remark "feel like I'm talking to myself" I meant no harm, I have a really good sense of Humor and didn't think about no one knowing that through texting! I'll be more carefully!
It's really amazing how the Internet brings people together all over the world, I'll try and remember the timeframe difference as well. I talked to a gentleman here in the U.S. about the cross-over with the serial communication and believe I may have gotten confused when talking to him. I did read several articles concerning RS232 to refresh myself, the way he talked things we're reversed on the 865cf Evaluate board as opposed to what we would see normally. I will put a Scope on the lines today and check deeper into things to make sure. I would hate to damage this Evaluate board as it cost 350.00 here in the U.S.
I appreciate your advise and your post, it sure helps when you can find someone not only working on the same type of project but with the same Hardware and Software!
Sincerely,
John.
I jar also Started a New thread called "Propeller and TeLit 865cf Startup Project" where I have posted a VERY remedial sniplet of start-up code. I am not a Programmer so I am just learning Spin but very excited about how it handles things in Parallel. When we use FullDuplex_FDSerial am I right in stating that it starts a New Cog to handle the RS232 communication? One of the main reasons I switched from the Axon-2 to the Propelle was due to this fact. I thought it would oliviate any timing issues as the Main Loop or program began to grow. I work in the Industrial Instrumentation field and would lke to control and monitor Instrumentation with this project. I also noticed a PropellerTCP zip file attached to a post On the front page of the Forum, are either of you familiar with Interfacing the Propeller to the Internet? If you don't mind me asking, what is the scope of your project as far as Cellular goes?
Hello Guy's, I have been looking into the RS232 thing and realized that the Tx on the 865cf is actually the UART receive line and Vise versa. It appears then that the Tx (865cf's UART Receive Pin) will tie to the Propeller's Tx line via a Level Translator. If I am not understanding this correctly please let me know. I am having a hard time finding a DIP style (3.3 to 2.8V) Level Translator that I can just plug into the PDB's breadboard, can you guy's recommend the Best solution?
I just purchased a Bi-directional Level translator from SparkFun that I am going to try, it looks as though it may work for keeping the Voltage Level at a safe range for the Serial Comm. Also, I purchased some Software for my O'Scope so I can post Pic's of the timing, logic, ect. I just seem to understand things a little better when I can look at a picture of whats going on.
John.
I think I just understood what your meant about TX being the UART receive, yes this is true. To be absolutely clear the "TXD" pin of the GE865 connects to the "TX" (output) of the propeller or other micro. Leon from the forum here mentioned this too a while ago, but it bears repeating. (Sorry for the late penny drop, didn't realise you were connecting direct as opposed to via D9 serial).
Regarding the level converter, unless you are using a ridiculous baud rate you really can just use a series resistor between the prop and the telit TXD pin. The effect of lowering the input impedance is that you add a RC time constant that slows the signal rise time, but at the baud rates 2G works it I can't see this being a problem.
I don't know of any DIP level translators. Think your module approach, or using a breakout board (Futurlec, < $1) would work. But really it's overkill.
I am working on a script state machine (with examples), so you can just load the commands and it will automatically pump them through the telit to sent sms, email etc. Should have something to post this time tomorrow (in SPIN at least). I will also attempt a 'C' version but this is a low priority right now
Thank you Tubular,
If I wanted to use the "AT" 9-Pin Serial port on the TeLit, I presume this is converted to the higher RS232 voltage levels since it is meant to monitor via a DTE. On the PDB side, can I use the RS232 port on the Bottom Left and then take the output of that to lets say (Pins 28 & 29) on the Prop which would be setup via the FullDuplexSerial object? Sorry for the re-iteration of the RS232 subject, I just want to make sure I have everything set up right on the communication side of things :>) What value resistor are you using between the two? and Thank you for the code examples, that will be a tremendous help ...
Tubular, I used equivelent commands via Hyper Terminal to send a sample SMS to my iPhone. It seemed to work fine even though I realize this is a remedial sniplet of starter code "Just Learning Spin" :>)
I'm going throught the "AT" command pdf to get familiar with most of the commands, their's alot of them :>)
CON
_clkmode = xtal1 + pll16x ' Feedback and PLL multiplier
_xinfreq = 5_000_000 ' External oscillator = 5 MHz
VAR
long stack[50]
OBJ
serial : "Extended_FDSerial"
PUB MAIN
serial.Stop
serial.RxFlush
serial.start(31,30,0,115,200) 'Is Mode "0" correct to use? or should I use Mode 2 ?
serial.str(String("AT+CMGF=1"))
wait
serial.str(String("AT+CPMS=ME"))
wait
serial.str(String("AT+CNMI=1,1,0,0,0"))
wait
serial.str(String("AT+CMGS+???????????")) 'Phone number to send Message to.
wait
serial.dec(26) 'CTL+Z in this line.
wait
serial.dec(13) 'Enter Command ...
wait
serial.str(String("Testing Equipment") 'Text Message to Send to Cellular Device.
wait
serial.dec(13) 'I need to send ENTER in this line to send the message.
serial.Stop 'Stop the Cog that the call to Extended_Full_Duplex_Serial started.
You really don't want to use P28 and P29 because these are used by the propeller to boot from EEPROM. After boot they are kind of free, but the fact is they always see some activity during boot, and that garbage is going to get into your modem. Easier just to use any pair or pins <= P27 if you can spare them. Plus once you run our of normal pin I2C can help keep you expanding.
I'll set up a prop<>ge865 today and measure the input current injected into the GE865 with various resistor combos, give you (and future readers of this thread) a scientific answer. I reckon 470 ohms would be plenty given the differential is only 0.5, but lets try and prove it.
Your code is looking good, all those AT commands are familiar.
Tubular, thank you for your help ... It is much appreciated. The code I have seen generated on this forum is really impressive and a little intemidating to us beginners :>) I Really like what I am learning with the Spin language though, it sure beats a lot of opened and closed "Curly Brackets" in my opinion anyway.
Good morning Tubular, it looks as though I have been making things hard on myself :>)
I looked at the platforms a little closer tonight "Getting a little braver", it looks as though I can just Leave the "Mode-0" switch off on the Telit and run 9-Pin to 9-Pin serial cable from the PDB straight to the TeLit. The PDB has the RS3232 that converts to 3.3V Levels "of course", so I can just add the resistor as you have mentioned and just jump right up there to pins 26 & 27 on the Propellers Female header. I guess I just need to get to the point where I'm not afraid of burning something up :>)
I also dug out my O'Scope that I haven't used much and output some different ASCII characters to monitor them. Everything went well there so I'm feeling a little better :>)
I double checked the 865cf Quad Hardware pdf concerning the install of a 47K pull-up on the TeLit's Tx(UART Rx) line. Supposedly due to the fact that it does not have an Internal Pull-up (Just double Checking myself).
I look forward to seeing your code, I think I've worked up enough gall to actually attach the RS232 lines and fire this Bad Boy up :>)
Tubular, I have my platform powered up and working. All I did was use a RS232 Null Modem cable between the 2 Serial ports, the Max chips are converting the voltage Levels to what they need to be (Left Mode - 0) switch off on the TeLit. I understand that I need to be porting the Feedback commands to the Serial Terminal or Viewport but just not there yet with my code writing abilities :>) Checked things with my O'Scope but not sure of the Signal Inversion, I have taken some pictures and can e-mail them later if I need to. The TeLit is connected to the Network as the Status light is blinking once every 3 seconds. I know that I do not have the commands formatted right, I figure that I am going to have to convert some of the dec. numbers to their ASCII equivalents such as in (AT+CNMI=1,1,0,0,0"). I'm pushing the Limits on my understanding of the code and need to read some more, I also need some clarification on the Mode setting in the Start method of Full_FDSerial. I'm learning a lot quick only to realize how far I have to go :>)
But having Fun learning,
John.
PUB MAIN
dira[0..3]~~
serial.Stop 'Makes sure the Cog is stopped from running any processes.
serial.RxFlush 'Flush the Cog's Receive Buffer.
serial.start(26,25,0,115200) 'Set-up Serial, Pin-26(Rx), Pin-25(Tx), Mode-0 "Invert Rx" & 115,200 Baud.
serial.str(String("AT+CMGF=1")) 'AT command that is sent to TeLit_865 Chip to set-up SMS Text Mode.
outa[0]~~
serial.dec(13)
wait
serial.str(String("AT#SMSMODE=0"))
outa[0]~
serial.dec(13)
wait
serial.str(String("AT+CPMS=ME"))
outa[0]~~
serial.dec(13)
wait
serial.str(String("AT+CNMI=1,1,0,0,0"))
outa[0]~
serial.dec(13)
wait
serial.str(String("AT+CMGS+???????????")) 'Phone number (Blanked out) to send Message to.
outa[0]~~
serial.dec(13)
wait
serial.str(String("Testing Equipment")) 'Text Message to Send to Cellular Device.
outa[0]~
serial.dec(26) 'I need to send CTL+Z in this line to Send the message.
wait
outa[0]~
wait
wait
wait
serial.Stop 'Stop the Serial Cog.
repeat
outa[3]~~
wait
outa[3]~
wait
Tubular, this is working code for SMS Transmission from TeLit to Cell Phone (Bare Bones). Working on the Receive side now :>)
John.
CON
_clkmode = xtal1 + pll16x
_clkfreq = 80_000_000
OBJ
serial: "Extended_FDSerial"
VAR
long Stack[400]
PUB MAIN
serial.stop
serial.RxFlush
serial.start(26,25,%0000,115200)
serial.str(String("AT+CMGF=1",13))
waitcnt(clkfreq+cnt)
serial.str(String("AT#SMSMODE=0",13))
waitcnt(clkfreq+cnt)
serial.str(String("AT+CPMS=ME",13))
waitcnt(clkfreq+cnt)
serial.str(String("AT+CNMI=1,1,0,0,0",13))
waitcnt(clkfreq+cnt)
serial.str(String("AT+CMGS=",34,"+55555555555",34,13)) 'Install your cell phone number in place of all the 5's ...
waitcnt(clkfreq+cnt)
serial.str(String("Testing the TeLit"))
waitcnt(clkfreq+cnt)
serial.tx(26) 'Send the message via CTL+Z
Hello Guy's, I need some Help with how to read a Received String via Extended_FDSerial. I am sending the TeLit the "G" and "S" command and want to have this loaded into an Array. From there I want to compare which one was received and turn on LED -1 if the "G" command was received and LED - 2 if "S" was received.
Is this a correct start to accomplish this? I've read so much I'm confused :>)
PUB RECEIVE | Rx_Byte
serial.start(25,24,%0000,115200)
repeat
repeat
serial.RxStr(@Byte_Array)
while byte_array[0] == -1
if strcomp (@Byte_Array, @Go)
LED_1
if strcomp (@Byte_Array, @Stop)
LED_2
DAT
Go BYTE "Go",0
Stop BYTE "Stop",0
John, I use this code to do something similar, you can easily modify it to suit. Pressing "Control C" (ASCII $03) changes some LEDs as does "Control R", while "Control-D" sets the value of a variable according to a subsequent byte. The debug object is "Debug_PC" - but check your serial object for an equivalent non-waiting RX buffer check method (rxcheck?)
Temp1 := debug.incheck
if (Temp1 < 32) & (Temp1 > 0) 'Command follows
if (Temp1==3) 'control-C command pressed
outa[pinRedLamp] := 1
outa[pinYelLamp] := 1
outa[pinGrnLamp] := 0
elseif (Temp1==18) 'control-R command pressed
outa[pinRedLamp] := 0
outa[pinYelLamp] := 1
outa[pinGrnLamp] := 1
CommandLatch := Temp1
Temp1 := 0
elseif (Temp1 > 31) & (Temp1 < 256)
if CommandLatch == 3 'in "Control-C mode"
'
elseif (CommandLatch == 4) 'in "Control-D mode to adjust delay value
Delay := Temp1-32 'set delay to (ASCII value - 32), eg "A" sets delay to 33, "Z" to 58, etc
'etc
Thought I would jump in and mention that I am experimenting with the Janus GSM864Q which contains a Telit module as well as a GPS module and interfaces via a 50-pin SIP header with standard 0.1" spacing. Anyway I thought I would follow along with you all as I progress on my end.
The module I received is from a customer who is building an application using it with the Propeller and I am helping him work out some issues. However, I have done work previously using other GSM modules coupled with a separate GPS module for fleet tracking. In this case I am looking at efficient ways to parse the incoming SMS message and make use of the incoming data for sending responses. When working on a project it's always interesting to see what others are doing when using the same hardware. On the Janus module GPS data can be captured directly into the Propeller from the 50-pin header and the new message alarm as well, but I may have missed a function in the massive AT function set which allows you to query the module for the new message status of at least the high message index. I should look back and see exactly what you've done.
Receiving SMS messaging does get a bit involved as you have to deal with the message boxes etc. However there is an AT command that "delivers the message instantly to the serial interface".
I found that useful because the telit wasn't doing anything else other that waiting for the SMS, and it saved a whole heap of query/response work.
Here's the excerpt from a test log which might be useful
at+cnmi=2,2,0,0,0
OK
+CMT: "+614xxxxxxx",,"07/11/10,16:55:41+44"
Hello master does this come out on the terminal screen?
Do line breaks work?
+CMT: "+614xxxxxxx",,"07/11/10,16:57:32+44"
What about in tty,
do line breaks work now?
Hmmm
at
OK
Hello Chris, I am new to the Propeller and to the TeLit modules so I will be gaining from your advice :>) I have talked to you in the past and you have given me advice on several different issues which has helped me tremendously . Glad you will be monitoring the post as I am trying to figure out how to go about parsing the incoming MSM as well. I am using the 865 Eval Board ...
Hello Guy's, figured out another 100 ways not to make a propeller receive data through a TeLit (Light Bulb) last night :>) so I'm resorting to dropping a Computer (Hyper Terminal) in the middle of the two as proposed by Tubular. It seems as though this is the Best way to go ... I've tried Viewport and the Propeller serial Terminal and both require alterations in code. At this point in my early learning period I need easy :>) Also, could someone post an example of parsing serial data "with comments" that a beginner could understand or suggest a pdf, spin example, ect. that I can study.
Tubular, I have sent some test messages with multiple lines and have seen the same results. Since I am only using the PST I cannot be certain, but it appears the device sends a LF character for each line but no CR character. I am going to test this more in the next few days. In my endeavor it doesn't matter as I will be receiving the entire packet of data into an array and parsing out the fields or optionaly creating a pointer table to the data. The command I am using is +CMGR or +CMGL to list messages, however my first pass of the document did not immediately reveal a command that returns the number of new messages or total messages stored so that I may refer to them by index number. For example, the +CMGR command can specify a message by index number, however I don't yet see where the high index is stored.
John Michael, it seems Tubular has a lead on me in experimenting with these, however my approach in talking to/dealing with the module may be handled slightly different as I do intend to create an object for talking to this module. Of course it's good to know the differences between the modules since this Janus Module actually includes the Telit Module and therefore has more hardware to deal with, such as the GPS.
One thing I would like to change early on is how commands are sent and processed. Instead of sending each command encapsulated as a string I would like to store these in a DAT table or some other method to make it easy to change the ones that need to be set different for different users, mainly the initialization strings. Also, instead of waiting one second between sending comands I would like to imediately process the response string from the module to ensure it has received the command properly and that there were no errors. This will also speed up initialization and sending commands and the responses happen much faster than one second, and those seconds add up when you have several commands you're sending.
Hello guys I am new to posting on this forum but have been looking over it for some time now. I am working on this exact project. I am using the Extended_FDSerial.spin file and I understand that RXStr method checks for a char array and then uses bytemove method to send the array to stringptr.
Now all I should need to do is come up with a way to read the stringptr am I correct? Any help is greatly appreciated.
nthna8, welcome to the thread ... Sounds like your on the right track, please post any code fragments that you have. Chris has recently started posting on this subject and is very knowledgable as well as Tubular. Their are many people working toward a receiving method that works well, hope we can all help each other...
PUB RxStr (stringptr) : Value | ptr
{{
Accepts a string of characters - up to 15 - to be passed by reference
String acceptance terminates with a carriage return or the defined delimiter character.
Will accept up to 15 characters before passing back.
Serial.Rxstr(@MyStr) ' accept
serial.str(@MyStr) ' transmit
}}
ptr:=0
dataIn[ptr] := Rx
ptr++
repeat while ((DataIn[ptr-1] <> 13) and (DataIn[ptr-1] <> Delimiter)) and (ptr < 15)
ptr++
dataIn[ptr-1]:=0
byteMove(stringptr,@datain,16)
the accept method is called upon by stating serial.RxStr(@MyStr) MyStr is obviously a pointer to a position in a string array that I create? Am I reading this right???
I'm trying to understand Array's, how to read/write Strings to them. Can someone make the nessessary comments to what I am doing wrong.
PUB RECEIVE_DATA(num_of_chars,datain) | rx_byte, index
'Receive Code not working yet, need Help with this.
'num_of_chars is the number of chars to receive into the
'"datain" Array.
index:=0
'Array index pointer,points to location "0" in the datain Array.
repeat
'Repeat the following.
rx_byte:= serial.rxStr(@datain)
'Set rx_byte to what is received and
'Write it to the "datain Array" in
'Location "0".
while datain[0]== -1
serial.str(String("We're still Looping",13)
'If we have not Received a byte keep Looping
'back until we do. When we receive a byte go
'to the next line of code.
if rx_byte==("g")
'If we received "g"
serial.str(String("We have received g",13)
'print that we have received it.
index++
'Increment the Array index pointer
if num_of_chars- - == 1
'If we have received "1" byte\ goto the LED_1 method.
LED_1
index:=0
'Set the Array index pointer back to location "0".
nums_of_chars:= 1
'Set number of Chars to receive back to 1.
Hi Nathan, the following code will Turn on LED_0 no matter what Character I send. The good things is that it is turning on something when I send a Character so I know that I have things wired and set up correctly in the TeLit / Propeller combo platform.
On the statement if dataIn[0] := ("A") do I need to use == instead? Getting closer :>) Please make adjustments to the code so when I send "Go" or "Stop" it will turn on either LED_0 and LED_7 respectively.
Comments
It's really amazing how the Internet brings people together all over the world, I'll try and remember the timeframe difference as well. I talked to a gentleman here in the U.S. about the cross-over with the serial communication and believe I may have gotten confused when talking to him. I did read several articles concerning RS232 to refresh myself, the way he talked things we're reversed on the 865cf Evaluate board as opposed to what we would see normally. I will put a Scope on the lines today and check deeper into things to make sure. I would hate to damage this Evaluate board as it cost 350.00 here in the U.S.
I appreciate your advise and your post, it sure helps when you can find someone not only working on the same type of project but with the same Hardware and Software!
Sincerely,
John.
John Michael.9
John.
John.
I think I just understood what your meant about TX being the UART receive, yes this is true. To be absolutely clear the "TXD" pin of the GE865 connects to the "TX" (output) of the propeller or other micro. Leon from the forum here mentioned this too a while ago, but it bears repeating. (Sorry for the late penny drop, didn't realise you were connecting direct as opposed to via D9 serial).
Regarding the level converter, unless you are using a ridiculous baud rate you really can just use a series resistor between the prop and the telit TXD pin. The effect of lowering the input impedance is that you add a RC time constant that slows the signal rise time, but at the baud rates 2G works it I can't see this being a problem.
I don't know of any DIP level translators. Think your module approach, or using a breakout board (Futurlec, < $1) would work. But really it's overkill.
I am working on a script state machine (with examples), so you can just load the commands and it will automatically pump them through the telit to sent sms, email etc. Should have something to post this time tomorrow (in SPIN at least). I will also attempt a 'C' version but this is a low priority right now
If I wanted to use the "AT" 9-Pin Serial port on the TeLit, I presume this is converted to the higher RS232 voltage levels since it is meant to monitor via a DTE. On the PDB side, can I use the RS232 port on the Bottom Left and then take the output of that to lets say (Pins 28 & 29) on the Prop which would be setup via the FullDuplexSerial object? Sorry for the re-iteration of the RS232 subject, I just want to make sure I have everything set up right on the communication side of things :>) What value resistor are you using between the two? and Thank you for the code examples, that will be a tremendous help ...
John.
I'm going throught the "AT" command pdf to get familiar with most of the commands, their's alot of them :>)
You really don't want to use P28 and P29 because these are used by the propeller to boot from EEPROM. After boot they are kind of free, but the fact is they always see some activity during boot, and that garbage is going to get into your modem. Easier just to use any pair or pins <= P27 if you can spare them. Plus once you run our of normal pin I2C can help keep you expanding.
I'll set up a prop<>ge865 today and measure the input current injected into the GE865 with various resistor combos, give you (and future readers of this thread) a scientific answer. I reckon 470 ohms would be plenty given the differential is only 0.5, but lets try and prove it.
Your code is looking good, all those AT commands are familiar.
John.
I looked at the platforms a little closer tonight "Getting a little braver", it looks as though I can just Leave the "Mode-0" switch off on the Telit and run 9-Pin to 9-Pin serial cable from the PDB straight to the TeLit. The PDB has the RS3232 that converts to 3.3V Levels "of course", so I can just add the resistor as you have mentioned and just jump right up there to pins 26 & 27 on the Propellers Female header. I guess I just need to get to the point where I'm not afraid of burning something up :>)
I also dug out my O'Scope that I haven't used much and output some different ASCII characters to monitor them. Everything went well there so I'm feeling a little better :>)
I double checked the 865cf Quad Hardware pdf concerning the install of a 47K pull-up on the TeLit's Tx(UART Rx) line. Supposedly due to the fact that it does not have an Internal Pull-up (Just double Checking myself).
I look forward to seeing your code, I think I've worked up enough gall to actually attach the RS232 lines and fire this Bad Boy up :>)
John.
But having Fun learning,
John.
John.
Is this a correct start to accomplish this? I've read so much I'm confused :>)
We have some clinging to a 180m high chimney, solar/supercap powered, that dutifully send their sensor data a few times each day.
The Janus site is good, wish that was around 4 years ago when I started out with the Telit gear
Receiving SMS messaging does get a bit involved as you have to deal with the message boxes etc. However there is an AT command that "delivers the message instantly to the serial interface".
I found that useful because the telit wasn't doing anything else other that waiting for the SMS, and it saved a whole heap of query/response work.
Here's the excerpt from a test log which might be useful
John Michael
Need some Help ...
Thanks ...
John Michael, it seems Tubular has a lead on me in experimenting with these, however my approach in talking to/dealing with the module may be handled slightly different as I do intend to create an object for talking to this module. Of course it's good to know the differences between the modules since this Janus Module actually includes the Telit Module and therefore has more hardware to deal with, such as the GPS.
One thing I would like to change early on is how commands are sent and processed. Instead of sending each command encapsulated as a string I would like to store these in a DAT table or some other method to make it easy to change the ones that need to be set different for different users, mainly the initialization strings. Also, instead of waiting one second between sending comands I would like to imediately process the response string from the module to ensure it has received the command properly and that there were no errors. This will also speed up initialization and sending commands and the responses happen much faster than one second, and those seconds add up when you have several commands you're sending.
Now all I should need to do is come up with a way to read the stringptr am I correct? Any help is greatly appreciated.
again Welcome ...
the accept method is called upon by stating serial.RxStr(@MyStr) MyStr is obviously a pointer to a position in a string array that I create? Am I reading this right???
Thanks for your help guys
if I am thinking this through correctly
i have come up with the following pseudo code example
array[16]
ptr1 = *array[0]
ptr2 = *array[1]
ptr3 = *array[2]
ptr4 = *array[3]
ptr5 = *array[4]
ptr6 = *array[5]
ptr7 = *array[6]
ptr8 = *array[7]
ptr9 = *array[8]
ptr10 = *array[9]
ptr11 = *array[10]
ptr12 = *array[11]
ptr13= *array[12]
ptr14 = *array[13]
ptr15 = *array[14]
ptr16 = *array[15]
string output = ptr1 through ptr16
if the spin language is null terminated the code could be potentially much simpler
if my logic is flawed here please let me know
On the statement if dataIn[0] := ("A") do I need to use == instead? Getting closer :>) Please make adjustments to the code so when I send "Go" or "Stop" it will turn on either LED_0 and LED_7 respectively.