thanks my friend do you have any schematic?A simple connection to the serial port (through a MAX3232 or similar) would let you program the device using the internal bootloader, you just need to set the pin P2.10 to low and do a reset and then use flashmagic to communicate with the device.
It it doesn't work try low baud rates.
Is it necessary to use transistors?See page 3 of https://www.keil.com/mcb1700/mcb1700-schematics.pdf
It also used automated reset and program signals coming from the 232 port
// <e3> PLL0 Configuration (Main PLL)
// <h> PLL0 Configuration Register (PLL0CFG)
// <i> F_cco0 = (2 * M * F_in) / N
// <i> F_in must be in the range of 32 kHz to 50 MHz
// <i> F_cco0 must be in the range of 275 MHz to 550 MHz
// <o4.0..14> MSEL: PLL Multiplier Selection
// <6-32768><#-1>
// <i> M Value
// <o4.16..23> NSEL: PLL Divider Selection
// <1-256><#-1>
// <i> N Value
// <h> CPU Clock Configuration Register (CCLKCFG)
// <o7.0..7> CCLKSEL: Divide Value for CPU Clock from PLL0
// <1-256><#-1>
float getDeltaTMicros( uint T )
{
return((float)T*4/(25*1000)); // scale to mili sec time*4/(25*1000)
}
int main()
{
.
.
.
while(1)
{
.
.
.
TIM = LPC_TIM3->TC;
LPC_TIM3->TC = 0;
if( getDeltaTMicros(TIM) >= 10 )
{
// we have a loop that run @ 100Hz
}
}
}
I assume you are using Uvision in which case you can simulate the code and get exact execution timingsI run it and it's ok, but just for calculate time ...
In another words, we can say TC register will increase 1 unit @ (25MHz/4)=6.25MHz
So 1 unit increase for TC after every (1/6.25MHz)=0.16us elapses.
For 10ms we need to TC reach to (10ms/0.16us)= 62500.
PR: Prescale Register. When the Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC.
21.6.6 Prescale Counter register (T0PC - T3PC, 0x4000 4010, 0x4000 8010,
0x4009 0010, 0x4009 4010)
The 32-bit Prescale Counter controls division of PCLK by some constant value before it is
applied to the Timer Counter. This allows control of the relationship of the resolution of the
timer versus the maximum time before the timer overflows. The Prescale Counter is
incremented on every PCLK. When it reaches the value stored in the Prescale register,
the Timer Counter is incremented and the Prescale Counter is reset on the next PCLK.
This causes the Timer Counter to increment on every PCLK when PR = 0, every 2 pclks
when PR = 1, etc.
when I changed them and then run program or run program and then change them, all of the clock back to the first state!!!(look picture)
View attachment 84205
See the second image https://www.edaboard.com/threads/273242/#post1175136 , you need to access the screen through the menu while running the simulation
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?