While I was trying to solder the FTDI chip, I lifted some pads and ripped off some of the legs. Today I tried to solder a new one and fix the connections by green wiring. However, while I was trying to solder USB connections, I ripped off the USB connection legs. Should I try to fix this, or use BusPirate somehow? I'll probably order a preassembled one with Open Logic Sniffer.
Well, I used BusPirate's transparent UART macro. I changed the bootloader pins, now I'm able to program the web platform using the bootloader. :)
Glad you got it going. Did you get a kit on accident?
No, I wanted a kit, but you warned me about the FTDI chip :) For now I'm using the expansion header but I'm planning to use the programming header for bootloader connections.
I tried to move the bootloader connections to PGC and PGD pins of the ICD header but I couldn't make the program communicate with the bootloader. I was able to change the bootloader pins to RP20 and RP6 by changing the codes under "Receive, map pin to uart" and "Transmit, map uart to pin" but the same principle didn't work when I tried to change the bootloader pins to RP0 and RP1. Is there something that I am missing? The code is attached, I had to change the extension to attach it.
;analog pins to digital
bset AD1PCFGL, #PCFG9
bset AD1PCFGL, #PCFG10
; Receive, map pin (20 = 10100) to uart
bset TRISB, #TRISB0 ;make input (datasheet pg 157)
bclr RPINR18, #U1RXR0 ;xxx
bclr RPINR18, #U1RXR1 ;xxx
bset RPINR18, #U1RXR2 ;xxx
bclr RPINR18, #U1RXR3 ;xxx
bset RPINR18, #U1RXR4 ;xxx
; Transmit, map uart to pin
bset RPOR3, #RP6R0 ;xxx
bset RPOR3, #RP6R1 ;xxx
bclr RPOR3, #RP6R2 ;xxx
bclr RPOR3, #RP6R3 ;xxx
bclr RPOR3, #RP6R4 ;xxx
I'm sorry, I don't have the schematic open because the site is migrating and I'm waiting for my DNS cache to timeout...
I'd check that the proper ADC pins are set to digital.
Is this the code for RP6 & 20 or RP0 & 1? The TX pin looks like it's set to RP6, and RX is 10100 (20).
;analog pins to digital
bset AD1PCFGL, #PCFG9 ;????????
bset AD1PCFGL, #PCFG10 ;??????????
; Receive, map pin (1= 00001) to uart
bset TRISB, #TRISB0 ;make input (datasheet pg 157)
bset RPINR18, #U1RXR0 ;xxx
bclr RPINR18, #U1RXR1 ;xxx
bclr RPINR18, #U1RXR2 ;xxx
bclr RPINR18, #U1RXR3 ;xxx
bclr RPINR18, #U1RXR4 ;xxx
; Transmit, map uart to pin set RPOR0 bits to 11000 (? check the original)
bset RPOR0, #RP0R0 ;xxx
bset RPOR0, #RP0R1 ;xxx
bclr RPOR0, #RP0R2 ;xxx
bclr RPOR0, #RP0R3 ;xxx
bclr RPOR0, #RP0R4 ;xxx
This is just a guess, you'll need to look in the datasheet to be sure. I don't know the ADC pins at all.
You were right Ian, I forgot to set the ADC pins to digital and that was causing the problems. :) That was the code for RP6 & 20. This code sets the bootloader to RP0 & 1:
;analog pins to digital
bset AD1PCFGL, #PCFG2
bset AD1PCFGL, #PCFG3
; Receive, map pin (0 = 00000) to uart
bset TRISB, #TRISB0 ;make input (datasheet pg 157)
bclr RPINR18, #U1RXR0 ;xxx
bclr RPINR18, #U1RXR1 ;xxx
bclr RPINR18, #U1RXR2 ;xxx
bclr RPINR18, #U1RXR3 ;xxx
bclr RPINR18, #U1RXR4 ;xxx
; Transmit, map uart to pin
bset RPOR0, #RP1R0 ;xxx
bset RPOR0, #RP1R1 ;xxx
bclr RPOR0, #RP1R2 ;xxx
bclr RPOR0, #RP1R3 ;xxx
bclr RPOR0, #RP1R4 ;xxx
Now I can make a custom cable for my BP for using it with bootloader.