icsp unexpected problem

Status
Not open for further replies.

v1r05

New Member
hello everyone

i have a controller board based on 18f4520 and ive added the icsp pins and connected to the micro, unfortunatly i am using portb for the application and it has pin PGC & PGD so i followed **broken link removed**
to isolate the 2 pins (used 10k resistors)


i can program the micro just fine using ICSP but when i run the application i get garbage data (PORTB,D connects to the harddisk's 16bit data bus) unless i remove the ICSP cable, and i need it there so i can debug.
what can i do to solve this?
normally it would be the other way arround (ICSP not working)

thanks

**broken link removed**
 
You can't debug if you use the pins in your program. Program yes, Debug no.

Mike.
 
are you sure pommie?
cause ive chosen the PICKIT2 as the debugger in mplab and it works i can single step and other things, the problem is i cant run the debugging because the data is corrupt.

one more thing, i had done the board and the program without ICSP/debugging in mind so i cant easily change it at least this is the last resort
 
Yes. The debugger requires two way communication at all times. When debug is enabled the clock pin is permanently input. Check it in your program, you cannot set it to output.

Mike.
 
mike:
all portb is input

bill:
i cant find a 20GB SD card cheap enough

problem remains even if the cable is just plugged to the board and not the pickit2.
 
Do you have the 0.1uf caps? I see a need for 3 of them. I do see 1 in the photo. They have to be very close to the VDD & VSS pin pairs on each side of the PIC. Posting your schematic will help.
What are you going to use for the audio codec IC?

Why are you building an MP3 player again? A small mini-itx motherboard has everthing you need built in for about $120, the HD won't be very portable.
Writing your own FAT32/NTFS stack won't be much fun either.
 
Last edited:
v1r05 said:
mike:
all portb is input
Maybe you didn't understand. Bits 6 and 7 of port B are used for incircuit debugging. They are either debug communication pins or they are your I/O pins. They can't be both. Try setting TRISB.6=1.

Mike.
 
Last edited:
bill:
am using the STA013A decoder, but your wrong when saying it isnt any fun, am working in this for sometime now and am actually enjoying it, am studying ECE and i think its a good project to do to learn about various electronic components. and that HDD mediaplayer is damn cheap i

mike, am gona do another board anyways based on the 18f8722 because it can have external memory, i guess i will have to be more careful where to place stuff on MCU pins.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…