CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 29 matches
CCS Forum Index
Author Message
  Topic: crm200 gyro sensor spi
m4k

Replies: 3
Views: 12304

PostForum: General CCS C Discussion   Posted: Sun Jan 17, 2021 10:03 am   Subject: crm200 gyro sensor spi
The key is this line:

for(i=0; i<Number_Of_Bytes; i++)

The chip returns 6 bytes. You simply drop the select, wait a moment
for it to be ready, then read six bytes. Then raise the select.
...
  Topic: crm200 gyro sensor spi
m4k

Replies: 3
Views: 12304

PostForum: General CCS C Discussion   Posted: Sun Jan 17, 2021 5:20 am   Subject: crm200 gyro sensor spi
hi..i work on gyro sensor crm200 ...its support spi and analog mode (adc). I can run analog mode and its work properly but in spi mode i have problem...
silicon sensing company Presentation a sample ...
  Topic: ADXL355 accelerometer code
m4k

Replies: 14
Views: 30130

PostForum: General CCS C Discussion   Posted: Sat Jan 16, 2021 12:33 am   Subject: ADXL355 accelerometer code
I don't use that PIC but..

SPI 'data' has always been 8 bits long, so a 'byte'. As a 'byte' of data, I think of it as an unsigned integer ( 0-255).

That PIC and//or compiler may default 'int8' t ...
  Topic: ADXL355 accelerometer code
m4k

Replies: 14
Views: 30130

PostForum: General CCS C Discussion   Posted: Fri Jan 15, 2021 4:46 pm   Subject: ADXL355 accelerometer code
On the 345, the R/W bit is bit 7. On your chip they instead use bit 0.
However you would not want to read register 0. Register 0, is just the
device ID register 0xAD (for Analog Devices).
You wou ...
  Topic: ADXL355 accelerometer code
m4k

Replies: 14
Views: 30130

PostForum: General CCS C Discussion   Posted: Fri Jan 15, 2021 5:11 am   Subject: ADXL355 accelerometer code
The address, for you will be the register address from the data sheet,
shifted left one bit, and ored with a R/W flat into the low bit. The chip
benoitsjean is using, is different. Your chip uses a ...
  Topic: ADXL355 accelerometer code
m4k

Replies: 14
Views: 30130

PostForum: General CCS C Discussion   Posted: Fri Jan 15, 2021 4:58 am   Subject: ADXL355 accelerometer code
I haven't used that one but I use the ADXL345 and I believe that the default SPI configuration was different than the EEPROM tied on that bus and I just haven't taken the time to make both work the sa ...
  Topic: ADXL355 accelerometer code
m4k

Replies: 14
Views: 30130

PostForum: General CCS C Discussion   Posted: Tue Jan 12, 2021 2:01 pm   Subject: ADXL355 accelerometer code
This thread shows how to write to an ADXL chip using #use spi() and
spi_xfer(). This is the newer method of using SPI with CCS. It can support
hardware or software SPI in the PIC:
http://www.ccs ...
  Topic: ADXL355 accelerometer code
m4k

Replies: 14
Views: 30130

PostForum: General CCS C Discussion   Posted: Tue Jan 12, 2021 1:23 pm   Subject: ADXL355 accelerometer code
Critical first question. What voltage PIC are you using?. This is a 3v
device, so really needs to be using a 3v PIC (3.6v max).
Second comment, the chip supports I2C as well as SPI. If you are
hap ...
  Topic: ADXL355 accelerometer code
m4k

Replies: 14
Views: 30130

PostForum: General CCS C Discussion   Posted: Tue Jan 12, 2021 10:57 am   Subject: ADXL355 accelerometer code
I am doing a project which monitors vibrations using an ADXL355 sensor. I have used the MPU-9250 sensor before.

I am not able to use spi function to read data in spi mode from the sensor. Can anyon ...
  Topic: builtin_dmaoffset function
m4k

Replies: 5
Views: 14343

PostForum: General CCS C Discussion   Posted: Wed Apr 15, 2020 12:35 pm   Subject: builtin_dmaoffset function
No.
You don't assign separate buffers. You assign a single buffer for the DMA
channel, and then structure this to suit the device.
If each ADC channel is set to use 8 word buffers, you would do som ...
  Topic: builtin_dmaoffset function
m4k

Replies: 5
Views: 14343

PostForum: General CCS C Discussion   Posted: Wed Apr 15, 2020 3:16 am   Subject: builtin_dmaoffset function
With CCS, you setup the ram buffer for DMA, using the command
#bank_dma, followed by a variable declaration for the buffer you
require.
If using peripheral indirect addressing, this buffer must s ...
  Topic: builtin_dmaoffset function
m4k

Replies: 5
Views: 14343

PostForum: General CCS C Discussion   Posted: Wed Apr 15, 2020 12:11 am   Subject: builtin_dmaoffset function
Hi CCS forum

I want to config dma on dspic33f and i use Microchip example code for learning.

// Align the buffer to 128 words or 256 bytes. This is needed for peripheral indirect mode
unsigned ...
  Topic: addressing register
m4k

Replies: 6
Views: 16422

PostForum: General CCS C Discussion   Posted: Tue Apr 14, 2020 3:11 pm   Subject: addressing register
tnx alot Ttelmah and pcm programmer. This method is working very well and I'm trying to expand that to other registers.

best regard
m4k
  Topic: addressing register
m4k

Replies: 6
Views: 16422

PostForum: General CCS C Discussion   Posted: Tue Apr 14, 2020 1:48 am   Subject: addressing register
You're using the PCD compiler, I believe. Look at how Ttelmah does it in
the following post:
http://www.ccsinfo.com/forum/viewtopic.php?t=56937&start=2
He makes a structure with all the bitfie ...
  Topic: addressing register
m4k

Replies: 6
Views: 16422

PostForum: General CCS C Discussion   Posted: Mon Apr 13, 2020 3:31 pm   Subject: addressing register
That's not a register. That's a defined constant.

But, if you were writing to a register, you could use the CCS functions
of bit_set() and bit_clear(). Look them up in the CCS manual:
http://ww ...
 
Page 1 of 2 Goto page 1, 2  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group