Search found 440 matches

by cfbsoftware
Tue Feb 01, 2011 11:10 am
Forum: Oberon Language
Topic: Convert CHAR to INTEGER
Replies: 1
Views: 11576

Re: Convert CHAR to INTEGER

The built-in ORD function will typecast a CHAR to INTEGER i.e. VAR ch: CHAR; i: INTEGER; ... ... i := ORD(ch); This gives you the corresponding numeric ASCII value for that character. Knowing this, if you want to convert a single character (e.g. '9') to the integer value (e.g. 9) you can then say: I...
by cfbsoftware
Tue Jan 25, 2011 2:02 am
Forum: Getting Started
Topic: IIC how to
Replies: 5
Views: 39268

Re: IIC how to

cfbsoftware wrote:We'll post the updated I2C module here along with the EEPROM example.
These have now been uploaded to the Enhancements & Suggestions section of this forum.
by cfbsoftware
Sun Jan 23, 2011 5:56 am
Forum: Getting Started
Topic: IIC how to
Replies: 5
Views: 39268

Re: IIC how to

The reference to CAT24LC256 will be removed. In the process of working on the 256Kbit EEPROM example we've added a couple of extra functions to the I2C module to give greater control over the parameters. You will be able to specify the number of bytes (including 0) for both the params and data param...
by cfbsoftware
Thu Jan 20, 2011 4:08 am
Forum: Getting Started
Topic: IIC how to
Replies: 5
Views: 39268

Re: IIC how to

The EEPROM2K example supplied with Astrobe is designed for use with 2Kbit EEPROMs which use 8-bit location addresses. The 24LC256 is a 256Kbit EEPROM which uses 16-bit location addresses. Hence the variables idAddr and counterAddr need to be declared as 16-bit unsigned integer variables instead of 8...
by cfbsoftware
Thu Jan 13, 2011 12:49 pm
Forum: Getting Started
Topic: Use of IS
Replies: 1
Views: 17324

Re: Use of IS

That is not surprising - the related subject of type extensions is one of the more complex aspects of Oberon. Unfortuantely, I can't hope to explain it in a few sentences here. What I recommend you do is first of all have a look at the source code of the Extensions module in the Astrobe Examples fol...
by cfbsoftware
Thu Jan 13, 2011 12:13 pm
Forum: Getting Started
Topic: SET operators
Replies: 1
Views: 18133

Re: SET operators

Thank you for your feedback - much appreciated. There's a lot more to come if there is sufficient interest :) Niklaus Wirth has written a paper on the use of SETs titled "SET: A neglected data type and its compilation for the ARM". You can download a copy from: http://www.inf.ethz.ch/personal/wirth/...
by cfbsoftware
Wed Jan 05, 2011 5:05 am
Forum: Getting Started
Topic: interrupt(s)
Replies: 2
Views: 21846

Re: interrupt(s)

The attached demo program IRQFIQ which should run on LPC21xx and LPC22xx targets shows an IRQ being interrupted by an FIQ. It uses Timer0 to generate IRQs and Timer1 to generate FIQs. The IRQ handler stays in an infinite loop which only terminates when it is interrupted by an FIQ. If you need convin...
by cfbsoftware
Mon Jan 03, 2011 11:19 pm
Forum: Oberon Language
Topic: Forward Procedures
Replies: 1
Views: 12481

Re: Forward Procedures

There is no special mechanism used for forward procedures in Oberon-07. Normally procedures should be declared before they are referenced. The only time where it is necessary to use a forward procedure is if two procedures mutually call each other e.g. if you want to do something like: PROCEDURE Pro...
by cfbsoftware
Mon Jan 03, 2011 12:22 pm
Forum: Getting Started
Topic: IMPORT Main?
Replies: 1
Views: 14137

Re: IMPORT Main?

Main is not documented separately. It's a 140-line module which performs the following startup actions: Copies the interrupt area to mapped memory Installs the Trap Handler Sets Memory mapping control to User RAM Mode Enables the Memory Accelerator Module Initialises UART0 at 38400 baud for runtime ...
by cfbsoftware
Mon Jan 03, 2011 6:12 am
Forum: Oberon Language
Topic: Shifts and masks
Replies: 3
Views: 20713

Re: Shifts and masks

There are several possible ways. The style most often seen in Oberon code is: R := LSR(R, 6) MOD 0400H; The code generated is: E1B0B32BH MOV S R11,R11 LSR 6 E1A0BB0BH MOV R11,R11 LSL 22 E1B0BB2BH MOV S R11,R11 LSR 22 An alternative is: R := LSR(LSL(value, 16)); Initially this might appear less reada...