i2c on PRO

Questions on control of serial busses
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

i2c on PRO

Post by YahooArchive »

>from help line
>Is it more efficient to use C than Basic when it comes to hardware interrupts?

Now that general interrupts can be done in BASIC, either way works. Yes C does
do a little better optimizing code. There are BASIC examples in
BASIClib/interrupts in the new release.

>How do I access hardware timer/counter registers in Basic? Where is the
information for these registers?

The NXP user manuals cover the registers of the LPC21xx chips. We intentionally
let them keep that documentation up to date.

For examples see the BASIC files in the BASIClib directory

>Do you have the spec for the 32 KHz crystal for ARMmite pro?

You can use a variety of parts, as spec'd in the NXP documentation. We
typically use an Abracon AB26TRB-32.768KHZ-T and 22 pf caps



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

The BASIC I2CIN and I2COUT are implemented in BASIC code as bit banged routines,
and can use ANY pin combination.

The same is true for the routines in cor_hwlib for C.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

(1) How do I select open drain pins P17 and P18? They are not in the IO pin
list. If I use IO(17), it goes to P0.23 and IO(18) goes to P0.24.

(2) Is it possible to use native LPC2103 I2C hardware in ARMmite PRO?

(3) When I use the declaration in ARMbasic,
IN 17
does it take the input signal from IO(17)(which is mapped to P0.23 and AD1 -
from physical pin 33 of LPC2103) or pin P0.17 which is connected physical pin 47
of LPC2103?

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

> (1) How do I select open drain pins P17 and P18? They are not in the IO pin
list. If I use IO(17), it goes to P0.23 and IO(18) goes to P0.24.

They are not connected on the PRO. The open collector is accomplished in the
I2C.bas code, look in BASIClib directory for details.

> (2) Is it possible to use native LPC2103 I2C hardware in ARMmite PRO?

No. IMO the i2c hardware is pretty primitive on in the LPC families. It
requires more interrupts than any other serial hardware in the chip (actually 2
more than bytes sent). Considering the low performance and usually low number
of bytes sent, bit banging is about as effective and lets you use any pin.

> (3) When I use the declaration in ARMbasic, IN 17 does it take the input
signal from IO(17)(which is mapped to P0.23 and AD1 - from physical pin 33 of
LPC2103) or pin P0.17 which is connected physical pin 47 of LPC2103?

The remapping is a holdover from ARMexpress days of trying to map pins to
PBASIC. Its kind of hard when P0.0 and P0.1 are the debug serial connection.
This was carried over on the ARMmite and the PRO, but will not be done for
follow on products like ARMweb or SuperPRO.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

My confusion was due to one of your previous posting on IO mapping in which you
said that helpfiles contain obsolete information for rev 2, 3 and you are going
to follow NXP port numbering. From your replay now, I gather that the current
helpfile information on ARMmite rev 2 and ARMmite PRO are correct. If this is so
then we need to use PINSEL0 and PINSEL1 bit field settings only for capture,
match and ADC pins. For I2C and SPI, any pin can be used because bit banging is
better than what is provided in the chip. Please tell me if I have understood
the situation or not. I got mightly confused by the mappings and schematics.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

> My confusion was due to ...

well a 2 line program would have answered your question

PRINT HEX(* &HE002C000)
PRINT HEX(* &HE002C004)

or you could use the debug command

@E002C000

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

Yes, if I happen to be Bruce :) !

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

Hi Chris,

I am a newbee to the whole ARMmite experience. Can you give me links or
information on FIO calls and ARM 21xx GNU library code for I2C. I would like to
see this hardware option would work.
Thanks for the help both Chris and Bruce!

Victor

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

You can download a copy of the user manual for the NXP LPC2103 microcontroller
used in the ARMmite from the NXP website at:

http://ics.nxp.com/support/documents/mi ... ?type=user

Look for "LPC2101, LPC2102 and LPC2103 User Manual" (UM10161).

There are also many useful application notes:

http://ics.nxp.com/support/documents/mi ... pe=appnote

e.g. look for "UART/SPI/I2C Code Examples" (AN10369).

Regards,
Chris Burrows (a different Chris!)

CFB Software
Armaide: LPC2xxx Development System for Pascal programmers
http://www.armaide.com

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c on PRO

Post by YahooArchive »

Thanks Chris, I appreciate your mail and suggestions. Do you think that there
are better options than bit-banging for I2C? What is your experience. Always
good to hear from guys who have done this before.

Thanks and best regards,
Victor

Post Reply