1/25/2014 Fuses for Pic18f4550

Microcontrollers are really awesome , they are everywhere  that's the reason why actually I'm working on a proyect that involves it. The market has a wide range of  manufacturers like Atmel, Microchip, Motorola among others in order to this I've chosen Microchip by his usability and his features between them :
memories(ROM , RAM, EEPROM), Ports, serial IO (input and output) devices, Timers and Interrupt sources, Adc converters, Comparator, Pwm modules and others.

Another thing to say is they are commonly know as PIC microcontrollers PIC or just  PICmicro. They  have a Harvard architecture, and instruction words are unusual sizes. Originally, 12-bit instructions included 5 address bits to specify the memory operand, and 9-bit branch destinations. Later revisions added opcode bits, allowing additional address bits.
Picmicro are divided in family based on the word assembly language instruction, varying from 8 ,16, 32 bits depending on the specific PIC.The family clasification can be found here :


Pic 18f4550:

Pic 18f4550 

When you're in a proyect you need to make the right choices and this pic is great it came with 32Kb of  flash memory and other nice features, here is a sumary of the most valuable:

  •  IC, 8BIT FLASH MCU, 18F4550, PDIP40
  •  Controller Family/Series: PIC18F4xxx
  •  Program Memory Size: 32KB
  •  RAM Memory Size: 2KB
  •  CPU Speed: 48MHz
  •  No. of I/O's: 35
  •  Digital IC Case Style: DIP
  •  No. of Pins: 40
  •  Embedded Interface Type: EUSART, I2C, SPI, SPP, USB
  •  Supply Voltage Min: 4.2V
  •  Supply Voltage Max: 5.5V
  •  MSL: -
  •  SVHC: No SVHC (20-Jun-2013)
  •  Core Size: 8bit
  •  Device Marking: PIC18F4550-I/P
  •  EEPROM Memory Size: 256Byte
  •  Flash Memory Size: 32KB
  •  IC Generic Number: 18F4550
  •  IC Temperature Range: Industrial
  •  Logic Function Number: 18F4550
  •  Memory Type: Flash
  •  Microprocessor/Controller Features: SPI, I²C, CCP, ECCP, SPP, EUSART, 2 x Comparators, 1 x 8-bit timer, 3 x 16-bit timer
  •  No. of ADC Inputs: 13
  •  No. of Bits: 8
  •  No. of Internal Interrupts: 20
  •  No. of PWM Channels: 5
  •  No. of Timers: 4
  •  Number of bits In Timer: 16
  •  Number of bits in ADC: 10
  •  Operating Temperature Max: 85°C
  •  Operating Temperature Min: -40°C
  •  Operating Temperature Range: -40°C to +85°C
  •  Oscillator Type: External, Internal
  •  Peripherals: ADC, Comparator, PWM, Timer

Fuses Pic 18f4550:
This part was taken from the avr tutorials its very well explained:

Fuses are an extremely important part programming a chip, but are rarely explained thoroughly. You only need to set them once, but if you don't do it right, it's a disaster!
What is a fuse?
You know about flash, eeprom and RAM as parts of the chip. What I did not mention is that there are also 3 bytes of permanent (by permanent I mean that they stick around after power goes out, but that you can change them as many times as you'd like) storage called the fuses. The fuses determine how the chip will act, whether it has a bootloader, what speed and voltage it likes to run at, etc. Note that despite being called 'fuses' they are re-settable and dont have anything to do with protection from overpowering (like the fuses in a home). 

As we can read in the quote above they're  necesary for a proper operation , the other thing is that when you're flashing out this chips they have a code protection fuses which if you activate this you won't be able to use the microcontroller again,because you're protecting  a session in rom memory.

Here are the fuses that I've been using this week, remember this is for a pickit 3 proper development , this will work with another programmer that has circuit debuger like icd and others.

just save this code as a fuses.h and include in your main.c  program.
#ifndef FUSES_H
#define FUSES_H

#ifdef __cplusplus
extern "C" {

#pragma config PLLDIV = 5       // (CRISTAL DE 20 MHz),Divide by 5 (20 MHz oscillator input)
#pragma config USBDIV = 2       //USB clock source comes from the 96 MHz PLL divided by 2
#pragma config CPUDIV=OSC1_PLL2 //Primary Oscillator Src/1][96 MHz PLL Src/2]  cpu trabajara a 48Mhz.
#pragma config FOSC = HSPLL_HS  //HS oscillator, PLL enabled (HSPLL)
#pragma config FCMEN = OFF      //Fail-Safe Clock Monitor disabled
#pragma config IESO = OFF       //Oscillator Switchover mode disabled
#pragma config PWRT = ON        //Power-up Timer Enable bit
#pragma config BOR = OFF        //Brown-out Reset Enable bits: Brown-out Reset
                                //enabled in hardware only (SBOREN is disabled)
#pragma config BORV = 0         //Brown-out Reset Voltage bits,Maximum.
#pragma config VREGEN = ON      // USB voltage regulator enabled
#pragma config WDT = OFF        //WDT disabled (control is placed on the SWDTEN bit)
#pragma config WDTPS = 32768    //Watchdog Timer Postscale Select bits>> 1:32768
#pragma config MCLRE = ON       //MCLR pin enabled; RE3 input pin disabled
#pragma config LPT1OSC = OFF    //Timer1 configured for higher power operation
#pragma config PBADEN = OFF     //PORTB<4:0> pins are configured as digital I/O on Reset
                                //If i need to use the RBx as analog in/out set this bit to ON
#pragma config STVREN = OFF     //Stack full/underflow will not cause Reset
#pragma config LVP = OFF        //PROGRAMACION EN BAJO VOLTAJE
#pragma config XINST = OFF      // Instruction set extension and Indexed Addressing mode enabled
                                //the above bit is used  enterely for debug program in circuit (ICPORT)
#pragma config CP0 = OFF        //Code Protection bit disable for 0,1,2
#pragma config CP1 = OFF        //
#pragma config CP2 = OFF        //
#pragma config CPB = OFF        //Boot Block Code Protection bit:
#pragma config CPD = OFF        //Data EEPROM Code Protection bit.
#pragma config WRT0 = OFF       //Write Protection bit for 0,1,2 is not write-protected
#pragma config WRT1 = OFF
#pragma config WRT2 = OFF
#pragma config WRTC = OFF       //Configuration Register Write Protection bit,disable
#pragma config WRTD = OFF       //Data EEPROM Write Protection bit,is not write protected
#pragma config EBTR0 = OFF      //000800-001FFFh
#pragma config EBTR1 = OFF      //Boot Block Table Read Protection bit,disable between
#pragma config EBTRB = OFF      //000000-0007FFh and 002000-003FFFh
#pragma config CCP2MX = OFF
#pragma config DEBUG = ON       //ENABLE FOR PICKIT 3

//DISABBLE THE DEBUG OPTION WHEN You're going to do the proper deployment.

#ifdef __cplusplus
#endif /* FUSES_H */
Digg it StumbleUpon del.icio.us

0 comentarios:

Post a Comment