装配微控制器要求 [英] Assembly Microcontroller Request

查看:97
本文介绍了装配微控制器要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

几天来我一直在尝试创建一个密码锁定的保险箱,并提出了一个原理图.硬件正在自我完善,但是我的进步步伐很快.我需要有关软件的帮助.我正在使用pic16f628a在两个方向(打开和关闭)上驱动电动机,并监视将要按下的11个按钮. (1-9)和一个重置和锁定按钮.

由于我的密码限制,我需要使用图片内部时钟来管理输入正确密码后电机保持开启的时间.

无论如何,那就是项目.如果有人对微控制器软件有所了解,请在此处回复,或通过[删除电子邮件]给我发送电子邮件.

多谢.

p.s.这是原理图.

http://img80.imageshack.us/img80/9417/safeschematic.jpg

[edit]除非您真的喜欢垃圾邮件,否则请不要在任何论坛中发布您的电子邮件地址!如果有人回复您,您将收到一封电子邮件(像这样),让您知道.[/edit]

解决方案

Google! "PIC电机控制软件"可提供冲击负载-从那里开始针对您的电机要求进行优化,然后您就离开了.

看看PIC网站也是一个好主意-它们也有不错的代码示例和一些SD.


好,谢谢,我投了1票.如果您不知道希望得到什么答案,将无法为您提供帮助.我认为我的答案完全符合您的问题.
我对您的声明感到震惊,据您所知,汇编中没有if语句.好吧,您的意思是字面意思是如果那么"的构造吗?不,如果有文字if语句就不会是汇编语言,因为那样的话它已经是一种更高级的语言了.还是这意味着您有一种想法,那就是更高的计算机语言会随软件附带一个魔幻仙子,该软件可以识别if语句并相应地更改指令指针?

if语句是一个简单的比较/跳转指令,对于PIC来说,它是:

BTFSS PIN_BUTTON_X, 1 	;Is bit 1 of PIN_BUTTON_X set. IF zero skip next instruction (so no jump).
GOTO PIN_ISNOTSET 	;Bit 1 is not zero so JUMP.
;Bit 1 is set so the button is pressed 



顺便说一句,这是非常简单的代码,正如OriginalGriff指出的那样,使用Google很容易找到.这里的解决方案只是创建一种子例程,该例程检查引脚并返回按下的数字或-1作为指示什么都没有发生的指示符.如果确实发生了什么,请对照代码进行检查,如果安全,请打开保管库.但是由于您不了解pic控制器的组装,因此建议您改用c并让编译器找出诸如if之类的复杂语句. c库还包含可帮助您并确保您的时间安全的代码.但是,再次感谢您就您可能还不清楚的问题投了1票.确实,这给了人们不断尝试帮助您的动力.如果您希望将所有物品都放在盘子上,则应该拥有一个工具包.您还可以更改原理图,例如使用LS7220数字锁IC,因此无需进行实际编程(4位代码中的种编程除外)
http://www.aaroncake.net/circuits/combolock.asp [ http://www.rentron.com/PicBasic/Serial-Keys.htm [ ^ ]

祝你好运!


Hey everyone

I''ve been attempting to create a code-locked safe for a few days, and have come up with a schematic. The hardware is wrapping itself up, however I have hit a speed bump in my progress. I need help with the software. I am using a pic16f628a to drive a motor in two directions (open and close) and also to monitor the 11 buttons that will be pressed. (1-9) and a reset and lock button.

Due to my pin restrictions, I need to use the pics internal clock to manage the motor''s time at which it stays on when the correct code has been entered.

Anyway, thats the project. If anyone knows anything about microcontroller software, please respond here, or email me at [Email deleted].

Thanks a ton.

p.s. here is the schematic.

http://img80.imageshack.us/img80/9417/safeschematic.jpg

[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email (like this one) to let you know.[/edit]

解决方案

Google! "PIC Motor Control software" gives loads of hits - refine from there for your motor requirements and you are off.

It would also be a good idea to have a look at the PIC website - they have good code examples and some SD''s too.


Well, thanks for the vote of 1 but I cannot help you if you have no idea of what you expect for an answer. In my opinion my answer fits exactly to your question.
I am also a little shocked by your statement that as far as you understand there aren''t if then statements in assembly. Well, do you mean literally "if then" constructions? No, it wouldn''t be assembly if there are literal if statements because it would then be a more high level language already. Or does this mean that you have the idea that a higher computer language has a magic fairy delivered with the software that recognizes if statements and changes the instruction pointer accordingly?

The if statement is a simple compare/jump instruction and with a PIC this is:

BTFSS PIN_BUTTON_X, 1 	;Is bit 1 of PIN_BUTTON_X set. IF zero skip next instruction (so no jump).
GOTO PIN_ISNOTSET 	;Bit 1 is not zero so JUMP.
;Bit 1 is set so the button is pressed 



This is by the way very simple code and again as OriginalGriff did point out very easy to find using google. The solution here is simply to create a kind of subroutine that checks the pins and returns the number pressed or -1 as indicator that nothing happened. If something did happen you check it against the code and if it''s the safe you open the vault. But since you have no idea of the assembly of a pic controller I would suggest to use c instead and let the compiler figure out the complex statements such as if. The c libraries also have code that would help you along and safe you time. But thanks again for voting 1 on the fact that the question you have probably isn''t all that clear. It really gives people motivation to keep trying to helping you.


Honestly... OriginalGriff''s answer has a good point. If you would want it all handed to you on a plate you should have got a kit. You could also change the schematic and use a LS7220 Digital Lock IC for example so no actual programming has to be done (except kinda programming in the 4 digit code)
http://www.aaroncake.net/circuits/combolock.asp[^]

Also, what you are trying to make is not that complicated because each button has its wire soldered directly on to a pin. So the led blinking examples are almost what you want to do except you want to read the port instead of write to it. But basically it''s turning the set into a get. I would strongly advise you to ignore the rest below and for now keep it in the vault ;P The best way to learn a lot even though you might feel failing constantly is just try out some things yourself and see what happens. You learn much, much more that way. But if you must, can''t control yourself and go insane knowing your secrets lie around unsafe then visit the link below and get that crypt for your exchequer ;)


The link to be kept under lock and key, but here exposed, unguarded, unprotected, just unconcealed:
http://www.rentron.com/PicBasic/Serial-Keys.htm[^]

Good luck!


这篇关于装配微控制器要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆