PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
Hi,
My product has an i2c connection (Vcc, Gnd, Sda, Scl) which is easy accessable. Programming connection are inside the product and difficult to access.
Until now I use a bootloader which waits 2 seconds for i2c bootloader trigger and after that it starts the normal application with the possibility to skip this waiting time by i2c command
It works but makes startup procedures and bootloading pretty complex to start [not only using the I2C Bootloading Application].
Now I was thinking why not trigger the bootloader by applying 5V0 to the Vcc ? My application always uses 3V3 so if I let the bootloader start as soon as 5V0 is applied it would make life much easier.
Before rewriting this part of my project I would like to know does anyone use this same concept ? Am I overlooking something ?
Thanks
Patrick
Show LessHi community, it's me again. I have had a very good time working on my project. I am developing an EMG Measuring device. My purpuse is to send ADC signals through serial port
I am using these modules
ADC SAR --> FILTER --> VDAC --> ADC DELSIG --> UART.
The signal filtered that comes back from the VDAC goes back to the ADC DELSIG. I haven't found a way to transmit directly from the filter to the UART through polling or DMA. I tried through DMA with the following register UART_TXDATA_PTR, but I get some random output in the serial port. Do you have any ideas? I would appreciate it.
Show LessI have been through the knowledgebase and applied suggestions
Project -> Build Options -> linker -> Command Line -> -u_printf_float
Then tried Linker -> General -> Use newlib nano ... False
Finally tried, asm (".global _scanf_float");
None of these seemed to help. I can sprintf decimal values and strings ok but not floating point.
I am using Psoc Creator 3.2 SP1, ARM GCC 4.8.4 compiler, debug build
Here is my code (initially I was trying to print a float var but set an exlicit value to test)
#include "stdlib.h"
char tbuf[50];
sprintf(tbuf,"%f",(float) 1.35);
When I run this my buffer has values like
0x00, 0x2E, 0x80, 0x00, 0x20, 0x11, 0x00 ...
instead of 0x31, 0x2E, 0x33, 0x35
Any help much appreciated
Regards
David
Show LessHello,
I'm working on useing a color sensor TCS3200, and first i wanted to know how it worked. So i used an arduino and tested in there because there is alot of help on the internet. Now i want to try to make it on PSoC creator. One thing i came across here is that on arduino they use a "map" function witch takes the value of a variable and converts it to a new range og values, like from 0 to 255. How can i make somthing like this on PSoC creator? is there already a funciton i dont know about?
Regards Mads
Show LessHi ,
I am using PSoc 5lp -050 kit and suddenly the target is empty when I try to load program. I am using USB cable for loading the program.
what is the solution for that ?
Show LessHi,
Good Evening,
I have closed the previous thread by mistakenly,
so again I'm opening this new thread.
I'm not able to find the solution yet, Is it possible to give idea about
the parameters used in varying the PWM in CY8C22545, or is there any
sample code or link which I could refer for Induction Cooker for capsense.
Many other parameters like power wattage calculation, pwm, temperature
values, is not able to understand so if I found some links it would be easy to
understand, I referred AN50475 but didn't find the solution.
Thank you.
Show LessI am using CY3280-20x66 Universal CapSense Controller.The default I2C pin is P[1]0-P1[1].I complied the example program.It works well.I can get data form Bridge Control Panel Software by usbing CY3240-I2USB Board.But I want to use another pair of I2C pins P[1]5-P1[7].I have changed the paremeters of EzI2Cs in the same project.And I connected I2USB to J2.But it doesn't work.What should I do to make it work except changing the I2C pin in the Parameters window of EzI2Cs?
Show LessHi, I am using the Cypress CY3274-HV PLC development Kit and need to install -PLC Control Panel (PLC_Control_Panel V3.4) and -CY3274-HV PLC Development Kit installer (CY3274Setup_revSB).
Please let me know if I will need a license for it?
Show LessHi, everyone. I'm doing a project in the PSOC but I have a problem when the PSOC receives data that arduino sends and I want to send it to the LCD I can not see the data and when I use the statement UART_WriteTxData (xxx); so that what arrives from the arduino send it to the PC if I can see the data well.
When i use
UART_WriteTxData (xxx); I can see the data and when I use
UART_PutString (xxx);
I can not see them well
/* ========================================
*
* Copyright YOUR COMPANY, THE YEAR
* All Rights Reserved
* UNPUBLISHED, LICENSED SOFTWARE.
*
* CONFIDENTIAL AND PROPRIETARY INFORMATION
* WHICH IS THE PROPERTY OF your company.
*
* ========================================
*/
#include "project.h"
#include <stdlib.h>
#include <stdio.h>
int fila;
int columna;
int q;
/***Variables para ADC**/
int32 entero[2],voltaje[2];
float32 volt[2];
float aux[2];
char str[16];
char str3[16];
char str4;
/*******UART********/
int recibir=0;
/************************/
unsigned int rango;
unsigned int tx=0;
unsigned int limite=4;
/********UART*******/
char str2[16];
/*********************/
int bit0_MSB,bit1,bit2,bit3_LSB,cuenta=0,numeroint=0;
char i='\0';
char numero[5];
/*************Teclado matricial*******/
char8 Keypad_1_Key[4][4]={
{'1','4','7','*'},
{'2','5','8','0'},
{'3','6','9','#'},
{'A','B','C' ,'D'}
};
/**********valores teclado********/
void LeerTecla(){
bit0_MSB=Bit0_MSB_Read();
bit1=Bit1_Read();
bit2=Bit2_Read();
bit3_LSB=Bit3_LSB_Read();
if((bit0_MSB==0)&&(bit1==0)&&(bit2==0)&&(bit3_LSB==0))//1
i=Keypad_1_Key[0][0];
if((bit0_MSB==0)&&(bit1==0)&&(bit2==0)&&(bit3_LSB==1))//2
i=Keypad_1_Key[1][0];
if((bit0_MSB==0)&&(bit1==0)&&(bit2==1)&&(bit3_LSB==0))//3
i=Keypad_1_Key[2][0];
if((bit0_MSB==0)&&(bit1==0)&&(bit2==1)&&(bit3_LSB==1))//A
i=Keypad_1_Key[3][0];
if((bit0_MSB==0)&&(bit1==1)&&(bit2==0)&&(bit3_LSB==0))//4
i=Keypad_1_Key[0][1];
if((bit0_MSB==0)&&(bit1==1)&&(bit2==0)&&(bit3_LSB==1))//5
i=Keypad_1_Key[1][1];
if((bit0_MSB==0)&&(bit1==1)&&(bit2==1)&&(bit3_LSB==0))//6
i=Keypad_1_Key[2][1];
if((bit0_MSB==0)&&(bit1==1)&&(bit2==1)&&(bit3_LSB==1))//B
i=Keypad_1_Key[3][1];
if((bit0_MSB==1)&&(bit1==0)&&(bit2==0)&&(bit3_LSB==0))//7
i=Keypad_1_Key[0][2];
if((bit0_MSB==1)&&(bit1==0)&&(bit2==0)&&(bit3_LSB==1))//8
i=Keypad_1_Key[1][2];
if((bit0_MSB==1)&&(bit1==0)&&(bit2==1)&&(bit3_LSB==0))//9
i=Keypad_1_Key[2][2];
if((bit0_MSB==1)&&(bit1==0)&&(bit2==1)&&(bit3_LSB==1))//C
i=Keypad_1_Key[3][2];
if((bit0_MSB==1)&&(bit1==1)&&(bit2==0)&&(bit3_LSB==0))//*
i=Keypad_1_Key[0][3];
if((bit0_MSB==1)&&(bit1==1)&&(bit2==0)&&(bit3_LSB==1))//0
i=Keypad_1_Key[1][3];
if((bit0_MSB==1)&&(bit1==1)&&(bit2==1)&&(bit3_LSB==0))//#
i=Keypad_1_Key[2][3];
if((bit0_MSB==1)&&(bit1==1)&&(bit2==1)&&(bit3_LSB==1))//D
i=Keypad_1_Key[3][3];
}
/**********rutina leer teclado********/
CY_ISR(LeerTeclaInt){
LeerTecla();
if((i!='A')&&(i!='B')&&(i!='C')&&(i!='D')&&(i!='*')&&(i!='#'))
{
if(cuenta<=3)
{
numero[cuenta]=i;
cuenta++;
}
}
if(i=='B')
{
numero[0]='\0';
numero[1]='\0';
numero[2]='\0';
numero[3]='\0';
cuenta=0;
}
if(i=='A')
{
numeroint=atoi(numero);
}
if(i=='*')
{
DIR_Write(0);
STEP_Write(1);
CyDelay(10);
STEP_Write(0);
CyDelay(100);
}
if(i=='#')
{
DIR_Write(1);
STEP_Write(1);
CyDelay(10);
STEP_Write(0);
CyDelay(100);
}
}
/*********Envio interrupcion********/
CY_ISR(Enviar)
{
sprintf(str3,"%d %d %d \n \r",recibir,voltaje[0],voltaje[1]);
UART_PutString(str3);
}
////////////////////////////////////////////////////////////////////////////////HERE
/**************Rutina recibir datos UART********/
CY_ISR(InterrupRX)
{
while(UART_GetRxBufferSize()>=1)
{
recibir=UART_GetChar();
//UART_WriteTxData(recibir);
}
}
////////////////////////////////////////////////////////////////////////////////HERE
/*************************************************/
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
I2C_Start(); //Inicializar el I2C
LCD_I2C_start(); //Inicializar la lcd
Opamp_Start();//Inicializa Opam
Opamp2_Start();
pulisr_StartEx(LeerTeclaInt);//Interrupcion
isrEnvio_StartEx(Enviar);
isrRX_StartEx(InterrupRX);
/***********UART****/
UART_Start();
/***************ADC******************/
ADC_Start();
/****************MUX*******************/
AMux_1_Start();
/***************************************/
columna=0;
fila=0;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("Ingresa los valores ");
columna=0;
fila=1;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("en MiliNewton(mN)");
CyDelay(600);
LCD_I2C_clear();
for(;;)
{
/****************Galga*****/
columna=0;
fila=2;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("mN=");
/***************************/
sprintf(str4,"%d",recibir);
columna=3;
fila=2;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print(str4);
LCD_I2C_print(" ");
/**********************Canal1************************/
AMux_1_FastSelect(0);
columna=0;
fila=3;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("mV=");
/********ADC*********/
ADC_StartConvert();
ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
entero[0]=ADC_GetResult32();
ADC_StopConvert();
voltaje[0]=ADC_CountsTo_mVolts(entero[0]);
aux[0]=voltaje[0];
/*********************/
sprintf(str,"%.0f",aux[0]);
columna=3;
fila=3;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print(str);
LCD_I2C_print(" ");
/***********************************************/
/**********************Canal2*************************/
AMux_1_FastSelect(1);
columna=10;
fila=3;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("mV=");
/********ADC*********/
ADC_StartConvert();
ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
entero[1]=ADC_GetResult32();
ADC_StopConvert();
voltaje[1]=ADC_CountsTo_mVolts(entero[1]);
aux[1]=voltaje[1];
/*********************/
sprintf(str2,"%.0f",aux[1]);
columna=13;
fila=3;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print(str2);
LCD_I2C_print(" ");
/***********************************************/
if((i!='A')&&(i!='C'))//SI no se presiona A ni C
{
columna=0;
fila=0;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("Ingrese Valor");
columna=0;
fila=1;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("mN=");
columna=3;
fila=1;
LCD_I2C_setCursor(columna,fila);
if(cuenta<5)
LCD_I2C_print(numero);
}
if(i=='A')//Si se presiona A
{
columna=0;
fila=0;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("Estirando fibra");
do
{
AMux_1_FastSelect(0);
columna=0;
fila=2;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print("mN=");
/********ADC*********/
ADC_StartConvert();
ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
entero[0]=ADC_GetResult32();
ADC_StopConvert();
voltaje[0]=ADC_CountsTo_mVolts(entero[0]);
aux[0]=voltaje[0];
/*********************/
sprintf(str,"%.0f",aux[0]);
columna=3;
fila=2;
LCD_I2C_setCursor(columna,fila);
LCD_I2C_print(str);
LCD_I2C_print(" ");
/*********************/
if(voltaje[0]<numeroint)
{
DIR_Write(0);
STEP_Write(1);
CyDelay(10);
STEP_Write(0);
CyDelay(100);
}
if(voltaje[0]>numeroint)
{
DIR_Write(1);
STEP_Write(1);
CyDelay(10);
STEP_Write(0);
CyDelay(100);
}
rango=numeroint-voltaje[0];
}
while(rango>limite);
i='\0';
LCD_I2C_clear();
}
if(i=='B')//Si se presiona B
{
i='\0';
LCD_I2C_clear();
}
if(i=='C')//Si se presiona C
{
if(tx==0)
{
tx=1;
LCD_I2C_setCursor(0,0);
LCD_I2C_print(" Transmitiendo ");
i='\0';
/**********************/
PWM_Start();/*PWM*/
CyDelay(1000);
/***********************/
i='\0';
LCD_I2C_clear();
}
else
{
PWM_Stop();
tx=0;
i='\0';
LCD_I2C_clear();
}
}
}
}
/* [] END OF FILE */
I hope you can help me
Show Less