LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

How to ensure the pinmapping and pinsetup using the lpc2387 processor

Background description:

I'm developing a controllerboard for an new product series based on the lpc2387 ARM7 processor from NXP(Philips).

I have tried to follow the porting guide (The lpc2378 described in the porting guide is from the same family as lpc2387, but they have some differencies in the pinmapping and functions, the lpc 2387 does not have the external memory interface, but more internal memory, less ADC's and less GPIO and it have the USB OTG), but it is quite confusing to me as it tells some steps performed for another processor that I don't know about. At the same time it does not provide a good overview of what kind of files I need to have where. There are some description of copying some files and doing some modifications to them, however the description giving the understanding I feel is missing.

 

Questions:

In chapter 3 of the porting guide, describing the Elemental I/O implementation, when adding the resources you have to assign a channel number. Can anyone give me an explanation of what the channel number is used for.

 

Later in the same chapter, the part of creating pins are skipped, but in this part you can add pins providing a prefix and a starting number. I tried to call a pin "Bill" but that didn't work - where can I see what the pins must be called? (And also ensure I have all the pins I need)

 

I have manage to get some pins working on my target, but how can I ensure that the pins have pull-up or pull-down activated?

 

Hope someone can help me on this:-)

 

/Preben

 

 

0 Kudos
Message 1 of 5
(5,955 Views)

Hello Preben,

 

The channel number is used for naming the Elemental I/O nodes, it does not have signifigance otherwise.

 

From the guide:  A pin is the software equivalent of a physical pin that connects an I/O device to the outside world. Resources can share pins because, typically, there are fewer pins than resources. Pins are optional. Use pins if you have conflicting devices.

 

For pin naming, I believe they require you to use hardware pin names if you are naming them.  So you would just name the pin the same as it would be on your processor. eg. A1, A2, A3

 

Unfortunately, currently there is no way to activate either the pull-up or pull-down on pins in LabVIEW.  You can however set the pull-ups and pull-downs with an inline C node used to set the PinMode. Page 155 in the manual for your device has more information on pin modes.

 

Here is a link to an online version of the manual for your device: http://www.keil.com/dd/docs/datashts/philips/lpc23xx_um.pdf

 

If you have any more questions feel free to post them here, and I will do my best to find the answer for you.

 

Regards,

Matt M.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(5,907 Views)

Hi Matt

 

Thanks for your feedback.

I have for the last 2 days been working on the elementary IO and studying the implementation for the Stellaris and MCB2300 evaluationboards and based on your feedback I have some clarification questions.

 

Channel number:

Studying the above mentioned implementation I have concluded that the channelnumber is used in the node implementation VI to calculate/determine which port and which pin at that port should be used. For the lpc2378 µcontroller this seems to be calculated using LabVIEW blocks and than finally calling a C-file to write the port (lpc23xx series have 5 ports numbered 0-4 and have up to 32 pins per port.channelnumber 5 would then be port 0 pin 5 and channel number 32 would be port 1 pin 0). The Stallaris seems to handle it all in a C-file. Is this also what you refer to by "naming" the Elementary I/O nodes?

 

Pin naming:

I see that you are also guessing about the requirements for the pin naming, however, I do understand that it is not needed to use the pins at all.

What should i use them for then, then - Is it only for LabVIEW to detect conflicts when you add the Elementary I/O in your project?

Or are there other benefits in using pin names?

 

Pull-up/Pull-down:

I'm a little confused here - when studying the Stellaris setup I see that the Elementary IO have properties for setting this - does it mean that this is not working with that evaluation board?

 

Properties:

Talking about the properties I kind of understand that I can implement properties at 2 levels, that is project level and node level. At project level the property should, to my understanding, apply to all the usages of that node. At the node level you can use different properties throughout the project for that node. However, I cannot relly find any description clearly telling me what to do to get any of the 2.

 

What is needed:

In general I have a problem that I cannot find any descriptions telling what it takes to get an ARM processor running. The porting guide provides an example of how to do with one specific processor, but I does not provide any understanding of which files are needed, and where I must place them, and how LabVIEW uses them.

I'm not very familiar with software programming, I have only done a little VBA programming in excel, why we chose LabVIEW embedded to make things easier. So far I have spend a week to try to understand some basic things about the setup. I spend 3 days this year to find a way to route UART 3 to the right pins at my board with the correct Baud rate and another 2 days on finding out the Elementary IO stuff. Still I don't really know which files to modify or create.

Is there no descriptions beside the porting guide (Which by the way refer to a "target editor" that is not available in my LabVIEW 2011)?

 

/Preben

 

0 Kudos
Message 3 of 5
(5,901 Views)

The Keil web site lists the supported devices at www.keil.com/dd.  The page for the LPC2387 provides the header file LPC23xx.h (which is also included with the uVision files in C:\Keil\ARM\INC).  In addition this page tells us (in the upper right) that the Flash File System, TCPnet TCP/IP Networking Suite, USB Device Interface, and USB Host Interface are pre-configured in the MDK Professional toolchain.  So providing you configured the uVision project correctly for the LPC2387 the drivers will be included by default.  When you select your target in uVision files will automatically be included (such as LPC23XX.h) that provide the register definitions.  This allows you to do things like refer to the PINMODE0 register with they keyword PINMODE0 rather than having to specifiy the memory address.  Since this is configured in the uVision project you can make c calls in LabVIEW without referenceing these files explicitly.  For example you can drop an inline C node and with      

PINMODE0 = 0xFFFF;  without specifying in LabVIEW what PINMODE0 refers to.

 

If you were able to toggle a relay that means that you successfully configured the uVision Project, LabVIEW and the elemental IO.  This is a huge first step.  It means that you have the basic infrastructure in place.  If all you need to do is toggle an DIO pin then you would be done.  Port complete.  If, however, you want to add more functionality you need to continue the porting process to add the remaining features using Inline C Nodes, Call Library Function Nodes, LabVIEW Functions and Primitives.  In this case you can simply decide which chip features it is worth implementing sub VIs for, which ones you will only use once (in an inline c node for example) and which features you will never use. Getting the code to deploy to the board is the hardest part.

 

All the data on which registers to use and how libraries work are in the manual for your device or on the keil website.  We don't have that information.  It is up to you to program the features you want to use in C, and then you can use then in LabVIEW.

 

Channel Number: That is correct.

 

Pin Naming: Pin names are really only for when LabVIEW detects conflicts. 

 

Pull-Up/Pull-Down: You need to create the code that sets the pull up or pull down, then you can use a node to set it in your LabVIEW program.

 

Properties: You must include an I/O Property Node Implementation VI for each property.  The project will then allow you to use the Property Node for your Elemental I/O type that it was created for.

 

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(5,873 Views)

Hi Matt

 

Thanks for your feedback. I think I start to get real understanding of the Elementary IO.

Than my target should soon be up and running with basic functionality.

 

/Preben:-)

 

 

0 Kudos
Message 5 of 5
(5,866 Views)