Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I want to start ARM with lpc1768 cortex M3

Status
Not open for further replies.
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.
 
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.
thanks my friend do you have any schematic?
Can I use max232 ?(output voltage 5V ) ;can I give 5V to this micros pins?
 

section 8 of the datasheet lists the max ratings, the inputs are 5v tolerant but it is a better option to use to use MAX3232 because the MAX232 may not work correctly with signals of 3v.

I don't have a schematic available but any dev boads schematic that has a serial port would do, which part of the schematic do you have trouble with?
 
I found this dev boads schematic ;-)
**broken link removed**
 

they are using transistors for the reset and ISP mode lines and they drive the transistors directly from the serial port, a direct connection would not work and could damage the mcu due to the serial port levels
 
I have jlink programmer, but before I can use it I should erase the flash memory of micro by flash magic
I want to make the board of flash magic myself but I don't have MAX323. Can I make it with MAX232 by voltage divider
I don't want to pay too much for this board because I want to use it once
Is there any way in which I don't use transistors. can I reset and active ISP mode manually
programmer.PNG
 
Last edited:

I have used a max232 with a LPC2103 with no problem since it is 5v input tolerant like the LPC1768.
I haven't used a voltage divider but you can use it if you want(in the receive direction).
Also the MAX232 high and low thresholds are 2v and 0.8v so driving it with 3v signals will work fine.

I also use the reset and ISP mode pins using button and jumper instead of the automatic way through serial signals so it is not a problem.
 
Hi,
I wanna adjust the freq of lpc1768 at 100MHz

Crys = 12MHz

By default the options in keil are :
Msel: 100
Nsel: 6
CCLKsel: 4

there is some description in system_LPC17xx.c :
Code:
//   <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>

I check it and by these Coefficient result is 100MHz
Just for ensure , is it true?
Thanks in advance...!
 
Last edited:

Thanks for reply, I read the topic before make a question and also the datasheet! but just for ensure ...

For adjust timer without interrupt:
I run it and it's ok, but just for calculate time ...

The peripheral clock by default is CPUCLK/4 -> 100MHz/4=25MHz
LPC_TIM1->PR = 0X04;
Means after 4 clock event( @ 25MHz ) , 1 unit will increase in TC register,Right?
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.
Is it true?

So we have following:

PHP:
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

     }
   }
}

just for ensure! , is it true?

---------------------

2. In general when communicate with a sensor(I2C_ with ODR = 100Hz) and before read check the flag for status data ready, if we request new data from sensor in a loop that runs in less than 10ms , and also measure loop time , loop time can be less than 10ms ?!

Thanks in advance...!
 

I run it and it's ok, but just for calculate time ...
I assume you are using Uvision in which case you can simulate the code and get exact execution timings

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.

Yes that is correct

EDIT: my mistake I mistook PR for the peripheral clock divider, Venkadesh_M is correct it is PR+1 so to divide by four you have to use PR=3

I'm not sure I can help with your second question
 
  • Like
Reactions: enekas

    enekas

    Points: 2
    Helpful Answer Positive Rating
Tanx ...

So it must be :
LPC_TIM3->PR = 0X03;
Then upper calculations will be true ...

Thank you very much my friends ...
 

From the user manual www.nxp.com/documents/user_manual/UM10360.pdf

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.
 
  • Like
Reactions: enekas

    enekas

    Points: 2
    Helpful Answer Positive Rating
Yes, it is part of the simulation menu system.

You need to have the simulation running before those menu items are visible/available.

When you enter debug mode the Peripherals drop down menu will populate with the menu items shown in Alex's screen shots.

If the LPC17xx is the microcontroller being simulated, the third menu item from the top will be "Clocking & Power Control" it too is a drop down menu which should offer the "Clock Generation Schematic" at the top of the drop down list.



BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top