PIC12F683 备忘录

第一次在PIC12F683上写程序,因"空有自信"、急于求成,便跳过了用于启蒙的控制发光二极管的电路的实践,上来搞的便是RS232C通信; 经历挫折无数,喜得今日成功,不胜感慨万分。此处把其中的值得注意的地方稍作列表,备忘之用。




1) 内部、外部时钟的选择,以及频率的选择与OSCCON、CONFIG有关。其中CONFIG在刻录程序到芯片式时设定。(见下图)

2) IO接口可以通过TRISIO来设定,但是Port3, Port4,Port5还受别的参数的影响。其中Port3永远是输入,Port4,Port5 是否作为IO使用与芯片时钟的设置很有关系,见CONFIG的相关解说。同时因为PIC12F683有比较电路,Port0-3是否作为数字接口还与CMCON0有关。

3) 模数A/D变换由ANSEL决定。

4)设置寄存器(register)时,要明确是在那个Page中。上述的大部分寄存器(register)在Page1中,但是CMCON0在Page0中。


其他

1) 调试程序可以用“PIC simulator IDE”,这个在调试器可以观测波形变化,也可以模拟USART中断来收发数据。因为模拟的时钟可以任意设定,RS232C的通信过程完全可以在低速下观测确认! 免费版可以用30次,每次两个小时。

2) 可以用软件“LookRS 232”来实时观测 RS232C通信,并以多种形式显示得到的数据。



3)PIC Writer可以购买秋月电子(日本)的散件自己组装(5700日元),或者直接成品(6700日元)。也可以在Half Mat购买十分小巧的PIC writer,最便宜的只要760日元,但是因为笔记本电脑的串口电压过低(正负5伏),不能使用该writer。


4) JDM writer相关的页面可以参看此处。http://cgi.biwa.ne.jp/~jr3roc/pic/ 其中FENG3的值得推荐。


5) 后闲哲也先生的关于RS232C通信的详细介绍。 http://www.picfun.com/serialframe.html

评论

akira说…
pls give the URL to download Lookrs232. thanks!
Peak说…
链接已更新。

另外,你的Yterm也是很好用的。

我修改了一下,可以直接读取数据为整数型。

这样可以提高一点点速度。:-)
匿名说…
Good day, sun shines!
There have been times of hardship when I didn't know about opportunities of getting high yields on investments. I was a dump and downright stupid person.
I have never thought that there weren't any need in big initial investment.
Nowadays, I feel good, I begin take up real money.
It gets down to choose a proper partner who utilizes your funds in a right way - that is incorporate it in real deals, parts and divides the income with me.

You may get interested, if there are such firms? I have to answer the truth, YES, there are. Please get to know about one of them:
http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]
匿名说…
mutex liberties premise readership storyboard speeches czkap array trash alert resource
lolikneri havaqatsu

此博客中的热门博文

Lyrics of Tokyo Love Story

书生贩粥