jhasan
Newbie level 4
pic18f2431 fuses
Hi,
I am trying to program pic18F2431 using picstart plus.Below is my code in C which I am compiling using PIC C compiler.After that I am importing the hex file to MPLAB version 8.15a.Then using picstart plus firmware version 04.50.10.Also,I am putting a 0.1uF cap between Vdd and Vss pins and connecting AVdd pin with Vdd pin.
C Code:
#include <18F2431.h>
#include <bootloader.h>
#include <stdlib.h>
#include <stdio.h>
#fuses LP,PROTECT,NOIESO,NOBROWNOUT,NOWDT,BORV45,PUT,CPD,NOSTVREN,NOLVP,NOFCMEN,CPB,WDT1,MCLR,T1STANDARD,WRTC,WRTB,EBTRB,EBTR,DEBUG,WRT,WRTD
#use delay (clock=40000000)
#byte port_b=0x81
void main() {
set_tris_b(0x00);
while(TRUE){
output_high(PIN_B2);
delay_us(500);
output_low(PIN_B2);
delay_us(500);
output_high(PIN_B1);
delay_us(500);
output_low(PIN_B1);
delay_us(500);
output_high(PIN_B0);
delay_us(500);
output_low(PIN_B0);
delay_us(500);
}
}
When I do a erase it says "Erase operation is successful"
When I do a blank check it says
"
Device is NOT blank:
Program Memory
Configuration Bits
IDs
Data Memory
"
When I try to program it says
"
PICSTART Program\Verify Report
15-Dec-2008, 15:24:57
Device Type: PIC18F2431
Address Range 500-5b7
Program Memory Errors
Address Good Bad
0500: EF91 0000
0502: F002 0000
0504: 0E02 0000
0506: 5E0C 0000
0508: E30B 0000
050A: 6AEA 0000
050C: 0E0C 0000
050E: 6EE9 0000
0510: 50EF 0000
0512: E006 0000
0514: 0E02 0000
0516: 6E00 0000
0518: 2E00 0000
051A: D7FE 0000
051C: 2EEF 0000
051E: D7FA 0000
0520: 0C00 0000
0522: 6AF8 0000
0524: 9ED0 0000
0526: 6AEA 0000
0528: 6AE9 0000
052A: 90B9 0000
052C: 9CC1 0000
052E: 9EC1 0000
0530: 0E00 0000
0532: 6EB8 0000
0534: 6A05 0000
0536: 6A06 0000
0538: 0E01 0000
053A: 6E07 0000
053C: 6A08 0000
053E: 6A09 0000
Any additional errors are not displayed
"
So,what I am doing wrong.Please let me know.
Thanks
Hi,
I am trying to program pic18F2431 using picstart plus.Below is my code in C which I am compiling using PIC C compiler.After that I am importing the hex file to MPLAB version 8.15a.Then using picstart plus firmware version 04.50.10.Also,I am putting a 0.1uF cap between Vdd and Vss pins and connecting AVdd pin with Vdd pin.
C Code:
#include <18F2431.h>
#include <bootloader.h>
#include <stdlib.h>
#include <stdio.h>
#fuses LP,PROTECT,NOIESO,NOBROWNOUT,NOWDT,BORV45,PUT,CPD,NOSTVREN,NOLVP,NOFCMEN,CPB,WDT1,MCLR,T1STANDARD,WRTC,WRTB,EBTRB,EBTR,DEBUG,WRT,WRTD
#use delay (clock=40000000)
#byte port_b=0x81
void main() {
set_tris_b(0x00);
while(TRUE){
output_high(PIN_B2);
delay_us(500);
output_low(PIN_B2);
delay_us(500);
output_high(PIN_B1);
delay_us(500);
output_low(PIN_B1);
delay_us(500);
output_high(PIN_B0);
delay_us(500);
output_low(PIN_B0);
delay_us(500);
}
}
When I do a erase it says "Erase operation is successful"
When I do a blank check it says
"
Device is NOT blank:
Program Memory
Configuration Bits
IDs
Data Memory
"
When I try to program it says
"
PICSTART Program\Verify Report
15-Dec-2008, 15:24:57
Device Type: PIC18F2431
Address Range 500-5b7
Program Memory Errors
Address Good Bad
0500: EF91 0000
0502: F002 0000
0504: 0E02 0000
0506: 5E0C 0000
0508: E30B 0000
050A: 6AEA 0000
050C: 0E0C 0000
050E: 6EE9 0000
0510: 50EF 0000
0512: E006 0000
0514: 0E02 0000
0516: 6E00 0000
0518: 2E00 0000
051A: D7FE 0000
051C: 2EEF 0000
051E: D7FA 0000
0520: 0C00 0000
0522: 6AF8 0000
0524: 9ED0 0000
0526: 6AEA 0000
0528: 6AE9 0000
052A: 90B9 0000
052C: 9CC1 0000
052E: 9EC1 0000
0530: 0E00 0000
0532: 6EB8 0000
0534: 6A05 0000
0536: 6A06 0000
0538: 0E01 0000
053A: 6E07 0000
053C: 6A08 0000
053E: 6A09 0000
Any additional errors are not displayed
"
So,what I am doing wrong.Please let me know.
Thanks