Exact match. Not showing close matches.
PICList
Thread
'[SX] Dual UART problems continue'
2005\06\03@173523
by
ForumAdmin
|
|
I rewrote some of the code thinking that the comparison code was going wrong somewhere in the SendDigit function, but the output is very similar. In the code Multi4.src the SX is constantly putting out codes to the speakjet for point and negative over and over again. In the modified code Multi5.src the SX is constantly sending out the codes for digits 2-9, point, and negative over and over again. In both cases the Multimeter being on or off, connected or not makes no difference. If anybody can figure out why this is it would really help me a lot.
Thanks,
-John Whitfield
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\03@203704 by ForumAdmin
|
|
John,
I changed your code a little.
My changes have ;PV--comment in front of them.
Try it and let us know the result.
regards peter
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76020
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\03@211407 by ForumAdmin
|
|
Cool, now it only outputs the welcome and nothing else which is great. Thank You.
Does anybody have any ideas on why the program is not reading the data, could it be a timing issue?
-John Whitfield
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76024
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\03@221631 by ForumAdmin
|
|
In the following section of code, is the output set up for eight data bits and one stop bit? Or is that handle by the earlier code segment of transmit1? If so how can I alter it to make it seven data bits and two stop, as is needed?
; This routines sends a string to the DMM - it expects the index into the
; string table in w.
;
; Note: Sets bank to Serial
;
_SendString1
mov Temp, w ; Save index into string table
bank Serial
:WaitTxDone1
test TxCount1 ; Test if transmitter is busy
sz
jmp :WaitTxDone1
mov w, #Strings >> 8 ; Copy the upper 4 bits of the
mov m, w ; string table into the lower 4
; bits of m
mov w, Temp ; Restore the index
iread ; Read one byte indirectly
test w ; Test for end of string
snz
jmp :out1
mov TxHigh1, w ; Put character into transmit register high
setb TxHigh1.7 ; Force bit 7 to high for the 1st stop bit (the
; 2nd one is automatically sent by the transmitter)
clr TxLow1 ; Clear transmit register low for start bit
mov w, #10
mov TxCount1, w ; 1 start, 8 data, 1 stop (this also starts the
; transmitter)
inc Temp ; Point to next charater in the string table
jmp :WaitTxDone1 ; Loop back
:out1 mov w,#$1F ; reset the mode register
mov m,w
;PV--use a retp to return to the caller's page, a simple ret may not do
retp
2005\06\03@225843 by ForumAdmin
|
|
John,
The M3850 only samples about 3 times a second (successive DAC), which means you should limit datarequests to max. 2 per second, i.e insert a 0.5 sec delay in your mainloop.
eg.
MainLoop
;PV--wait 0.5sec before another reading
call @delay_0s5
clr !wdt
call @GetString1 ; Read a data-set from the DMM (sets bank to DMM)
Also be sure the DMM pins DTR and RTS get the right steady signal (-10V and +10V) but I believe you already solved that.
regards peter
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76042
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\03@231605 by ForumAdmin
|
|
John,
When I tested my M3850 with a terminal program, I had it set to 8N1, which works because bit7 is always clear (so 7N2 equals 8N1)
_SendString1
mov Temp, w ; Save index into string table
bank Serial
:WaitTxDone1
test TxCount1 ; Test if transmitter is busy
sz
jmp :WaitTxDone1
mov w, #Strings >> 8 ; Copy the upper 4 bits of the
mov m, w ; string table into the lower 4
; bits of m
mov w, Temp ; Restore the index
iread ; Read one byte indirectly
test w ; Test for end of string
snz
jmp :out1
mov TxHigh1, w ; Put character into transmit register high
;PV--now that we can use 8N1 no need to force bit7 high
; setb TxHigh1.7 ; Force bit 7 to high for the 1st stop bit (the
; 2nd one is automatically sent by the transmitter)
clr TxLow1 ; Clear transmit register low for start bit
mov w, #10
mov TxCount1, w ; 1 start, 8 data, 1 stop (this also starts the
; transmitter)
inc Temp ; Point to next charater in the string table
jmp :WaitTxDone1 ; Loop back
:out1 mov w,#$1F ; reset the mode register
mov m,w
;PV--use a retp to return to the caller's page, a simple ret may not do
retp
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76043
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\04@120710 by ForumAdmin
|
|
I inserted the delay and changed the code based upon the above segment, but it still doesn't read in data. I know that the DTR and RTS are right since when I use them at the voltage to go into a terminal program at regular RS232 it works. I really am not sure as to why the code doesn't work, since it seems like it should. Here is the present code, as always, any ideas are welcome.
Thanks,
-John Whitfield
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76079
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\04@130043 by ForumAdmin
|
|
John,
Can you connect the SX pins that would connect to the DMM, to a pc com port?
Then check with a terminal program if you receive 'D'. Reset the SX after terminal has started up.
If you don't receive the 'D', the transmit routine is not correct, and the DMM does not recognize the 'D'.
regards peter
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76084
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\04@141239 by ForumAdmin
|
|
I didn't receive it.
-John
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76089
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\04@160010 by ForumAdmin
|
|
John,
The end of the delay must be retp!
_delay_0s5
Delay: ;delay function
;24999987 cycles
mov w, #$70
mov d1, w
mov w, #$2A
mov d2, w
mov w, #$27
mov d3, w
Delay_0:
decsz d1
jmp $+2
decsz d2
jmp $+2
decsz d3
jmp Delay_0
;7 cycles
jmp $+1
jmp $+1
nop
;6 cycles (including call)
;PV--asimple ret will not do
retp
You call the delay from another page so a simple ret will not return to the mainloop!
Hence, the 'D' may not have been transmitted. I believe the transmit1 routine is ok.
regards peter
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76094
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\05@124850 by ForumAdmin
|
|
Yeah now I am getting D's sent out to the terminal program, but the program still doesn't pass data across to the speakjet from the output of the multimeter. I don't know if its not getting it in or what. One other small thing is that it sends out a lower case t before it sends out the upper case D's, meaning the terminal output is like this...
tDDDDDDDDDDDDDDDDDDDDDDDD...
But it is still not getting input, comparing it, and sending out corresponding codes to the speakjet if anyone can figure this out, then the whole thing should work.
Thanks,
-John Whitfield
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76164
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\05@134238 by ForumAdmin
|
|
John,
I wouldn't be concerned about the first 't', because the DMM ignores it anyway.
The fact that you get multiple 'D' means you wait and receive the right number of bytes from the DMM.
Try this:
connect the DMM to the SX as it must be,
connect the SX output for the speakjet to the PC com port running the terminal program (9600 baud)
Output the received bytes from the DMM to the speakjet output. then you see the DMM response.
Main
jmp @_Main
GetByte1
jmp @_GetByte1
GetString1
jmp @_GetString1
SendString1
jmp @_SendString1
SendString2
jmp @_SendString2
SendDigit
jmp @_SendDigit
delay_0s5
JMP @_delay_0s5
;PV--add entry to transmit single byte to speakjet
SendByte2
JMP @_SendByte2
MainLoop
call @delay_0s5
clr !wdt
call @GetString1 ; Read a data-set from the DMM (sets bank to DMM)
;PV--test DMM input only
jmp Mainloop
_SendString2
bank Serial
mov Temp, w ; Save index into string table
:WaitTxDone2
;------------------------------------------------------------------------
; G.D. I'm not sure if this is enough to find out if the SpeakJet is busy
;
; movb c, RxPin2 ; get current rx bit
; test RxCount2 ; currently receiving byte?
; sz
; jmp :WaitTxDone2
;------------------------------------------------------------------------
; G.D. It is absolutely necessary to wait until the transmitter no longer
; busy. Otherwise false data will be transmitted.
; Therefore, I have inserted the instructions here that you have removed
;
test TxCount2
sz
jmp :WaitTxDone2
;------------------------------------------------------------------------
mov w, #Strings>>8 ; Copy the upper 4 bits of the
mov m, w ; string table into the lower 4
; bits of m
mov w, Temp ; Restore the index
iread ; Read one byte indirectly
test w
snz
jmp :out2
call @SendByte2 ;transmit the byte
inc Temp ; Point to next charater in the string table
jmp :WaitTxDone2 ; Loop back
:out2
mov w,#$1F ; reset the mode register
mov m,w
retp
_SendByte2
bank Serial ;byte to transmit in w
:WaitTxDone21
test TxCount2 ;does not affect w
sz
jmp :WaitTxDone21
mov TxHigh2, w ; Put character into transmit register high
clr TxLow2 ; Clear transmit register low for start bit
mov w, #10
mov TxCount2, w ; 1 start, 8 data, 1 stop (this also starts the
; transmitter)
retp
_GetByte1
bank Serial
sb RXAvail1 ; Check if the DMM has sent a byte
jmp _GetByte1
clrb RXAvail1 ; Clear the flag for the next byte
mov w, RxByte1
and w, #%01111111 ; Clear the 2nd stop bit
mov Temp,w
;PV--temporarily redirect DMM input
call @SendByte2 ;output DMM input to speakjet output
mov w,Temp ;restore w
retp
If you make the little changes above, you should see the DMM response to 'D'.
As this response consists of 14 letters, digits and spaces, they should be visible in the terminal program. If you get garbage in the terminal, then the DMM receive is incorrect because you know the speakjet transmit is working.
regards peter
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76168
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\06@203842 by ForumAdmin
|
|
Hey everybody thanks a lot for your help. Your last message made me realize through an exhaustive brute force method that the speakjet operates at TTL voltages and that I needed to run the multimeter through the max233 the other way. With a little tweeking of the delay it should work properly, since it sounds like it doesn't delay long enough. So, the last code I posted with the alterations made above should allow anyone to make a talking multimeter using the SX, a MAX233, a speakjet chip, and a METEX multimeter.
Thanks,
-John Whitfield
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76314
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\06@220242 by ForumAdmin
|
|
I wanted to be sure there was no confusion and that stuff contained in the message right above the last one does not need to be changed in the code. Just to avoid confusion I will upload the working file, and if any one says they are interested I will upload the final code after I work out the last few bugs.
Thanks Again,
-John Whitfield
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76322
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\06@224730 by ForumAdmin
|
|
Please do, John.
You can post the final code and schematics here or in the Projects forum.
regards peter
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76329
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
2005\06\07@185510 by ForumAdmin
|
|
Here is a slightly improved version of the code.
-John Whitfield
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=76011#m76444
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)
More... (looser matching)
- Last day of these posts
- In 2005
, 2006 only
- Today
- New search...