Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems using UART with Bootloader on PIC18F4523 [abandoned]
#1
Hi,

I am trying to send out ASCII via UART for my PIC18F4523. However it does not seem to work. Everything was done using the latest version (20 august 2011)

Is it possible to use the pic UART for comms, with the same UART port of the bootloader on the chip? If it cannot be done just ignore the below:

Steps I have taken so far:

1. edited the settings.inc and flashed my pic with ds30 project using the microchip ICD3 programmer.

2. added the goto instruction in my main code.

3. loaded the hex file into the ds30loader GUI. I can find the bootloader when i click on the 'Check BL'

"
Searching for bl .
Found PIC18F4523 fw ver. 3.0.0
"

4. manually reset the pic by power cycling the chip and flashed the new hex file within 2 seconds of reset (This is what i read on your recommendation in other threads for manual reset)

Without the bootloader I can get the PIC to echo whatever i send over the console.

I have attached the files I have used.
1. Firmware Ver 0.1.hex is the hex file I uploaded with ds30loaderGUI.exe
2. ds30loader.HEX is the file I flashed for the inital bootloader
3. main.c is the source for Firmware Ver 0.1
4. settings.inc is the ds30 bootloader settings file
5. serial.c is the source file containing the register init for the Firmware Ver 0.1

I hope you can help me with this.

Thanks!


Attached Files
.txt   Firmware Ver 0.1.hex.txt (Size: 959 bytes / Downloads: 7)
.txt   ds30loader.HEX.txt (Size: 1.2 KB / Downloads: 8)
.txt   serial.c.txt (Size: 5.41 KB / Downloads: 8)
.txt   settings.inc.txt (Size: 6.76 KB / Downloads: 7)
.txt   main.c.txt (Size: 825 bytes / Downloads: 6)
Reply
#2
Hi,
How do you configure set the configuration bits for the boot loader?
Do you use the same configuration bits in boot loader and application? (you should)
Do you write configs? (you shouldn't)
Reply
#3
(2011-09-04, 19:06:59)Mikael Gustafsson Wrote: Hi,
How do you configure set the configuration bits for the boot loader?
Do you use the same configuration bits in boot loader and application? (you should)
Do you write configs? (you shouldn't)

Hi thanks for the reply!

I specified the configuration bits for the bootloader inside MPLAB's configuration menu instead of inside the code (hence those fields are commented).

I have used the same configuration for both bootloader and my code itself.

The write config check box is greyed out and disabled for me so I cannot write configs accidently even if i want to.
Reply
#4
Hi,
I'm sorry for the late reply. I am very busy at the moment.
Try to clear all relevant registers and bits before you configure the uart, txsta, rcsta, baudcon interupt flag etc
What are the register values when the uart doesn't work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)