Shop OBEX P1 Docs P2 Docs Learn Events
Servo Propellor problem with Windows XP — Parallax Forums

Servo Propellor problem with Windows XP

GTMeijerGTMeijer Posts: 2
edited 2011-07-04 09:07 in General Discussion
I am trying to control a servo via Matlab using the Propellor Servo Controller USB. I'm accessing the USB port as a virtual COM port through Matlab. It works fine on a computer running Windows 7, 64-bit (altough the Matlab version is 32-bit) but it does not work on a computer just running Windows XP. Suggestions?

This is the code I use:

% Delete all instances that are connected to the COM ports
a = instrfind;
delete(a);
clear;

%Connect to the port
ComPort = serial('COM3');
fclose(ComPort);

% setup parameters
set(ComPort,'BaudRate',2400,'Databits',8,'Parity','none', 'StopBits',2)
fopen(ComPort);

servoPos = 900;
chan = 14;
sramp = 10;

% calculate lo and hi byte values
hiByte = floor(servoPos/256);
loByte = servoPos - hiByte * 256;

% display servoPos value
str = sprintf('servoPos = %6d Lo = %3d Hi = %3d', servoPos, loByte, hiByte);
disp(str);

% create string for the PSC, terminate with $0D
str = sprintf('!SC%c%c%c%c\r',chan,sramp,loByte,hiByte);

% write to PSC
fwrite(ComPort,str);

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-04 08:08
    Make sure you have the correct I/O driver installed on the XP machine. There's no difference from the Servo Controller's perspective whether the PC is using Windows 7, Windows XP, or Linux for that matter. You can always download the latest I/O driver from FTDI's website (http://www.ftdichip.com/FTDrivers.htm).
  • GTMeijerGTMeijer Posts: 2
    edited 2011-07-04 09:00
    Thanks for the quick reply! I have installed the newest FTDI driver, however I did first install the firmware that comes with the servo propellor, can it be that these drivers conflict?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-04 09:07
    No. The FTDI driver on the PC simply provides a serial port. On the Propeller Servo Controller, the serial port is provided by hardware (the FTDI chip) and the Propeller and its firmware are not affected.
Sign In or Register to comment.