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 9 matches
CCS Forum Index
Author Message
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Tue Sep 12, 2017 3:51 am   Subject: Hardware SPI
I connected the SPI to a SPI bus analyser in the osculloscope, and here are the results,

Knowing that;
D0 : DO
D1 : SCK
D2 : CS

soft spi during mfrc522 communication
https://drive.google.co ...
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Mon Sep 11, 2017 6:37 am   Subject: Hardware SPI
thank you temtronic for clarification,
forgive my igonorance,

I use the scope as you said, and here is the results
soft SPI
[img]https://drive.google.com/file/d/0By2rhMw0TAvNRWM0YmhkV1lKWDA/vie ...
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Mon Sep 11, 2017 4:55 am   Subject: Hardware SPI
Maybe this

spi_write(reg & 0x7E);
output_bit(PIN_CS, 1);
spi_write(value);

Regards,
Atarek
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Mon Sep 11, 2017 1:10 am   Subject: Hardware SPI
PCM Programmer,

Thank you for your effort to make sure that i understand the concept,

according to what you said the correct answer is to make NSS logic high between the 2 byte transmission,

...
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Mon Sep 11, 2017 12:33 am   Subject: Hardware SPI
HI PCM Programmer,

Thank you for the explanation,
but in the last section you mentioned the following

In the code below, you are manually handling chip select, and you are
keeping it low for ...
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Sun Sep 10, 2017 7:57 am   Subject: Hardware SPI
Hi Temtronic,

Thank you for the quick feedback,

the list file of the software SPI
.................... SoftSPI_write(reg & 0x7E);
0052: MOVF 65,W
0054: ANDLW 7E
0056: MOVWF 67 ...
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Sun Sep 10, 2017 7:00 am   Subject: Hardware SPI
here it is

void MFRC522_init(void) //MFRC522 chip initialization
{
MFRC522_writeReg(TModeReg, 0x8D);
MFRC522_writeReg(TPrescalerReg, 0x3E);
MFRC52 ...
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Thu Sep 07, 2017 6:38 am   Subject: Hardware SPI
Thank you Ttelmah for your quick feedback,
but it seems that i have another problem. When i try to use the hardware SPI, the micro controller does not exit any routine that uses hardware SPI.

So t ...
  Topic: Hardware SPI
Atarek

Replies: 18
Views: 37098

PostForum: General CCS C Discussion   Posted: Thu Sep 07, 2017 2:57 am   Subject: Hardware SPI
Hi everyone,

I need advice in something,
I am trying to interface MFRC522 using hardware SPI. However, I fail every time. I thought to share the code, and maybe someone can help me.

The descrip ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group