BS2 to Prop
Earl Foster
Posts: 185
I have been playing with a new serial device that requires me to initialize the unit prior to receiving data.· After numerous attempts on the Prop I moved back to my comfort zone (STAMP) and was able to initialize the device and start monitoring the output.
·
Below is the Stamp that works
Here is the SPIN code that I have been using without results.
I do have the standard 5vDC protection in place for the the Prop I/O and I have checked and rechecked the connections but I can not get the Prop to initialize the serial device.· It is possible that the 3.3v output signal is not detectable on the serial device and that is my problem.· I have not heard back from the manufacturer yet on that question.
Can someone·tell me if I am doing something wrong with the SPIN code?·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
·
Below is the Stamp that works
' {$STAMP BS2px} ' {$PBASIC 2.5} PNI_RX CON 1 PNI_TX CON 0 N9600 CON 16780 char VAR Byte PAUSE 250 Main: SEROUT PNI_TX, N9600, [noparse][[/noparse]$00,$05,$15,$BD,$61] PAUSE 100 start: SERIN PNI_RX, N9600, [noparse][[/noparse]char] DEBUG HEX char GOTO start
Here is the SPIN code that I have been using without results.
con _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 obj debug[noparse][[/noparse]2]: "FullDuplexSerialPlus" 'Debug object var byte pni pub main Debug[noparse][[/noparse]0].start(31, 30, 0, 9600) 'Start the debug terminal debug[noparse][[/noparse]0].str(string("Starting")) debug[noparse][[/noparse]1].start(16,17,0,9600) waitcnt(clkfreq/4 + cnt) debug[noparse][[/noparse]1].tx($00) debug[noparse][[/noparse]1].tx($05) debug[noparse][[/noparse]1].tx($15) debug[noparse][[/noparse]1].tx($BD) debug[noparse][[/noparse]1].tx($61) waitcnt(clkfreq/4 + cnt) repeat debug[noparse][[/noparse]0].hex(debug[noparse][[/noparse]1].rx,1) 'Receive btye and display
I do have the standard 5vDC protection in place for the the Prop I/O and I have checked and rechecked the connections but I can not get the Prop to initialize the serial device.· It is possible that the 3.3v output signal is not detectable on the serial device and that is my problem.· I have not heard back from the manufacturer yet on that question.
Can someone·tell me if I am doing something wrong with the SPIN code?·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
Comments
John Abshier
The output has been verified to be correct but when I listen in with the Prop I get a completely different and incorrect output.· This is a seperate issue from being able to TX to the device.
Any ideas why that might be the case?
I added a side-by-side output image.· It is interesting how the STAMP is clean and the Prop output is all zeros between data burst and they do not come close to matching(besides the $ I have the stamp producing in the output)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
Post Edited (Earl Foster) : 4/12/2009 12:58:36 AM GMT
your codeline
send only ONE digit. one byte are TWO hexadecimal digits
so change it to
If this does not help
Post a picture of how you have connected your device to the propeller.
What voltagelevels does the device have for low and high ?
Did you check your propeller-setup with a terminalsoftware.
I mean a terminalsoftware that is known to send proper data connected to the propeller on object debug
receiving data from the terminalsoftware
sending a $00 watch what the propeller receives
sending a $FF watch what the propeller receives
sending a $01 watch what the propeller receives
sending a $FE watch what the propeller receives
sending a $02 watch what the propeller receives
sending a $FD watch what the propeller receives
...
best regards
Stefan
I am facing one of two issues.· Either my code is incorrect or the device needs 5v signal.· I have experimented with both, but troubleshooting 2 issues is not the way to go. Need to eliminate one before moving on to the other.
Hence my question
I need to send, in·HEX, the·following·PUSH command frame 000515BD61 where
··· 00 05· - Int16 which is the byte count including CRC
··· 15····· -·UInt8 packet frame id (start pushing data command)
··· BD 61· - UInt16 is CRC-CCITT (XModem)
Would the code below·correctly send 000515BD61 to the device?·
I have also tried droping the leading zeros resulting in 0515BD61 with no results.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
Any suggestions?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
I could use some suggestion and ideas of what the problem could be.· The stamp program has no problem getting the PNI device to transmit data.· AH - let me look at the Stamp waveform and compare them.· The attached plots are the waveform of the push command sent to the PNI device.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
Post Edited (Earl Foster) : 4/13/2009 2:14:04 PM GMT
So I need to invert the TX signal from the Prop.· Hopefully that will take care of the problem.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman