ck
Joined: 02 May 2012 Posts: 18
|
PIC24HJ256GP610 SPI DOESN'T WORK FOR 4.134 *** Locked - Dup |
Posted: Fri Nov 30, 2012 7:50 am |
|
|
++++++++++++++++++++++++
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 |
|