It is currently 19 Apr 2018 16:16

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 01 Feb 2013 16:36 
Offline

Joined: 11 Oct 2012 13:39
Posts: 10
Good Day,

I am attemping to build and energy meter by interfacing the PIC18F45k22 with the CS5463. I am self learnt in C and come from an assembler background.

I've had a little board made with the CS5463 chip to fit into the mikroe V7 mikrobus slot 1.

By now i have attemped to communicate with the chip using snippet from the ADC click board and examples from the library but on all accounts cannot seem to get the SPI to communicate.

I've checked the signals on the SCK and MOSI/RC5 and i see pulses present.
I see no pulses on MISO.

I've triple checked the board connection and all seems in order.

Is the and way someone can supply me with some working code for this SPI interface.

My wife is about to divorce me with all the time im spending in my little work shop!
HEHEEHEHEHE!!!

Any help will me appeciated.

Thank you kindly
William


Top
 Profile  
 
PostPosted: 04 Feb 2013 12:13 
Offline

Joined: 11 Oct 2012 13:39
Posts: 10
Hi all,

I have got the SPI communication working now. The problem turned out to be the SPI initialization.
Initianlly I used the advanced SPI initialization with these settings and it did not work:

SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV64, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);

Then is changed the SPI_MASTER_OSC_DIV64 to SPI_MASTER_OSC_DIV4 and i got communication.

I do not understand how this is working because i am using a 8MHZ crystal with x4 PPL enable hence 32MHZ.
The CS5463 has a maximum SPI speed of 2MHZ.
So 32MHZ/4 = 8MHZ.
If i try 16MHZ and 64MHZ this just does not work.
If anyone knows why this is happening i would be happy to get to the bottom of this.


Top
 Profile  
 
PostPosted: 08 Aug 2013 08:52 
Offline

Joined: 08 Aug 2013 08:50
Posts: 1
Sir,
Please share your schematic and code


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: