PDA

View Full Version : FORTH Programming


-Eyeman-
03-27-03, 03:30 AM
Hello

Ive got 2 problems with understanding the programming of the Isopod V2 with Max-FORTH, i downloaded the

http://www.isopod.net/bootcamp/code_bin/PWM_core_12.txt

and try to understand the code, with the following 2 samples ive got problems, for what are they?

E20 @ .
PWMCTL# E20 !

thanks for help!

RMDumse
03-27-03, 11:02 AM
First off, these codes are in HEX, so if you are not in HEX when these are downloaded you will have problems.

But what is this? This is simply the reading of the PWMB register, which must happen before it can be written. Then a write to the PWMB control register. So the application here has more to do with the hardware than the language. You might want to get the DSPF80x User's Manual to read what is being done to the hardware registers. Link is available elsewhere in this forum.

E20 @ . ( Read PWCTL Reg and print its value
( print is just to get rid of it
( DROP would serve just as well
( but wouldn't show the value
( E20 is hex constant pointing to PWCTL address
( @ takes address from stack,
( accesses that location in memory,
( and returns the contents of that location
( . is the word to print a value form the stack

PWMCTL# E20 ! ( Put the constant PWMCTL# into the PWCTL Reg
( This starts PWM operating
( Loading the counters at least
( PWMCTL# is a constant should be already defined
( some set up value to control PWM B channels
( E20 is hex constant pointing to PWCTL address
( ! takes address from stack
( and the value from the stack
( and puts the value into that address in memory