Steel
07-24-2009, 02:41 AM
I am doing something which I thought would be easy...but the propeller is not liking it...Obviously, it is probably my issue, but I can't figure out what is wrong here...it should be easy.
I am using a PC sending a command down to the Propeller dev kit.
I have the BS2.Serin_Char to recieve the command and save it as a variable, "MODE".
I then use the BS2.Serout_Char command to send "MODE" up to the PC.
I send down 0xAA.· I recieve back 0x1B.
When I monitor the pins on the propeller, I see the 0xAA on the RX pin and I see 0x1B on the Propeller TX Pin.· For some reason, "MODE" is not storing the 0xAA and sending it back.
I have attached my scope trace showing 0xAA being recieved and 0x1B being sent.
Can someone help me?· Here is my code:
CON
· _CLKMODE = XTAL1 + PLL16X
· _CLKFREQ = 5_000_000
OBJ
·
· BS2 : "BS2_Functions.spin"
·
·
·
·
VAR
······· Byte MODE, X
PUB MAIN
·
·
·· MODE := 00
· REPEAT·
······· MODE := BS2.SERIN_CHAR(31, 9600, 1, 8)
······· CASE MODE
········· $0:
·········· 'Triggers Reset
········· $1:
·········· 'ProgPin Low·····················
········· $2:
·········· 'ProgPin High
········· $3:
·········· 'Shiftout
········· $4:
·········· 'ShiftIn
·······
······· BS2.SEROUT_CHAR(30, MODE, 9600, 1, 8)
·····
DAT
I am using a PC sending a command down to the Propeller dev kit.
I have the BS2.Serin_Char to recieve the command and save it as a variable, "MODE".
I then use the BS2.Serout_Char command to send "MODE" up to the PC.
I send down 0xAA.· I recieve back 0x1B.
When I monitor the pins on the propeller, I see the 0xAA on the RX pin and I see 0x1B on the Propeller TX Pin.· For some reason, "MODE" is not storing the 0xAA and sending it back.
I have attached my scope trace showing 0xAA being recieved and 0x1B being sent.
Can someone help me?· Here is my code:
CON
· _CLKMODE = XTAL1 + PLL16X
· _CLKFREQ = 5_000_000
OBJ
·
· BS2 : "BS2_Functions.spin"
·
·
·
·
VAR
······· Byte MODE, X
PUB MAIN
·
·
·· MODE := 00
· REPEAT·
······· MODE := BS2.SERIN_CHAR(31, 9600, 1, 8)
······· CASE MODE
········· $0:
·········· 'Triggers Reset
········· $1:
·········· 'ProgPin Low·····················
········· $2:
·········· 'ProgPin High
········· $3:
·········· 'Shiftout
········· $4:
·········· 'ShiftIn
·······
······· BS2.SEROUT_CHAR(30, MODE, 9600, 1, 8)
·····
DAT