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 support@ccsinfo.com

PIC24HJ256GP610 SPI DOESN'T WORK FOR 4.134 *** Locked - Dup

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ck



Joined: 02 May 2012
Posts: 18

View user's profile Send private message

PIC24HJ256GP610 SPI DOESN'T WORK FOR 4.134 *** Locked - Dup
PostPosted: Fri Nov 30, 2012 7:50 am     Reply with quote


++++++++++++++++++++++++
Locked.

Reason: Duplicate topic. No new thread on same SPI topic !

Add new code to your PIC24 SPI thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=49508

- Forum Moderator
++++++++++++++++++++++++


Hi,
I try this code with 2 different compile version. For 4.134 no data came out from SPI-D0. With 4.104 data come out. Any suggestion?

Code:

#include <24HJ256GP610.h>

#DEVICE ADC=12
#fuses NOWDT   //No Watch Dog Timer
#fuses NOWRTB   //Boot block not write protected
#fuses NOBSS   //No boot segment
#fuses NOPROTECT  //Code Protected form reads
#fuses NOWRT   //Program memory not write protected
#fuses PR_PLL   //Primary Oscillator with PLL
#fuses NOCKSFSM   //Clock Switching disabled
#fuses NOOSCIO   //OSC2 is clock output
#fuses HS      //Primary oscillator HS
#fuses WINDIS   //WD in non-windows mode
#fuses WPRES128
#fuses WPOSTS16
#fuses PUT128   //No Power on Reset Timer value
#fuses IESO   //Internal external switch Over mode disabked //NOIESO
#fuses NORSS   //No secure segment RAM
#fuses NOSSS   //No secure segment
#fuses NOWRTSS   //Secure segment not write protected
#fuses NORBS   //No Boot Ram defined
#fuses NODEBUG   //No debug mode
#fuses NOJTAG   //JTAG DISABLED


//reset
#word RCON   = 0x0740
//PLL
#word CLKDIV = 0x0744
#word PLLFBD = 0x0746

void main(){
        RCON=0b0000000001000000;
   
   CLKDIV=0;
   PLLFBD=0x1E;
   
   
   //watch dog OFF
   setup_wdt(WDT_OFF);

   
   #use fast_io(F)
   set_tris_f(0b0000000010110001);
   output_f(0);

   
   //SPI 1
   setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_4);   

       while(TRUE)
              spi_write(0b010101010);
     
}

Why in case of 4.104 i see a square wave in SPI-1-DO and with 4.134 nothing?
Thanks in advantage
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group