PSoC™ 4 Forum Discussions
Dear all,
I am using CY8CKIT-049-42xx kit to interface with my DS3231 RTC module via I2C,
I tried to initialize the RTC by the following code but did not works, i am not sure about this I2C communication,
please help me , if any example code or project is avilable?
I2CM_I2CMasterSendStart(I2C_SLAVE_ADDR,I2CM_I2C_WRITE_XFER_MODE);
I2CM_I2CMasterWriteByte(0x00);// 00H register
I2CM_I2CMasterWriteByte(0x00);// sec
I2CM_I2CMasterWriteByte(0x00);// min
I2CM_I2CMasterWriteByte(0x00);// hrs
I2CM_I2CMasterWriteByte(0x01);// day
I2CM_I2CMasterWriteByte(11); // day
I2CM_I2CMasterWriteByte(12);//month
I2CM_I2CMasterWriteByte(16);//year
I2CM_I2CMasterSendStop();
Thanks,
Ashok R
Show LessHello I doing use the BLE and the UART communication in PSOC creator.
But I don't have use the BLE in receiver and to transmit with the uart
I had test the program one the 100 project day's, I'm a starter and I don't understand..
Can you help me
Show LessHello,
I'm trying to use the gettimeofday function. My project compiles and builds without error. In the code, I initialize the members of the struct timeval tv (tv.tv_sec and tv.tv_usec) to 0 and then call gettimeofday. After calling gettimeofday, I examine tv.tv_sec and tv.tv_usec and they are still 0. Is function gettimeofday not supported?
A little more information... I am trying to create a delay function that will delay on the order of microseconds. Here is a code snippet:
gettimeofday(&tvStart, NULL);
usecStart = tvStart.tv_sec * 1000000 + tvStart.tv_usec;
do
{
gettimeofday(&tvNow, NULL);
usecDiff = tvNow.tv_sec * 1000000 + tvNow.tv_usec - usecStart;
}
while (usecDiff < DelayInMicroSeconds);
Thanks,
BB
Show LessI am using the Host Controller Mode in the PSoC 4200 BLE CY8C4248LQI-BL483. I want to use the highest speed available 921600 bps
I get this message:
Clock Warning: (BLE_HAL_Uart_SCBCLK's accuracy range '12 MHz +/- 2%, (11.76 MHz - 12.24 MHz)' is not within the specified tolerance range '14.746 MHz +/- 5%, (14.008 MHz - 15.483 MHz)'.).
It seems that the UART needs a clock 16 times the baud rate. If I assume that the clock in use is 12 MHZ Cristal freq) I could operate the UART at 750000 bps.
I have done that; I send a command HCI_RESET and the device response with a envent that has the expected number of bytes (7) but they are all 0xFF
Show Lesshow can i use eeprom on psoc-4.??
i read emulated eeprom component datasheet. there is only write function which can write the data but i cant find the function which can read the data from eeprom.
Show LessCan anyone please suggest me or send me a sample code on how to add devices to whitelist while scannin. im looking to receive an address from the user via UART and add that to whitelist during scanning.please send a sample code if possible.
Thankyou,
Vaisakh Haridas
email-vaisakh.hari21@gmail.com
mob-+91 8879009971
I tried to make the same thing as the man in this video: https://www.youtube.com/watch?v=rQjvZwaCM14
My project is attached.
So when I connect potentiometer to pin 2[5] (and of course other two to GND and VDD) and rotate it, LED is blinking the same whole time, which is wrong. I don't know where is the problem. Later I want to print the voltage defined by potentiometer in terminal, but right now I'm feeling that this doesn't reflect input voltage at all.
I need this for my college project.
Can someone please help me? Thanks
Show LessProblem: GPIO interrupt source is not initiating a software reset, as specified, from Hibernate. What are the possible reasons? EZ-BLE 4100
I have configured a GPIO the same as in the Hibernate_PSoc4_Example and do not see my device entering the Reset Vector when the input is switched to ground. Prior to entering Hibernation I stop all my other interrupt ISRs, disable resources and outputs driving loads. Next I perform the following sequence:
isr_SW_Enable();
SW_ClearInterrupt();
isr_SW_ClearPending();
isr_SW_StartEx(&ButtonPressInt);
CySysPmHibernate();
The GPIO input (SW) is set as a digital input, initialized High with a pullup. Its interrupt is set to falling edge, transparent, dedicated and buffered. The isr_SW is configured to DERIVED.
In the debugger the code waits at (seen when I pause the debugger):
CyExitCriticalSection(interruptState); in void CySysPmHibernate(void) of cyPm.c
Resuming in the debugger and commutating SW to ground the code vectors to the ButtonPressInt instead of resetting to the top of main() as expected.
In standalone mode, the system just hangs. Any cause for not resetting that I'm overlooking?
Rick
Show Less(disclosure: I followed the capsense tutorial to get my original code working)
I'm able to successfully send single int values from my app to the BLE device. This is easy enough taken from the example code:
func writeLedCharacteristic(var val: Int8) {
let ns = NSData(bytes: &val, length: sizeof(Int8))
capsenseLedBoard!.writeValue(ns, forCharacteristic: ledCharacteristic, type: CBCharacteristicWriteType.WithResponse)
}
I updated my BLE custom profile for the led characteristic so that it now looks like this (see Download IMG_0327.jpg):
Really only changed the type to uint16
so that it would accept more characters. My rational here was that the capsense characteristic needed to be of type uint16
since more than a single bit was going through. If you can't tell already I'm extremely new to this.
Next I updated my iOS code to try and send the data like this:
let string = "hello"
let bytes: [UInt8] = Array(string.utf8)
let data = NSData(bytes: bytes, length: bytes.count)
capsenseLedBoard!.writeValue(data, forCharacteristic: ledCharacteristic, type: CBCharacteristicWriteType.WithResponse)
I have updated my PSoC code to look like this:
/* only update the value and write the response if the requested write is allowed */
if(CYBLE_GATT_ERR_NONE == CyBle_GattsWriteAttributeValue(&wrReqParam->handleValPair, 0, &cyBle_connHandle, CYBLE_GATT_DB_PEER_INITIATED))
{
UART_UartPutString("did get write request LED");
char t = wrReqParam->handleValPair.value.val[0];
CyBle_GattsWriteRsp(cyBle_connHandle);
UART_UartPutChar(t);
//red_Write(!wrReqParam->handleValPair.value.val[0]);
}
When I run and test my code I don't even get acknowledgement that the iOS device sent anything..aka this is never spit out in HyperTerminal:
UART_UartPutString("did get write request LED");
My initial thought was that I was encoding was wrong so tried changing the led Custom Characteristic type to uint8
how that is still not working!
The other issue is that from what I can tell I should be getting a char
array from this line handleValPair.value.val[0]
in PSoC however I'm not sure how exactly to extract that into an array.
Again, I'm extremely new to this lower level stuff, my C
is amateur at best. Any help is very much appreciated!!
Hello all,
I currently have a watchdog timer setup to 2 seconds (divider is 16bit @65535) and would like to extend it to 30 seconds. I use the built in auto generated watchdog timer that uses the LFCLK. Is there any way to do this? Can I use WDT2? If so how??
Thanks,
Rick
Show Less