Search found 18 matches

by bscholte
Sun Aug 12, 2018 12:11 pm
Forum: Cortex-M0, M3, M4 and M7
Topic: Logic operations
Replies: 5
Views: 27591

Re: Logic operations

Wow. Very elegant! Thanks.
by bscholte
Fri Aug 10, 2018 3:35 pm
Forum: Cortex-M0, M3, M4 and M7
Topic: Logic operations
Replies: 5
Views: 27591

Re: Logic operations

To be (hopefully) complete, a short module to implement common logic ops. MODULE Logic; PROCEDURE* And*(A, B:INTEGER):INTEGER; (*e.g. 5 AND 3 = 0101 AND 0011 = 0001 = 1*) BEGIN RETURN ORD(BITS(A) * BITS(B)) END And; PROCEDURE* Or*(A, B:INTEGER):INTEGER; (*e.g. 5 OR 3 = 0101 OR 0011 = 0111 = 7*) BEGI...
by bscholte
Fri Aug 10, 2018 11:41 am
Forum: Cortex-M0, M3, M4 and M7
Topic: Logic operations
Replies: 5
Views: 27591

Re: Logic operations

Excellent! That works and is actually easier. As suggested, I used the BITS() to cast from integer to set and ORD() to cast back. The rest is arithmetic on sets. A small module to test the workings. Not tested thoroughly, but.... (Below are the "Out.Bits" and "Out.Bool" to show the results). MODULE ...
by bscholte
Tue Aug 07, 2018 9:06 am
Forum: Cortex-M0, M3, M4 and M7
Topic: Logic operations
Replies: 5
Views: 27591

Logic operations

During application development I frequently encounter the need to do logic operations on bytes or numbers (AND, OR, XOR, NOT). For each of these, there are assembler instructions and most programming languages have these implemented in some form. Since I haven't found a better way, I currently get b...
by bscholte
Sun Jun 25, 2017 3:50 pm
Forum: Astrobe for ARM Cortex-M0, M3, M4 and M7
Topic: New target
Replies: 2
Views: 27839

Re: New target

On your related note: Yes there is. Please check our (progressing) web page at http://www.psysengineering.com/oberon or contact us directly at info@psysengineering.com.

Bart
by bscholte
Sat Feb 14, 2015 10:57 am
Forum: Cortex-M0, M3, M4 and M7
Topic: Read a micro SD card using MMC / SPI
Replies: 5
Views: 44122

Re: Read a micro SD card using MMC / SPI

Dear all, For compatibility reasons, I decided to implement the FAT16 file system. Completely based on the modules that were published in the first article of this post. It is working quite well and also very old (32MB) card with very fragmented files can be red. I have not attached the code yet bec...
by bscholte
Fri Jan 30, 2015 4:10 pm
Forum: Cortex-M0, M3, M4 and M7
Topic: Read a micro SD card using MMC / SPI
Replies: 5
Views: 44122

Re: Read a micro SD card using MMC / SPI

The card enable and card inserted signals are on slightly different signals than on the Olimex board. In order to read the card on the LPCXpresso base board, the SDPowerOn should be replaced with almost the identical procedure used to enable the 7-segment; CONST chipSelect = {2}; PROCEDURE SDPowerOn...
by bscholte
Wed Jan 28, 2015 4:17 pm
Forum: Cortex-M0, M3, M4 and M7
Topic: Read a micro SD card using MMC / SPI
Replies: 5
Views: 44122

Re: Read a micro SD card using MMC / SPI

Trying to get this to run on an LPCXpresso base board with LPC1769 target. The code does not compile. Issue; In ReadCard.Run(line121): SPI.Init(SPIBus, nBits, useSSEL ) ; where useSSEL is a boolean constant. But the proc header is PROCEDURE Init*(bus, nBits: INTEGER; ConfigurePins:ConfigurePinsProc ...