technoblogy / ulisp-arm

A version of the Lisp programming language for ARM-based boards.
http://www.ulisp.com/
MIT License
97 stars 30 forks source link

XMC4700 Relax Kit: Initial working commit #49

Open ramangopalan opened 3 years ago

ramangopalan commented 3 years ago

Initial working commit for the Infineon XMC4700 Relax Kit.

technoblogy commented 3 years ago

Great! Thanks for this. How do you program it; is it possible to program it through the Arduino IDE? Also, is there an Arduino Core for the XMC4700? If not, how do you handle the Arduino functions such as pinmode and digitalwrite?

ramangopalan commented 3 years ago

Great! Thanks for this. How do you program it; is it possible to program it through the Arduino IDE? Also, is there an Arduino Core

Yes. I used the Arduino IDE to program it. The core for the XMC devices is maintained here 1.

for the XMC4700? If not, how do you handle the Arduino functions such as pinmode and digitalwrite?

Sure. I wanted to work with it in iterations. I thought I'll add them later - once I attack other parts of the ulisp-arm. Is that OK?

References:

technoblogy commented 3 years ago

Yes, good plan. I'm thinking of getting a board so I can try it out.

ramangopalan commented 3 years ago

Yes, good plan. I'm thinking of getting a board so I can try it out.

Super! :)

technoblogy commented 3 years ago

Can I mention your repository on the uLisp Forum, with a link?

http://forum.ulisp.com

or, even better, you could post a link to it yourself. Thanks!

ramangopalan commented 3 years ago

Sure. I'll do that. In the meanwhile, I just implemented the initial support for pin modes. Can you please check if the code is OK? The code (for LED1) below works fine on the XMC4700 Relax Kit.

(defun b (&optional x) (digitalwrite 24 x) (delay 1000) (b (not x)))

technoblogy commented 3 years ago

The only thing you might want to add is a line in checkanalogread(pin) and checkanalogwrite(pin) to specify which pins can be used for analogue.

technoblogy commented 3 years ago

There seem to be three variants of the board:

KITXMC47RELAX5VADV1TOBO1 KITXMC47RELAXLITEV1TOBO1 KITXMC47RELAXV1TOBO1

Will your port work with each version, and which do you recommend?

ramangopalan commented 3 years ago

The only thing you might want to add is a line in checkanalogread(pin) and checkanalogwrite(pin) to specify which pins can be used for analogue.

Perfect! Thank you. Sure. I will add in in a couple of hours. I will make a few sanity tests as well.

ramangopalan commented 3 years ago

There seem to be three variants of the board:

Understand. I found a table (from the manual) indicating their differences. Here is a snip:

image

Will your port work with each version, and which do you recommend?

Sure. I just went through the board reference manual for the XMC4700 relax kit 1. The port must work on all cards. I don't see a reason why something can fail. I have the KITXMC47RELAXV1TOBO1 variant. It has an ethernet PHY chip, an RJ45 jack, an external (SPI) flash interface and an SD card interface. The SD card (and the external SPI flash) interface will come to good use in the context of uLisp. :)

More peripherals, more fun :) I will certainly suggest the KITXMC47RELAXV1TOBO1 kit. Also, this might be useful for testing OR evaluating features outside the context of uLisp.

References:

ramangopalan commented 3 years ago

Also, I notice that there's no way to select between the variants. The Arduino abstraction doesn't handle this. The microcontroller is the same across all variants. Just more credence that the port will work across all XMC47 board variants.

ramangopalan commented 3 years ago

The only thing you might want to add is a line in checkanalogread(pin) and checkanalogwrite(pin) to specify which pins can be used for analogue.

I checked these board specific functions. I gathered the pins from the XMC47 pinouts 1. I generated a PWM on pin 3 with the patch. Looks fine.

References: