You are here

psoc 5 serial connect scilab | Cypress Semiconductor

psoc 5 serial connect scilab

Summary: 5 Replies, Latest post by fernnando28 on 07 Dec 2015 04:52 PM PST
Verified Answers: 0
Last post
Log in to post new comments.
fernnando28's picture
89 posts

 Tengo un problema con psoc 5 que conecta el puerto serie USB al scilab Agenda

aquí está el scilab código:
CLF; // Borra la pantalla
n = 7000; // Número de muestras
y = queridos (1, n-1); // Vector acerca de dónde se almacenan los datos adquiridos
h openserial = (2, "9600, n, 8,1 '); // Abre el puerto serie
i = 1; // Declara un contador
x = [0: 1: n]; // Vector para el trazado de datos
mientras i <= n // ciclo para la adquisición de datos
    olla = ascii (readserial (h)); // Almacena los datos recogidos en la variable olla
       pot (i) // asigna elemento 1 pot el i-ésimo elemento del vector y
        XPAUSE (800); // Hace una pausa de 800 microsegundos
        i = i + 1; // Incrementar el contador
  final // fin termina la adquisición
closeserial (h) // cierra el puerto serie
fernnando28's picture
89 posts

 I have a Problem With psoc 5 That Connects the USB serial port scilab Agenda

Here is the scilab code:
clf;                                               //limpia la pantalla
n=7000;                                      //numero de muestreos
y=ones(1,n-1);                            //vector de unos donde se almacenaran los datos adquiridos
h=openserial(2,"9600,n,8,1");    //abre el puerto serial
i=1;                                             //declara un contador
x=[0:1:n];                                    //vector para realizar la graficación de los datos                     
while i<=n                                   //ciclo para la adquisición de los datos
    pot=ascii(readserial(h));           //guarda el dato obtenido en la variable pot
       pot(i)                       //asigna el elemento 1 de pot al i-esimo elemento del vector y
        xpause(800);                       //realiza una pausa de 800 microsegundos
        i=i+1;                                  //incrementa el contador
end                                             //termina la adquisición
closeserial(h)                              //cierra el puerto serial
user_14586677's picture
7646 posts

I assume the code you are showing is on the scilab side of the design ?


Common problems serial links (PSOC is Host) -


1) Baud rate clock not set to correct baud in PSOC

2) Interface from PSOC is TTL, you have to have level shifter/translator like

MAX232 to interface to another RS232 device, like a PC, connected to


3) Global interrupts not enabled in PSOC.

4) Client side settings should include no flow control.

5) Null modem cable interconnect between host and client, eg. Rx to Tx, Tx to Rx

between host and client.


Set up a test where Host is Txing and look at signal lines with a scope to see if you

are getting ~ signal levels referenced to ground -


The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels for the data transmission and the control signal lines. Valid signals are either in the range of +3 to +15 volts or the range −3 to −15 volts with respect to the ground/common pin; consequently, the range between −3 to +3 volts is not a valid RS-232 level.


Regards, Dana.





fernnando28's picture
89 posts

if you send data but in string format but I want to vector

kishan.k13_1519686's picture
1 post

Is it possible to make a serial communication of matlab and PSoC 5LP????If Yes how??


fernnando28's picture
89 posts

YES. I use scilab resembles Malab, only a Prgrm open sorce.
Communication to the library for serial communications (UART) can suction.

Log in to post new comments.