View previous topic :: View next topic |
Author |
Message |
Jody
Joined: 08 Sep 2006 Posts: 182
|
Going from 18F4455 -> 18F4620 (#FUSES problem???) |
Posted: Tue Aug 30, 2011 6:05 am |
|
|
Hello,
What I have:
PIC18F4455 and the ethernet controller ENC28J60.. this works well.
So my hardware seems to be ok.
Now I want to use the same hardware but with the PIC18F4620...
And what I am doing I can't get it working......
Included the PIC18F4455 fuse settings and hardware connection...
Compiler version: 4.119
Crystal: 20MHz
Code: |
#include <18F4455.h>
#device ICD=TRUE
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //Reset when brownout detected
//#FUSES BORV21 //Brownout reset at 2.1V
#FUSES PUT //Power Up Timer
#FUSES NOCPD //No EE protection
#FUSES NOSTVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //Debug mode for use with ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOPBADEN //PORTB pins are configured as digital I/O on RESET
#FUSES NOWRTC //configuration not registers write protected
#FUSES NOWRTB //Boot block not write protected
#FUSES NOEBTR //Memory not protected from table reads
#FUSES NOEBTRB //Boot block not protected from table reads
#FUSES NOCPB //No Boot Block code protection
#FUSES NOLPT1OSC //Timer1 configured for low-power operation
#FUSES NOMCLR //No Master Clear pin used for I/O
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES PLL1 //No PLL PreScaler
#FUSES CPUDIV1 //No System Clock Postscaler
#FUSES NOUSBDIV //USB clock source comes from primary oscillator
#FUSES NOVREGEN //USB voltage regulator disabled
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,bits=8,stream=PORT1)
#use fast_io(B)
#use fast_io(C)
#define PIN_ENC_MAC_SO PIN_B0 // PIC <<<< ENC
#define PIN_ENC_MAC_CLK PIN_B1
#define PIN_ENC_MAC_INT PIN_B2
#define PIN_ENC_MAC_CS PIN_B3
#define PIN_ENC_MAC_RST PIN_B5
#define PIN_ENC_MAC_SI PIN_C7 // PIC >>>> ENC
//#define PIN_ENC_MAC_WOL PIN_B1
#define ENC_MAC_USE_SPI TRUE //due to an errata in the ENC28J60, you should always use HW SPI to assure that SPI clock is over 8MHz!
#define mac_enc_spi_tris_init() TRISB= 0b00000101; TRISC = 0b0;
|
and the PIC18F4620 fuse settings.
Code: |
#include <18F4620.h>
#device ICD=TRUE
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //Reset when brownout detected
#FUSES PUT //Power Up Timer
#FUSES NOCPD //No EE protection
#FUSES NOSTVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //Debug mode for use with ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOPBADEN //PORTB pins are configured as digital I/O on RESET
#FUSES NOWRTC //configuration not registers write protected
#FUSES NOWRTB //Boot block not write protected
#FUSES NOEBTR //Memory not protected from table reads
#FUSES NOEBTRB //Boot block not protected from table reads
#FUSES NOCPB //No Boot Block code protection
#FUSES NOLPT1OSC //Timer1 configured for low-power operation
#FUSES NOMCLR //No Master Clear pin used for I/O
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,bits=8,stream=PORT1)
|
What am I missing??????
Regards,
Jody |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Aug 30, 2011 9:46 am |
|
|
for a start you need to be a lot more clear about what you have analyzed about the "non working performance" you are pointing to.
a link to a viewable schematic of what is there in hardware would be helpful , as would the code that actually handles the ethernet controller.
also the register/ hardware init you do to the pic itself.
are you using fast_io() ?
also ....
because you are migrating from a PIC with integral USB functions
and differing port B functions in particular - you need to examine your
register intialization VERY CAREFULLY to make sure you are not running afoul of internal default capability in the 4620 that you are not expecting
or do not understand yet.
in short
it is not instantly clear that the fuses alone are the problem. it could very well be register init that is raining on your parade and maybe not the fuses at all. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Tue Aug 30, 2011 9:53 am |
|
|
Also, depending on which pinout version of the two chips you are using (DIP or SM), the surface mount 4455, has separate pins for ICD available, which the 4620 doesn't have. since ICD is enabled, could be a problem....
Best Wishes |
|
|
Jody
Joined: 08 Sep 2006 Posts: 182
|
|
Posted: Tue Aug 30, 2011 11:24 am |
|
|
I was a fool!!!!!!
The SPI interface is on some other pin's.
So don't use the hardware SPI. I used the software version.
It is working right now.
Thanks for the assistance!!! |
|
|
|