你好,
最近我尝试做一个程序以0°90°之间的角度控制伺服电机,我做的程序的主要代码在C,
单片机读取通过引脚中断矩阵键盘给定字符(汇编代码,给出了等效性
电子键盘,休息'0 '一)转换为数字的ASCII字符(0”现在是0为例)和一个新的10几万乘法和加单位(即“九0”液晶转换为9×10 0 = -90)。
程序工作得很好,但我需要rewritte程序汇编。没问题,PWM可中断是ASM,GPIO可中断,但主要是在我乘C C因为乘法。
我知道MAC的可行的PSoC 1但调查我发现柏称为“算术库用户指南”,描述了一个8位数字乘2的子程序文件(这正是我需要的因为我不使用符号int型对象和结果是8位也)但说我要写E线以下包括“算术。公司”,当我建立这个项目说,公司文件是不成立的。
我在哪里可以找到那个文件?我能做什么?
顺便说一句,在我看到像“mulx编译器的建议”,“muly”,我怎么能用乘法假设这样做。
问候语
以上来自于百度翻译
以下为原文
Hi,
Recently i try to make a program to control a servomotor by giving an angle between 0° and 90°, i made the program with the main code in C where the microcontroller reads the caracter given by a matrix keyboard using pins interrup
tions (An assembler code which gives the equivalent character of the keyboard to A), rests '0' to convert the ASCII caracter into numbers ('0' now is 0 for example) and make a new number by multiplying by 10 the tens and adds the unit (i.e. '9''0' in LCD converts to 9*10+0 = 90).
The program works well, but i need to rewritte the program in assembler. No problem, the PWM interrups are in ASM, the GPIO interrups also, but the main.c where i multiply is in C because of the multiplications.
I know about the MAC aviable for the PSoC 1 but investigating i found a document from Cypress called "Arithmetic Libraries User Guide" where describes a subroutine that multiplies 2 8-bit numbers (just what i need because i don't use signed ints and the result is 8-bit also) but says i need to write the following line
include "arith.inc", when i build the project says that inc file is not founded.
Where i can find that file? What i can do?
BTW, in the compiler i see suggestions like "MULX", "MULY", how i can use that to Multiply assuming that do this.
Greetings