PSoC™ 4 Forum Discussions
Hi - I've successfully modified the capsense proximity project to add more data characteristics and changed their names and change the numbers various ways w/ no problem.
Now I'm trying to change the data to float32, and did so also in the BLE GATT server to be float32 for the characteristic - but am getting an incompatible pointer type:
void SendData(float32 Ah, float32 V, float32 A, float32 S, float32 D)
{
CYBLE_GATTS_HANDLE_VALUE_NTF_T notificationHandle;
if(busyStatus == CYBLE_STACK_STATE_FREE)
{
notificationHandle.attrHandle = CYBLE_EBIKEDATA_AMPHOUR_CHAR_HANDLE;
notificationHandle.value.val = &Ah; <-- incompatible pointer types assigned to uint8 from float32
notificationHandle.value.len = NOTIFICATION_DATA_LEN;
CyBle_GattsNotification(connectionHandle,¬ificationHandle);
#define NOTIFICATION_DATA_LEN 4
Looking for how to update different data types, or where the uint8 is baked in, or an example to copy. Thanks!
Minimal bundle attached.
Show LessHi there,
I'm Nuno and I've just started to play with PSoC 4, first time on PSoCs. Just wanted to say Hi and leave my 1st PSoC project, which I called "programmable infinite resolution triangle wave generator". Big name, uh :)?
It's a remake of the traditional analog capacitor based opamp and voltage comparator triangle wave generator, but this time the charging and discharging of the capacitor is under digital control. You have the "pure analog" output but can control frequency, and this can make it to at least 245KHz in 1KHz steps. It needs calibration because as the frequency goes up the time spent in the comparator ISR influences more and more the output amplitude/frequency, but the relation is linear; with the calibration values on the source code it generates a wave of nominally 10KHz .. 245KHz in 1KHz steps, 1Vpp, 120mV offset.
This was made with the prototyping board, so you have the bootloader in there. I noticed that once a PC application opens the serial port you have a kind of crosstalk between the comparator's output and the opamp's output.
If you have any feedback or just want to say hi, don't be shy :)!
Cheers!
Show LessI'm working with a module that requires me to keep the CS pin active during the whole transmission process that consists of sending a few commands in order to do one task. The module is NRF24L01.
For example, if I want to write data to a register, I have to bring CS pin low, send a write-to-register command with the register's address, send another byte of data with the values I want to put in that particular register, and then bring the CS pin high. I assume that this can be simply done with the SCB_SpiUartPutArray(const uint16/uint8 wrBuf[], uint32 count) command.
However, when I want to read data from a register, I have to bring the CS pin low, send a read-from-register command with the register's address, send dummy byte(s), receive data, and then bring the CS pin high. I probably don't understand SPI communication good enough, but I'd like to know how I'm supposed to do such operation.
With the CS pin active, the NRF module sends data back after receiving commands* etc., so I'm assuming I simply have to use the aforementioned SCB_SpiUartPutArray function to send the command and dummy bytes, and the data received will be already waiting in the RX FIFO to be read out using SCB_SpiUartReadRxData() command.
Is this the correct way it works? Please, correct me if I'm wrong, and thanks in advance.
Jacek
* Actually it sends data back after every command. It ALWAYS sends back the STATUS register.
Show LessHi,
I am still at work on a project using the DMX RS485 protocol used for lighting systems. Basically what this application does is receive the data (512 bytes) in, shift it over depending on the address requested by two capsense buttons, and send it back out starting at that address.
The problem I am having is that the data streams need to be continuous, at least for all 512 bytes plus some start of stream indication. The two ISRs are constantly firing for each byte because it takes to long either to read it all in, and then to write it all out at once and causes jerky reaction from the lights.
My question is if there is a way to have the receiving ISR go until its buffer is full, then turn off, and turn on the transmit ISR. The transmit ISR would then transmit it's 512 bytes, and turn off, turning back on the receive ISR.
I may be going about this in a very convoluted way, please let me know if that is the case as well.
Thank you, see attached project.
Tom
Show LessHi all,
Which is the best way to send/receive raw data (array ex: uint8 txBuffer[32]; ) from mobile to PSOC4 BLE board.? The data might be a commands.
Which profile i need to choose while creating project?
Thanks,
Ashok r
Show LessI work with the SPi Master Version 2.40.
First I enable the internal IRQs for RX Fifo not empty and Tx Byte complete with the configuration tool (schematic view) and everything works fine, the IRQs are fired as I exspect it.
Then I use the API function SPIM_DisableRxInt() and start the test again, but the Rx IRQ still fires.
Then I use the API function SPIM_SetRxInterruptMode(0u) with the parameter 0 to disable the RX IRQs and as exspected the RX IRQ is disabled.
So my question is why the API function SPIM_DisableRxInt() does not disable the RX IRQs ?
Thank for your help.
Show LessHi all,
I am trying to create a beacon type device that advertises some data once every few seconds.
How do I disable the advertisement timeout?
The General Discoverable Mode in the BLE_v1_10.pdf states:
General Discoverable Mode – In this mode, the device should be used by devices that need to be discoverable continuously or for no specific condition.
But one can't disable the advertisement timeout.
Maybe I'm missing something. Should I restart the advertisement from the CYBLE_EVT_TIMEOUT event?
Thank you,
Errol