- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all
I think I know why i am getting the above message so what I would like to know is it possible to fit 1 UART, 2 SPI and 4 I2C connections into my CYBLE-014008-00 design? Can I just utilise GPIO pins and 'make' connections to save on resources?
Thank you in advance
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The pin connections for the SCB based UART are fixed/restricted and cannot be changed.
The CY8C14008 module has got 2 SCBs and 4 UDBs (3 of those are needed to build a UART), so with the chip selected you are hopelessly out of resources.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have overloaded you resources. You need to put your design in a bigger chip like Psoc 5LP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks very much, is it possible to just use, for example UART, 2 pins and do the connection in software without using any SCB's?
This is V1 prototype so PSoC 5 will be implemented but BLE was needed for this design
Thanks again
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also sorry is it possible to use 1 SPI or I2C block for multiple connected components? Just toggle the appropriate CS?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The pin connections for the SCB based UART are fixed/restricted and cannot be changed.
The CY8C14008 module has got 2 SCBs and 4 UDBs (3 of those are needed to build a UART), so with the chip selected you are hopelessly out of resources.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks very much lads for your help, yes primary reason for selecting this chip was the ble, how silly of me. Just last question could I have theoretically an I2C component and a SPI component and then use various GPIO pins for chip select. Physically my 4 I2C devices are connected to the same I2C PSoC component/pins and same for my 2 SPI components, connected to the one PSoC SPI component/pins, Data is only read from the 'Enabled' component?
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, for 1 I2C master and one SPI master addressing up to 4 SPI slaves are resources in your PSoC CYBLE-014008-00.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry Bob just to be clear, I have enough resources in my cyble to implement an i2c master and control a couple of slaves and an spi master and control my slave devices?
Thanks for the valuable help
regards
paddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you are right: 1 i2c master controlling several (~100) slaves and additionally 1 SPI Maser controlling several (depending on ss-line IO pins available) SPI slaves.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much Bob , I was getting desperate and was going to add an i2c and/or spi multiplexer. Phew. Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob sorry one last question, using an I2C master and connecting all the sda lines together and the sclk lines together, how does the PSoC address an individual slave component?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the slave address in the APIs as MasterSendStart()
Byte I2C interface is quite simple: After setting up the component and starting it you use
I2C_MasterSendStart(DeviceAddress,I2C_WRITE_XFER_MODE); // Initialize a transaction for writing
I2C_MasterWriteByte(Register); // Indicate which register you want to write to
I2C_MasterWriteByte(Value); // Write to register
I2C_MasterSendStop(); // End of transaction
When you want to read from a device you use (example for reading two bytes
I2C_MasterSendStart(DeviceAddress,I2C_WRITE_XFER_MODE); // Initialize a transaction for writing
I2C_MasterWrite(Register); // Indicate which register you want to write to
I2C_MasterSendRestart(DeviceAddress,I2C_READ_XFER_MODE);
I2C_MasterReadByte(I2C_ACK_DATA); // Read from register
I2C_MasterReadByte(I2C_NAK_DATA); // Read from register, last byte is NAKed
I2C_MasterSendStop(); // End of transaction
Not too difficult. Keep in mind that most of the APIs (except those for reading a byte) return a status byte which, when non-zero indicate an error condition.
The high-level APIs must be used in this way:
Writing to slave Count bytes
I2C_MasterWriteBuf(SlaveAddress,DataPtr,Count,I2C_MODE_COMPLETE_XFER);
Reading from Slave sending register byte first:
I2C_MasterWriteBuf(SlaveAddress,&RegAddress,1,I2C_MODE_NO_STOP);
I2C_MasterReadBuf(SlaveAddress,DataPtr,Count,I2C_MODE_REPEAT_START);
What slaves (Sensor? Link to datasheet?) are you connecting? Do not forget the pull up resistors on sda and scl lines.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Again many thanks Bob, yes have my pull up resistors in place. The 4 components are:
http://www.freescale.com.cn/files/sensors/doc/data_sheet/MMA7660FC.pdf?fpsp=1
https://cdn-shop.adafruit.com/datasheets/BST-BME280_DS001-10.pdf
http://www.atmel.com/images/Atmel-8885-CryptoAuth-ATSHA204A-Datasheet.pdf
My small problem is up till now I have been a hardware/pcb guy and now I am catching up and teaching myself (trying) the firmware/software side too
Any and all help greatly received
Regards
Paddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An Irishman named Paddy! Its been a very long time past that I visited Ireland...
Care for the Atmel chip, the I2C address seems to be initially 0x64 which is not clearly listed in the datasheet.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
haha yes and a long line of Paddy's at that! what part where you in?
thanks for all the help
regards
Paddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cork, Kerry, Dingle, Gap of Dunloe... some long trips on a motorbike... All roads marked "Not safe for horse caravans" were mine 😉
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah fab part, i'm on the east coast in drogheda. Really appreciate the help have given me an education in I2C and saved me PCB real estate as all my slave devices are on different I2C addresses
regards
Paddy