Home |  Standard Hardware |  LCD, Touchscreen, Accelerometer


A Scheme Interpreter for ARM Microcontrollers:
MCU-Specific and Board-Oriented Examples for Version 060

SourceForge.net Logo
 

Standard Hardware Examples (LEDs, Threads, ADC, PWM):


The LED and Thread example for this release is identical to that of version 050 for most MCUs. Differences are as follows: 1) the LED ports and pins for the new MCUs are:


;----------------------------------------------------------
; cortex-m4 microcontroller boards
;----------------------------------------------------------

; EK-LM4F120 Launchpad
(begin
  (define ledport giof) ; GPIO PORT F
  (define ledpin1 1)    ; RGB led, red   line
  (define ledpin2 2)    ; RGB led, blue  line
  (define ledpin3 3))   ; RGB led, green line

; EK-LM4F232
(begin
  (define ledport giog) ; GPIO PORT G
  (define ledpin1 2))   ; green led

; STM32F4-Discov 
(begin
  (define ledport giod) ; GPIO PORT D
  (define ledpin1 12)   ; green  led
  (define ledpin2 13)   ; orange led
  (define ledpin3 14))  ; red    led

; LPC4330-Xplorer
(begin
  (define ledport gio1) ; GPIO PORT 1
  (define ledpin1 11)   ; blue  led
  (define ledpin2 12))  ; green led

; SAM4S-XPlained
(begin
  (define ledport gioc) ; GPIO PORT C
  (define ledpin1 10)   ; yellow led1
  (define ledpin2 17))  ; yellow led2

2) for Cortex-M3 and M4 MCUs, the Systick interrupt number is now 255 (vs 64 in 050), therefore:


;----------------------------------------------------------
; cortex-m3 and cortex-m4 microcontrollers
;----------------------------------------------------------

; LPC-P1343, SAM3-H256, Blueboard-1768, LM3S1968-EVB, LM3S6965-EVB, IDM-LM3S1958, 
; TI-EvalBot, STM32-H103, STM32-H107, STM32-DOT-BOARD, STM32-LCD
; -> cortex-m3, nothing to initialize here, except interrupt number for systick (255 in ARMPit 060)
;(define tic-int 64) ; <-- Not anymore
(define tic-int 255)

3) for the LPC-P1343 board, the new system0 file defines fewer, more concise, functions than in 050. For this MCU, the functions pin and tic replace pin-set, pin-clear, pin-set?, tic-start, tic-read and tic-stop as follows:


             050                    060
     -------------------      ----------------
     (pin-set   port pn)  ->  (pin port pn #t)
     (pin-clear port pn)  ->  (pin port pn #f)
     (pin-set?  port pn)  ->  (pin port pn)
     (tic-start)          ->  (tic #t)
     (tic-read)           ->  (tic)
     (tic-stop)           ->  (tic #f)

The ADC and PWM examples from version 050 are expected to work unmodified but have not been tested in 060 as of yet.

 

LCD, Touchscreen, Accelerometer:


Examples of LCD, touchscreen and accelerometer use have not yet been upated for this release. It is expected that the Scheme part of the examples developed for version 050 (eg. touchscreen and accelerometer reading) will work as is in 060 but this has not yet been tested. The LCD examples for version 050, that rely on ARMSchembly, will require update of the ARMSchembler before they are ported to 060. Examples for the 5 new Cortex-M4 boards in 060 also remain to be developed at this time.



Last updated February 3, 2013

bioe-hubert-at-sourceforge.net