Ich nochmal:
Zum Thema Bootloadereinstellungen, wenn main.c (aus
Bootloader_SW_022409)mit XT 7,2738MHz im Original so aussieht
1 | #include "p30fxxxx.h"
|
2 |
|
3 |
|
4 | //Defines for System Clock Timing -
|
5 | //For oscillator configuration XT x PLL8 mode,
|
6 | //Device Throughput in MIPS = Fcy = 7372800*8/4 = ~14.74 MIPS
|
7 | //Instruction Cycle time = Tcy = 1/(Fcy) = ~68 nanoseconds
|
8 |
|
9 | #define XTFREQ 7372800 //On-board Crystal frequency
|
10 | #define PLLMODE 8 //On-chip PLL setting
|
11 | #define FCY XTFREQ*PLLMODE/4 //Instruction Cycle Frequency
|
12 |
|
13 | #define BAUDRATE 115200
|
14 | #define BRGVAL ((FCY/BAUDRATE)/16)-1
|
15 |
|
16 | #define COMMAND_NACK 0x00
|
17 | #define COMMAND_ACK 0x01
|
18 | #define COMMAND_READ_PM 0x02
|
19 | #define COMMAND_WRITE_PM 0x03
|
20 | #define COMMAND_READ_EE 0x04
|
21 | #define COMMAND_WRITE_EE 0x05
|
22 | #define COMMAND_READ_CM 0x06
|
müßte ich dann den Code mit einem 20MHz Quarz (HS) so schreiben
1 | #include "p30fxxxx.h"
|
2 |
|
3 |
|
4 | //Defines for System Clock Timing -
|
5 | //For oscillator configuration XT x PLL8 mode,
|
6 | //Device Throughput in MIPS = Fcy = 7372800*8/4 = ~14.74 MIPS
|
7 | //Instruction Cycle time = Tcy = 1/(Fcy) = ~68 nanoseconds
|
8 |
|
9 | #define HS 20000000 //On-board Crystal frequency
|
10 | //#define PLLMODE 8 //On-chip PLL setting
|
11 | #define FCY HS/4 //Instruction Cycle Frequency
|
12 |
|
13 | #define BAUDRATE 115200
|
14 | #define BRGVAL ((FCY/BAUDRATE)/16)-1
|
15 |
|
16 | #define COMMAND_NACK 0x00
|
17 | #define COMMAND_ACK 0x01
|
18 | #define COMMAND_READ_PM 0x02
|
19 | #define COMMAND_WRITE_PM 0x03
|
20 | #define COMMAND_READ_EE 0x04
|
21 | #define COMMAND_WRITE_EE 0x05
|
22 | #define COMMAND_READ_CM 0x06
|
23 | #define COMMAND_WRITE_CM 0x07
|
24 | #define COMMAND_RESET 0x08
|
Und ist das das einzige was ich ändern muß und muß ich das Programm das
ich später über den Bootloader laden will noch verändern?
Gruß
Andi