SDC2130 TTL Serial Communication

9 years 3 months ago #29529378 by ldavisfl
According to the SDC2130 manual, Pins 6 and 7 of the DSUB 15 are for TTL TxD/CANL and TTL RxD/CANH, respectively.

I will not be using CAN. My script will be sending a short value (2 digits) to a TTL based external display.

Questions:

(1) When using the SDC2130 TTL Tx port (pin 6), must I explicitly direct the print output to the TTL pin? Or is all output sent simultaneously to both the TTL/RS232 pins (pins 2&3) and USB?

I'd prefer to send the value only to the TTL pin (and not the RS232? Is this possible? How? It would be nice not to send this info out on the USB line in the event that the controller is connected to the PC Utility.

(2) Since I am not using CAN, do I have to do something to indicate I am using TTL and not CAN?

Any syntax example of how I can send out a value over TTL Tx would be greatly appreciated.

Thank you.

Please Log in or Create an account to join the conversation.

9 years 2 months ago - 9 years 2 months ago #29529386 by Griffin Baker
Replied by Griffin Baker on topic SDC2130 TTL Serial Communication
To make the script output to the TTL serial port, he must send the configuration setconfig(_SCRO, 3). This configuration change is known to work for directing to either RS232 or USB.

If the can chip is not installed, then pins 6 and 7 are the TTL lines that are available for use.

Please Log in or Create an account to join the conversation.

9 years 2 months ago #29529387 by ldavisfl
The SDC21xx is "with USB and CAN interface." I don't see why this particular model would ever have no CAN chip.

In the Pin table, pins 6 & 7 are listed as follows:

Pin 6: TTL TxD/CANL (1)
Pin 7: TTL RxD/CANH (1)

Note 1: CANH and CANL on SDC2130N and SDC2150N versions.

The above is a bit cryptic to me. I definitely don't have the "N" versions.

Please Log in or Create an account to join the conversation.

9 years 2 months ago #29529388 by Griffin Baker
Replied by Griffin Baker on topic SDC2130 TTL Serial Communication
If you don't have the "N" version of the SDC2130, then it means the can chip is not installed. Therefore you are able to utilize the pins 6 and 7 for TTL use.

As far as it goes, we have not sold an SD2130N version. It has been available for the SDC2150 and the SDC2160.

Please Log in or Create an account to join the conversation.

9 years 2 months ago - 9 years 2 months ago #29529503 by ldavisfl
I am unable to detect any serial activity on the TTL lines with my digital oscilloscope. (I can, however, see clear activity on the RS232 lines). I see only a steady Vcc of about 3.3V on the TTL pins.

I have issued the config "setconfig(_SCRO,3)" from a script, as well as ^SCRO 3 from the console, in an attempt to get anything to transmit from the TTL TX pin (pin 6). Despite this, all script print statements continue to flow through RS232 to the console.

The possibilities I can think of are:

(1) _SCRO config setting is not implemented on my SDC2130 or the syntax isn't correct.
(2) TTL functionality isn't implemented on my SDC2130
(3) TTL is damaged?
(4) activation command required?

In general, there is scant mention of the TTL pins anywhere in the manual or on these forums (Other than they are on pins 6&7.) I am aware that TTL is inverted from RS232. That is not the problem.

I see that some people have gotten them to work (mostly with Arduino, etc.) Is there anything special required to make them active? Special implementation requirements?

I am using Firmware v1.3 RCB100 3/11/2014

Any assistance is appreciated.

Please Log in or Create an account to join the conversation.

9 years 2 months ago - 9 years 2 months ago #29529504 by ldavisfl
Update:

Just to be sure, I disconnected my RX (outbound) wire from the TX pin, on the chance my receiving device was influencing the pin. This made no difference at all... can't detect serial data o this pin with my digital scope.

Please Log in or Create an account to join the conversation.

9 years 2 months ago - 9 years 2 months ago #29529505 by ldavisfl
Update:

For reference, here is my script:

option explicit

setcommand(_RWD, 0) 'disable watchdog timer
dim count as integer 'loop counter
dim cpm as integer 'cycles per minute of pump, controlled by pot
dim vac as integer 'desired vacuum intensity, controlled by pot
dim temp as integer 'temp holding variable
dim disp as integer 'display integer
'
'INITIALIZE
'
count=0 'initialize cycle count
setconfig(_SCRO,3) 'set the microbasic print output to the TTL port
cycle: 'label header
if count=25
terminate 'end program

else
gosub getcpm
gosub getvac
gosub display 'update the display
count=count+1
goto cycle
end if


'
'getcpm 'read pot and convert to a value from 30-90
'
getcpm:
cpm=((getvalue(_AI,1)/83)+30)/3 'reads in pot and assigns cpm a value between 30 and 90 cycles per min '/3 for debug
print("cpm= ",cpm)
return

'
'getvac 'read pot and convert to a value from 1-10
'
getvac:
vac=1+getvalue(_AI,4)/555 'reads in pot and assigns getvac a value between 1 and 10
print(" vac= ",vac,"\r")
return

'
'display 'update the display
'
display:
disp=cpm*100+vac 'for example, cpm=60 & vac=5 yields 6005
print(disp) 'print disp
wait(1000)
return

Please Log in or Create an account to join the conversation.

9 years 2 months ago #29529506 by ldavisfl
As another attempt to try something, I decided to put my script into autorun mode (starts when controller is powered) and detach the RS232 lines. My script should be writing to the TTL pins due to setconfig(_SCRO,3)

My theory was that the presence of the RS232 connection might be overriding the TTL, or preventing it from turning on. However, I am still unable to find any output at all on the TTL pin.

Please Log in or Create an account to join the conversation.

9 years 2 months ago #29529507 by Griffin Baker
Replied by Griffin Baker on topic SDC2130 TTL Serial Communication
Have you tried running a console command to do this?

It will report back a + or a -.

^scro 3

Please Log in or Create an account to join the conversation.

9 years 2 months ago #29529508 by ldavisfl
Yes indeed I have tried that and the controller replies +.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.079 seconds