Quantcast
Channel: Cypress Semiconductor - PSoC 4 Architecture
Viewing all 764 articles
Browse latest View live

Timer 2.70 no interrupt on terminal count

$
0
0

Hi, 

I need a one shot 30 sec timer in my project with an interrupt on terminal count. 
I think the timer component is configured correctly and it works as expected (counts for 30 sec and fires interrupt), when I attach the interrupt component to the "tc" output of the timer. 
However, if I attach the interrupt component to the "interrupt" output, the interrupt never get fired (the ISR method is never being entered) although the counter counts down to zero and stops counting as expected being a one shot timer. 

What do I miss? 

Here is my design (part): https://www.dropbox.com/s/1ndrfp3wzxlobil/one-shot-timer.png?dl=0 
Here is my timer config: https://www.dropbox.com/s/zx4625z1thdabub/one-shot-timer-conf.png?dl=0 

Here is my code, attached you will find my test project as well: 

#include <stdio.h> 
#include "project.h" 

void readData(); 
void logMsg(); 
static char logMsgLine[255]; 
static uint8 isr_flag_timer_tc = 0; 

/** 
* Timer ISR 
*/ 
CY_ISR( Timer_Int_Handler ) 

if (Timer_ReadStatusRegister() & Timer_STATUS_TC_INT_MASK) { 
isr_flag_timer_tc = 1; 

sprintf(logMsgLine, "Interrupt %d looking for %d\n\r", Timer_ReadStatusRegister(), Timer_STATUS_TC_INT_MASK); 
logMsg( logMsgLine ); 

int main(void) 

CyGlobalIntEnable; /* Enable global interrupts. */ 

UART_Start(); 

Timer_Int_StartEx( Timer_Int_Handler ); 

for(;;) 

readData(); 

void readData(){ 

// Start the 30 sec timer 
isr_flag_timer_tc = 0; // will be set to 1 on tc interrupt 
Timer_Start(); 
Timer_Trigger_Write( 1 ); 

// loop until 30 sec timer terminal count 
while(!isr_flag_timer_tc){ 
// do something until 30 sec are over 
sprintf(logMsgLine, " timer count %d\n\r", Timer_ReadCounter()); 
logMsg( logMsgLine ); 
CyDelay(1000); 

if (isr_flag_timer_tc) { 
isr_flag_timer_tc = 0; 
// stop timer 
Timer_Stop(); 

/** 
* write a message to some terminal/chanel 
*/ 
void logMsg(char* msg) 

UART_UartPutString( msg ); 

/* [] END OF FILE */


Low RSSI using CYBLE-224110-00 (non-extended)

$
0
0

I am experiencing low signal strength when using  the CYBLE-224110-00 in short range (i.e. PA/LNA disabled). My setup has it connected to the Pioneer CY8CKIT-042-BLE.

I have a simple BLE component that's advertising at 0dB TX power. RSSI (as checked on multiple known-good Android handsets) when right next to it is around -77dB - it should be more like -40.

If I enable the PA/LNA, then the RSSI improves massively to better than -30dB. However, the current will exceed our budget.

Is there any reason  the signal strength is so poor with the PA/LNA disabled? 

 

 

 

CSX Based Slider Design Guidelines?

$
0
0

I cannot find any information on CSX slider design, is a guideline out there? Information on a suitable TX trace and spacing would be helpful. 

I have a CY8CKIT-145-40XX and notice that slider design differs from the guidelines found in AN85951 @ pg117. 

 

I would also like to recommend a dedicated sub-forum for CapSense specific questions. 

 

Creating HEX file fromt the ELF file from command line

$
0
0

Hi,

I would like to extract the HEX file that can be flashed with PSoC programmer from the generated ELF file. 

Is cyelftool.exe the tool to do it?  

 

Connect VREF to a pin in PSoC4

$
0
0

I was doing some searching on how to route the internal 1.024V VREF to an external pin 1[7] and found a link to an old blog that is now dead. Any pointers would be appreciated.

 

Dead link: ...cypress.com/blog/psoc-hacker-blog/connect-vref-pin-psoc4

4200L Best way to extract uint16 from CAN Message?

$
0
0

Hi,

I'm searching for an easy way to extract/put uint16 form/in CAN Messages/Mailboxes

Before (with other Platform) I do this:

                UB12=(*(short *) &CAN_Receive_Data[1]);
                UB24=(*(short *) &CAN_Receive_Data[3]);

        (*(short *) &CAN_Send_Data[1])=UB12;
        (*(short *) &CAN_Send_Data[3])=UB24;

Regards,

Michael

4200L Best way to scan mutiple Channel with ADC_SAR

$
0
0

Hello,

witch is the best way to scan multiple Channel with PSoC4 4200L with Multiplexer and ADC_SAR (see picture)? With DMA?

I need a continius anf fast Scan of all 14 Channels.

Any Code Samples available? 

Regards,

Michael

 

Attachments: 

Programming of psoc-4

$
0
0

i want to make program header for program my external project which is based on psoc-4.

i have a miniprog3.

till now i am using psoc-4 kit. so dont need header.

can you tell me which pins i have to connect miniprog3 to psoc-4(cy8c4245axi-483) for external programming.

 

 

 


Fixed Number Advertisement Packets

$
0
0

Has anyone worked with sending only a fixed number of advertisement packets from the radio before?

I tried using the cypress function CyBle_GappSetNumOfAdvPkts(&cyBle_discoveryModeInfo,3) to send 3 packets, but it seems to only want to send one. Even trying to count the number of advertisement start_stop messages didn't work for manually sending each packet.

Does everyone use timers for advertising for a flat amount of time instead? I would think there is a way to do a fixed number of packets; e.g exactly 7 or something.

Reserve Flash for user data

$
0
0

I am developing an application on the 4100 BLE module and I need to reserve the last 160 rows of flash (address space 0001B0000 - 0001FFFF) for my user data. The flash that is not used for the firmware code appears to be cleared to 0's on reset and BLE stack load or unload. Is there a compiler directive that will prevent the underlying OS from clearing a specified section of memory?

Protecting the memory in the PSoC Creator 4.0 GUI only prevents any writes to the locations by F/W.

Rick

Inverted Output on TCPWM (STOP) not work

$
0
0

Hello,

I have problems to setup a TCPWM with inverted Output.

I selected in PWM/Output line signal: Inverse output and when PWM is running the Signal is inverted.

But when I stop the PWM Port Pin goes LOW, but I need HIGH (also Inverse).

Also tried with Output line_n signal (Direct output/Inverse output), but still the same on Stop Port Pin is LOW.

Pull-up Resistor activated still also has no effect.

Regards,

Michael

USBUART hangs when PC not get the data.

$
0
0

Hello,

I want to put some debug Messages to the PC, but when the PC not connected the Program hangs in the 'while':

        while (USBUART_CDCIsReady() == 0u); // wait until buffer clear
        USBUART_PutString(txData);

Any solution to get information that PC is ready to receive data?

Regards,

Michael

Best way to call API's with only a different number?

$
0
0

How is the best way to call API's with only a different number? Example:

        PWM1_Start();
        PWM2_Start();
         ......
        PWM12_Start();
   OR

        PWM1_Stop();
        PWM2_Stop();
        .....
        PWM12_Stop();
     

like:

        for(i=1;i<=12;i++) {

                PWM[i]_Stop();

         }

Regards,

Michael

DeepSleep / Watchdog timing problems when using BLE

$
0
0

Hi,

I try to implement the following scenario:

boots -> process a task in ACTIVE mode for exectly 2 sec -> deep sleep for 5 sec -> task for 2 sec -> deep sleep 5 sec and so on.

This works great with WDT (wakeup from deep sleep after counting WDT intervals until 5 sec are reached) and a one shot timer (to time the 2 sec task duration).
But if I add BLE functionality into the design, something does not fit any more. I invested already two days into it, and read of course all the available PDFs (BLE getting started + Low-Power Modes and Power Reduction Techniques) , I analised the LPM example project but it uses the WDT differently then me.

I prepared a use case project (with oth) to analyse the problem, which uses LEDs and UART for logging.

So without BLE, where everything is fine, the following expected LED sequence can be observed:

GREEN (task) for 2 sec
BLUE (deep sleep) for 5 sec 
during BLUE phase above 4 WHITE flashes every 1 sec (WDT interval ticks, reentering deep sleep)
end of BLUE phase above 1 WHITE double flash (wake up from deep sleep)

and so on...

UART logs the following sequence, (the single point after each WDT tick stays for reentering deep sleep mode).

Do something...
Try to sleep...

WDT tick: 1
.
WDT tick: 2
.
WDT tick: 3
.
WDT tick: 4
.
WDT wakeup

 Now if I enable BLE (un-comment #define ENABLE_BLE in main.h), I observe the following pattern

GREEN for 2 sec
GREEN for 2 sec
BLUE flickering for about 3 sec
during BLUE phase above 2 WHITE flashes every 1 sec (WDT interval ticks, reentering deep sleep)
end of BLUE phase above 1 WHITE double flash (wake up from deep sleep)

and so on...

UART logs the following sequence

Do something...
Try to sleep...
Update GATT database...
Do something...
Try to sleep...

WDT tick: 2
....................................................
WDT tick: 3
..............................................................................
WDT tick: 4
.............................................................................
WDT wakeup

One can see many single points between WDT ticks, so the program tries reentering deep sleep very often but stays there only for a short time. I suppose it is because of the BLE subsystems interrupts, which would be fine if the average power savings were OK which I did not measure now. Am I correct with this assumption? How can I tune the intervals here, I did not catch this in the docs.
But what really bothers me is the fact, that work phase (GREEN) occurs twice without any sleep phase between, and that the deep sleep phase itself is shorter as expected (something above 2 sec instead of 5).
Eventually the program crashes after some time sooner or later. I am not experienced enough yet to debug this :-)

Why does BLE interfere with the WDT timer so radically? I would expect, that the WDT does it work in background without any distortions using LFCLK. Giving WDT higher interrupt priority than BLESS or changing the LFCLK source from WCO to ILO does not make any difference in the pattern.

Is there anything I can do to fix my design? I will appreciate any optimizations.
What can I do to better understand the BLE low power behavior?

My project is attached to this post.

Thx

 

Edit: I found a logical error, now the timings are OK but the connection from a GAP client (CySmart app) can not be established reliably, especially during sleep phase. I would say this is my actual problem now + the random crashes after long running times.

CSX Based Slider Design Guidelines?

$
0
0

I cannot find any information on CSX slider design, is a guideline out there? Information on a suitable TX trace and spacing would be helpful. 

I have a CY8CKIT-145-40XX and notice that slider design differs from the guidelines found in AN85951 @ pg117. 

 

I would also like to recommend a dedicated sub-forum for CapSense specific questions. 

 


SAR ADC reading random values between 1430-1460

$
0
0

Hi 

 I am trying to read an analog signal with the SAR ADC. In the components (Analog), I plug in the analog signal wire directly to the + input of SAR ADC and use (Vss) as - input. 

 I am uisng external VRef (2.000 V) in the config parameter. 

 I am definite that I am getting analog signal from my sensor. However, my ADC reading is some random noise between 1430 - 1450. 

 

 I am using these commands: 

void init()

{ADC_Start();}

 

void readADC()

{

    ADC_StartConvert();
    ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
    val = ADC_GetResult16(0);

}

 

Please help me out if I am missing some commands.

Thanks

Chandra 

how to feed watchdog with cy8c4014sxi

PSOC 4 ADC Configuration Help

$
0
0

Hi all!

I am having trouble configuring my adc to my current sense circuit. I don't know what my sample rate should be and how the Acquisition time affects the sampling rate. I want to measure current from 0 to 2.7 Amps with a 24 Vac 60 hertz power supply. I know nyquist states the sampling rate must be twice the sampled signal (120 Hz)??? I have attached my circuit and adc configurations to this post if anyone has any suggestions.

Thanks,

Rick

 

 

I2S DMA configuration

$
0
0

Hello!

I was trying to adapt the original InterIcSound Project (for PSOC3/5LP) to a similar project for PSOC4. The problem here is that the DMA components are totally different from those in PSOC3/5LP and I tried to configure the DMAs as precise as possible according to the methods DmaRxConfiguration(); and DmaTxConfiguration(); in main from InterIcSound Project, but without any success.

I've attached my project and I am hoping that a someone can see what the problems are and maybe correct them; I have read the datasheets, but still I can´t get nowhere...

Thank you in advance for your time!

Read advertising data from PSoC 4200 BLE

$
0
0

I'm using the PSoC pioneer kit as both central and peripheral. I have been detecting the  presence of various advertising devices(mobile phones) when the kit is in Central mode. I'm reading the address of the peripheral devices (mobile phones) to distinguish them and store their instances (presence). But each time the address generated by the phones are different so i'm unable to hard-code the addresses in the PSoC. Secondly, how can i read the advertisment packet received at the PSoC which is sent by the phones (peripheral) ? Do I have to make any custom service to read the advertisment packet? 

Viewing all 764 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>