SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By Nujiklo
#121863
Hi, I'm trying to program the Ultimate IMU with the code that I downloaded online ! I would like to know where am I in the program by using rprintf() but the only letters I got are :

Serial port COM1 opened
ððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððð
Serial port COM1 closed


and I passed 3 days trying to have the good baudrate so I tried every possiblities concerning it.

I am using WINARM and to see the output I am using Hercules Setup utility!
I would like to know if there is another way to see the output of rprintf() or just to know where I am in the code..

I wil apreciate your help a lot :)
By krkan
#122245
And the baudrate is...?

What kind of oscillator are you using?

If you have an oscilloscope connect it to the UART Tx line. Try to send 0x55 or 0xAA pattern. Look at the waveforms and measure the duration of 1's or 0's. Calculate the baudrate from that value.
By hsutherl
#122271
Hi Nujiklo,
Glad your bootloader is working.

I uploaded a tiny LPC2148 program to http://overtracks.com/sos/20110308/. heloo.zip has .hex and .bin files as well as the source files. (You will have to modify the makefile if you want to build it.)

It is set at 4800 8N1, and puts out about 1 character per second. I don't know anything about Hercules setup but any terminal program (even Hyperterm) should be OK.

Once you're confident your terminal program is working properly, you can begin to examine the settings in your target program.
By Nujiklo
#122335
Thanks everyone, actually the code wasn't complete and it missed some initializations, for the system clock more particularly, so it is obvious that the terminal could not put up the right data :)!
I spend a lot of time trying to resolve this problem and I'm glad that it is working now :)

Thank you again to all of you :)
By malh04
#125605
Hello!, I'm having the same problem with the rprintf function, could you tell me what are the modifications you made to make it work, I have spended 2 weeks trying to find it out but I just can't make it work :S, I hope you could help me.
By Nujiklo
#125640
Hey! You have to initialize the PLL which enables to initialize the clock :

// initialise FCCLK--------------------
PLLCON = 1; // enable PLL
PLLCFG = (1 << 5) | 4; // P = 2, M = 5
PLLFEED = 0xAA;
PLLFEED = 0x55;

while ((PLLSTAT & (1 << 10)) == 0);

PLLCON = 3; // enable and connect
PLLFEED = 0xAA;
PLLFEED = 0x55;

MAMCR=0x02;
MAMTIM=0x03;

Hope it will be ok for you now !