_HubRx ' <--- receive character --->
{{-----
_HubRx
' On Entry:
lmm_x = -anything- ' value
lmm_y = -not used- ' mode
' Call Format:
' 'FCALL SP++, @_HubRx ' \ < call: receive char>
wrlong lmm_pc, lmm_sp ' | PUSH PC
add lmm_sp, #4 ' | SP++
rdlong lmm_pc, lmm_pc ' | CALL...
long @_HubRx ' / ...PC = ADDR
' On Return:
lmm_x = char ' value
lmm_y = -same- ' mode (unchanged)
-----}}
:wait1 getp #_rxpin wc ' ensure stop/idle
if_nc sub lmm_pc, #(($+1)-:wait1)*4 '> br back (not stop/idle)
:wait0 getp #_rxpin wc ' wait for start \ start =0 edge
if_c sub lmm_pc, #(($+1)-:wait0)*4 '> br back (stop/idle) /
getcnt lmm_w ' get initial time \ setup 0.5 bit time
mov lmm_x, lmm_bittime ' bit period |
shr lmm_x, #1 ' 0.5 bit period |
add lmm_w, lmm_x ' add 0.5 bit period to time |
waitcnt lmm_w, lmm_bittime ' center of start bit /
getp #_rxpin wc ' check start bit =0 \ verify start =0
if_c sub lmm_pc, #(($+1)-:wait1)*4 '> br back (invalid) /
mov lmm_x, #0 ' clear char
waitcnt lmm_w,lmm_bittime ' wait until bit period elapsed /
getp #_rxpin wc ' rx pin into c \ b0
rcr lmm_x, #1 ' accumulate bit |
waitcnt lmm_w,lmm_bittime ' wait until bit period elapsed /
I think this is what you will need to do...
Your user code will then need to look for the beginning of the start bit and immediately call _RX routine
_HubRx ' <--- receive character --->
{{ returns lmm_x = -1 if no character or invalid }}
{{ presume we have already detected the commencement of the start bit }}
getcnt lmm_w ' get initial time \ setup 0.5 bit time
mov lmm_x, lmm_bittime ' bit period |
shr lmm_x, #1 ' 0.5 bit period |
add lmm_w, lmm_x ' add 0.5 bit period to time |
waitcnt lmm_w, lmm_bittime ' center of start bit /
getp #_rxpin wc ' check start bit =0 \ verify start =0
if_c sub lmm_pc, #(($+1)-:wait1)*4 '> br back (invalid) /
mov lmm_x, #0 ' clear char
waitcnt lmm_w,lmm_bittime ' wait until bit period elapsed /
getp #_rxpin wc ' rx pin into c \ b0
rcr lmm_x, #1 ' accumulate bit |
waitcnt lmm_w,lmm_bittime ' wait until bit period elapsed /
.... existing code here (don't forget to check the stop bit and where it goes to if invalid...
add lmm_pc, #4 ' skip next instr if valid char in lmm_x
invalid
sub lmm_x ,#1 ' make -1
done 'here when all done or invalid
' 'JFWD @_HubReturn ' \ <jump fwd>
rdlong lmm_pc, lmm_pc ' | JUMP...
long @_HubReturn ' / ...PC = ADDR <returns to calling routine>
'------------------------------------------------------------------------------
Sapieha: Not quite sure if this is what you are after...
I have added the mode #_DUMP+_COG+_CODE
There are 2 calls in the sample part of the program (lmm_x is the cog address and lmm_y is the mode - they are both sticky with the address incrementing). I have not done hub mode for this yet. I have just coded it simply for now.
c:\Propeller_II\P2Load>p2load -v -b 115200 -s LSD_045.obj -h -T
Trying COM8
Found propeller version 32 on COM8
Loading 'LSD_045.obj' at 0x00000e80
.....
[ Entering terminal mode. Type ESC or Control-C to exit. ]
789
12
<0D>%<95>
1A2B3C4D
4D3C2B1A
4D3C2B1A
The fox was here!!
01000- 0D AA FC 0C 57 AA BC 80 00 AA BC FC 0D D0 FC A0 '....W...........'
01010- 62 CE FC 1F 37 D0 FC A0 62 CE FC 1F 38 D0 FC A0 'b...7...b...8...'
01020- 62 CE FC 1F 39 D0 FC A0 62 CE FC 1F 0D D0 FC A0 'b...9...b.......'
01030- 62 CE FC 1F 59 D0 BC A0 62 CE FC 1F 20 D2 FC A0 'b...Y...b... ...'
01040- 0D D0 FC A0 60 CE FC 1F 25 D0 FC A0 60 CE FC 1F '....`...%...`...'
000- 0D AA FC 0C 57 AA BC 80 00 AA BC FC 0D D0 FC A0 '....W...........'
004- 62 CE FC 1F 37 D0 FC A0 62 CE FC 1F 38 D0 FC A0 'b...7...b...8...'
008- 62 CE FC 1F 39 D0 FC A0 62 CE FC 1F 0D D0 FC A0 'b...9...b.......'
00C- 62 CE FC 1F 59 D0 BC A0 62 CE FC 1F 20 D2 FC A0 'b...Y...b... ...'
010- 0D D0 FC A0 60 CE FC 1F 25 D0 FC A0 60 CE FC 1F '....`...%...`...'
000- 000011 001 1 1111 055 00D
001- 100000 001 0 1111 055 057
Sapieha: Not quite sure if this is what you are after...
I have added the mode #_DUMP+_COG+_CODE
There are 2 calls in the sample part of the program (lmm_x is the cog address and lmm_y is the mode - they are both sticky with the address incrementing). I have not done hub mode for this yet. I have just coded it simply for now.
c:\Propeller_II\P2Load>p2load -v -b 115200 -s LSD_045.obj -h -T
Trying COM8
Found propeller version 32 on COM8
Loading 'LSD_045.obj' at 0x00000e80
.....
[ Entering terminal mode. Type ESC or Control-C to exit. ]
789
12
<0D>%<95>
1A2B3C4D
4D3C2B1A
4D3C2B1A
The fox was here!!
01000- 0D AA FC 0C 57 AA BC 80 00 AA BC FC 0D D0 FC A0 '....W...........'
01010- 62 CE FC 1F 37 D0 FC A0 62 CE FC 1F 38 D0 FC A0 'b...7...b...8...'
01020- 62 CE FC 1F 39 D0 FC A0 62 CE FC 1F 0D D0 FC A0 'b...9...b.......'
01030- 62 CE FC 1F 59 D0 BC A0 62 CE FC 1F 20 D2 FC A0 'b...Y...b... ...'
01040- 0D D0 FC A0 60 CE FC 1F 25 D0 FC A0 60 CE FC 1F '....`...%...`...'
000- 0D AA FC 0C 57 AA BC 80 00 AA BC FC 0D D0 FC A0 '....W...........'
004- 62 CE FC 1F 37 D0 FC A0 62 CE FC 1F 38 D0 FC A0 'b...7...b...8...'
008- 62 CE FC 1F 39 D0 FC A0 62 CE FC 1F 0D D0 FC A0 'b...9...b.......'
00C- 62 CE FC 1F 59 D0 BC A0 62 CE FC 1F 20 D2 FC A0 'b...Y...b... ...'
010- 0D D0 FC A0 60 CE FC 1F 25 D0 FC A0 60 CE FC 1F '....`...%...`...'
000- 000011 001 1 1111 055 00D
001- 100000 001 0 1111 055 057
Sapieha:
Here is another update. It now works for hub too.
I have added two new commands to the Debug/monitor mode (interactive mode)...
xxx'<cr> will display the cog address (instruction) code, and
xxxxx"<cr> will display the hub address (instruction) code.
A <cr> will display the next address.
Note leading zeros may be omitted in the addresses. LSD_046.spin
No, I have not added the check_serial. I need to think about how to have both options.
Sapieha:
Here is another update. It now works for hub too.
I have added two new commands to the Debug/monitor mode (interactive mode)...
xxx'<cr> will display the cog address (instruction) code, and
xxxxx"<cr> will display the hub address (instruction) code.
A <cr> will display the next address.
Note leading zeros may be omitted in the addresses. LSD_046.spin
No, I have not added the check_serial. I need to think about how to have both options.
You can also return to your code and continue too. Currently I use <esc> and that terminates p2load's terminal program, so I need to rethink another control char to return to the user cog code.
You can also return to your code and continue too. Currently I use <esc> and that terminates p2load's terminal program, so I need to rethink another control char to return to the user cog code.
Sapieha: Seems what you really need is for me to add in the single stepper code from my old P1 debugger. But meanwhile, I will add the goto function, maybe later today.
Sapieha: Seems what you really need is for me to add in the single stepper code from my old P1 debugger. But meanwhile, I will add the goto function, maybe later today.
Additions:
xxx!<cr> resumes user code at cog address xxx (i.e. goto). xxx may be omitted for addr=0.
Dump code now also displays hex and hex reversed in addition to the instruction format. Works for both cog and hub.
Ctl-Z<cr> now passes control to the Rom Monitor (was <esc> but that conflicts with p2load Terminal mode) LSD_047.spin
Additions:
xxx!<cr> resumes user code at cog address xxx (i.e. goto). xxx may be omitted for addr=0.
Dump code now also displays hex and hex reversed in addition to the instruction format. Works for both cog and hub.
Ctl-Z<cr> now passes control to the Rom Monitor (was <esc> but that conflicts with p2load Terminal mode) LSD_047.spin
Sapieha,
No problems. Glad I can help. Any suggestions/requirements can only make the tool more useful to everyone.
I am not sure what you are asking on your last request.
Sapieha:
If you wish to post your modifications to the _RX routine, I will include them to make it easy for you to comment out or skip my _RX. This should make it easier for your to use my later versions.
Sapieha,
No problems. Glad I can help. Any suggestions/requirements can only make the tool more useful to everyone.
I am not sure what you are asking on your last request.
0X0 < LONG else 1 - 8 HEX digits. filled with 0 to made one Long.
0X0 --- Address of COG's mem to write to.
<
Command that wait's for imput of HEX value to be placed in COG
After that wait for input --- If CR
> move HEX to long specified in 0X0
Comments
How I can modify Yours LMM RX routine to have "waitio" only flag without waiting to sample Character
I think this is what you will need to do...
Your user code will then need to look for the beginning of the start bit and immediately call _RX routine
Thanks.
Will see If I can manage that changes to Yours LMM.
Cluso.
It is possible You can add that type display of one LONG
0AF- 000011 000 1 CCCC 1FF 1FF
Then I can use my break to IN Real values display that POSITION in COG to see how that long have be modified
How do you want to get the cog address in there?
Postedit
Would you like it to be an option for the DUMP command? (use _CODE option) We already have _COG/_HUB so we could dump hub LMM too.
It can be DUMP -- One long at time.
jmp ENDS
Every time I place that (jmp ENDS) break address I recompile and reload.
And after it run I check what happens in that parts code and its variables
Addresses that I'm interested of -- I find by look in CTRL-L option in PNut
I have added the mode #_DUMP+_COG+_CODE
There are 2 calls in the sample part of the program (lmm_x is the cog address and lmm_y is the mode - they are both sticky with the address incrementing). I have not done hub mode for this yet. I have just coded it simply for now.
LSD_045.spin
It is correct what I have wanted.
Have You merged Check_Serial in this version to ?
Here is another update. It now works for hub too.
I have added two new commands to the Debug/monitor mode (interactive mode)...
xxx'<cr> will display the cog address (instruction) code, and
xxxxx"<cr> will display the hub address (instruction) code.
A <cr> will display the next address.
Note leading zeros may be omitted in the addresses.
LSD_046.spin
No, I have not added the check_serial. I need to think about how to have both options.
THANKS.
Now it function that wanted - I can break and see what instructions are doing
You can also return to your code and continue too. Currently I use <esc> and that terminates p2load's terminal program, so I need to rethink another control char to return to the user cog code.
I'm are one that never will be happy --
excuse that !
So I have one question?
How much work it are to made that?
Ps. Mode for showing Real addressees with instructions Bits --- Give me simpler work to debug my Basic.
Thanks
Thanks
I wanted both ---> First HEX are for simple showing BIN in correct arrangement
---> in RAM are for seek in WinHex else like HEX file editor to find it
Next question are more complicated.
one more command to COG showing
"<" GoTo Address XXXX
000<
Run this addres
what about z and c flags - just ignore?
No need for preserve Flags.
Only GoTo any COG address I specify on DEBUG command line --- So I don't need Edit 1 value in Code -- Recompile and load.
I simply can place ADD XXXXX,#1 and test many rounds before need for Recompile and reload
else with RXLine manage moving new value to Variable
Not need for single stepper For me.
I use to that KEY's-1,2,3 on DE2-115
But to that I need ---- RUN (GoTo) --- XXX address in COG
Additions:
xxx!<cr> resumes user code at cog address xxx (i.e. goto). xxx may be omitted for addr=0.
Dump code now also displays hex and hex reversed in addition to the instruction format. Works for both cog and hub.
Ctl-Z<cr> now passes control to the Rom Monitor (was <esc> but that conflicts with p2load Terminal mode)
LSD_047.spin
VERY much THANKS.
Ps. I'm sure I find more things ---- If You will not be crazy on me
Merged with my work on 046.
Function correctly.
If You don't are crazy on me !!!.
I have one more question?
0X0 < LONG else 1 - 8 HEX digits. filled with 0 to made one Long.
No problems. Glad I can help. Any suggestions/requirements can only make the tool more useful to everyone.
I am not sure what you are asking on your last request.
Really looking forward to your Basic.
If you wish to post your modifications to the _RX routine, I will include them to make it easy for you to comment out or skip my _RX. This should make it easier for your to use my later versions.
Thanks for that word's
What I'm asking for is.
Input COMMAND to any of COG's
Long
0X0 < LONG else 1 - 8 HEX digits. filled with 0 to made one Long.
0X0 --- Address of COG's mem to write to.
<
Command that wait's for imput of HEX value to be placed in COG
After that wait for input --- If CR
> move HEX to long specified in 0X0
New DEBUG commands...
aaa$dddddddd<cr> stores long "dddddddd" into cog address "aaa"
aaaaa#dddddddd<cr> stores long "dddddddd" into hub address "aaaaa"