Assembler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assembler

2,329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Cliff Bell on Mon Mar 14 14:11:53 MST 2011
I'm new to NXP micros but not to electronics.
If you believe the "good book" then I'm well over my alloted time!
I was designing circuits when bistable circuits used double triode valves, and OC71's were state of the art semiconductors!
I've had to learn, through the years, about both analogue and digital integrated circuits.
My fondest memory is converting a mechanical teletype machine to programme a memory chip for a SCAMP microprocessor!
The objective was to create a digitally programmed Flip-Flop! And it worked!
Later a Commodore Pet desktop computer speeded the process.
With a basic text editor to generate .asm files, programming was a doddle.

My problem now is that I have, over the intervening years, designed embeded firmware packages for a number of micros.
Each needed to pass FDA scrutiny for medical products.
They were all written in assembler and were very very time critical.
So much so that all critical instructions (and there are a lot!) always occur at the same time relative to others.
Timing needs to be a selection of an integral number of system clock cycles.
None can use interrupts.

The basic timing framework has migrated successfully through Intel, Microchip, Atmel and Hitachi processors.
All these versions were programmed in assembler.

My challenge is to port this software (firmware) to the LPC1343 and use some of the peripherals without upsetting this accurate timing structure. The bean counters think they will get more performance for their pennies!

I have Joseph Yiu's book, The Definitive Guide to the ARM Cortex-M3, and feel reasonably comfortable with its content.
However I'm overwhelmed by the number of windows on the LPCxpresso GUI.

Can I write a .asm (.s ???) programme in a simple text editor and drop it into one of the windows, where it will assemble into an executable for the evaluation board?
I guess setting up to debug such a simple approach may be a bit more complex, but if I can get the LED to flash on the eval board as directed by my own efforts, I guess I can dream up a simple debug relocatable add on.

Fortunately at my age, "time to market" is less important than thoroughly understanding what is going on!

Thanks
0 Kudos
Reply
11 Replies

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Tue Apr 26 09:43:38 MST 2011
KTownsend has posted a tutorial at his web site.  It explains the issue of the cycle count being off by a few ticks.

Benchmarking the LPC1343 in code using DWT
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Sun Mar 20 22:21:59 MST 2011
jharwood,

Great link.

I was just reading something about the count being off by some cycles when count is read because the CPU has gone some cycles past the actual point where count would have been valid.  It mentioned some CPU cycles + some pclk cycles.  Then we had a power outage...

I'm pretty sure that is the case as timing a NOP returns a count = 9. LPC1769 120 MHZ  -O1.  -O3 count = 8.

Now I don't have a clue where I was reading that at.

Have you seen that mentioned somewhere?
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Sun Mar 20 18:28:37 MST 2011
Here's an [B]interesting post[/B] by Joseph Yiu about using the DWT to count cycles.

I tried it on an LPC1343, worked well.
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rmteo on Wed Mar 16 09:25:25 MST 2011
This article may be of interest http://www.eetimes.com/design/embedded/4210485/Reliable-programming-in-ARM-assembly-language
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Cliff Bell on Tue Mar 15 12:21:19 MST 2011
Hi folks.
Thank you for all your replies.
Looks like tomorrow is going to be a busy day.
I'll attach another post when I get that eureka moment!

As for my OS platform.
I have 2 laptops running WIN98SE simply because the H8 workbench software never ported well to later Windows Versions and I still get requests for support for the H8 product.
I have a couple of laptops and two desktop machines running XP.
My wife has a laptop with Vista and recently we got a netbook with Windows 7.

If that seems a lot of machines for a couple of old codgers, it is because we both did and do voluntary work. People seem to like dropping off their cast offs for us!

If I don't manage to tame the LPCexpresso tool chain I might take up the offer of your script files "j".

Thanks again

Cliff          :)
Thanks again.
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Tue Mar 15 02:04:44 MST 2011
This thread from a few days ago has a simple app for LPC17xx written solely in assembler...

http://knowledgebase.nxp.com/showpost.php?p=6505&postcount=6

Should be fairly simple to port to LPC1343 as they are both Cortex-M3 parts.

With regards to being overwhelmed by the number of windows in LPCXpresso, NXP/CodeRed have a number of videos available which may be helpful in getting you started...

http://ics.nxp.com/support/training/learn.eclipse.lpcxpresso/
http://ics.nxp.com/support/training/lpcxpresso.intro.1/
http://ics.nxp.com/support/training/lpcxpresso.intro.2/

HTH!
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Mar 15 00:35:48 MST 2011
See
http://knowledgebase.nxp.com/showthread.php?t=85

This contains an assembler example (for the LPC11xx).

Hint: Try searching the forum using Google.
e.g. Google for: site:knowledgebase.nxp.com asm example
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Mon Mar 14 17:55:35 MST 2011
jharwood email me at hotmail dot com
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Mon Mar 14 17:17:33 MST 2011
jharwood email me @hotmail.com
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Mon Mar 14 17:14:28 MST 2011
What host platform and OS will you be using for development?

I have a small collection of script files for Windows XP that assemble, link and debug (gdb via LPCLink) all from the command line. I also have example assembler source code for blinking an LED on the target board if you are interested.
0 Kudos
Reply

2,303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Mon Mar 14 14:56:23 MST 2011
Hi Cliff,

See this [U][COLOR=darkorange]post[/COLOR][/U]. It is a C program that calls a function written in assembly. It might be helpful.

I haven't used assembly (thumb or thumb2) for the ARM yet so I really can't help much. From what I have read the C compiler used here produces efficient code. I believe you could write most of your code in C and then use calls to the time critical functions written in assembly.
0 Kudos
Reply