搜索
bottom↓
回复: 6

请教一下bascom初始化的问题

[复制链接]

出0入0汤圆

发表于 2007-11-28 09:30:01 | 显示全部楼层 |阅读模式
$hwstack
$swstack
$framesize是什么意思?
大小根据什么定?怎么设置?

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出0入0汤圆

发表于 2007-11-28 10:14:56 | 显示全部楼层
设置堆栈什么的。
对于初学者,使用默认的,一般〔99%〕情况都不会出错。
如果中断,串口,子程序使用的很多,可以设置的大一点。

出0入0汤圆

发表于 2007-11-28 17:09:41 | 显示全部楼层
先按1楼的做.在BASCOM-AVR的帮助中,有具体的说明和计算方法,写比较大和复杂的程序时,可以参考.

出0入0汤圆

 楼主| 发表于 2007-11-28 18:41:44 | 显示全部楼层
谢谢meitun,谢谢马老师.
一楼给了只鱼.
二楼给了只"渔"

出0入0汤圆

发表于 2007-11-28 22:18:08 | 显示全部楼层
Options Compiler Chip

Chip Selects the target chip. Each chip has a corresponding x.DAT file with specifications of the chip. Note that some DAT files are not available yet.

XRAM Selects the size of the external RAM. KB means Kilo Bytes. For 32 KB you need a 62256 STATIC RAM chip.

HW Stack The amount of bytes available for the hardware stack. When you use GOSUB or CALL, you are using 2 bytes of HW stack space. When you nest 2 GOSUB’s you are using 4 bytes (2*2). Most statements need HW stack too. An interrupt needs 32 bytes.

Soft Stack Specifies the size of the software stack. Each local variable uses 2 bytes. Each variable that is passed to a
sub program uses 2 bytes too. So when you have used 10 locals in a SUB and the SUB passes 3 parameters, you need 13 * 2 = 26 bytes.

Frame size Specifies the size of the frame. Each local variable is stored in a space that is named the frame space. When you have 2 local integers and a string with a length of 10, you need a frame size of (2*2) + 11 = 15 bytes.
The internal conversion routines used when you use INPUT num, or STR(), or VAL(), etc, also use the frame. They need a maximum of 16 bytes. So for this example 15+16 = 31 would be a good value.

XRAM wait state Select to insert a wait state for the external RAM.

External Access enable. Select this option to allow external access of the micro. The 8515 for example can use port A and C to control a RAM chip. This is almost always selected if XRAM is used

Default Press or click this button to use the current Compiler Chip settings as default for all new projects.

出0入0汤圆

 楼主| 发表于 2007-11-28 23:12:08 | 显示全部楼层
谢谢马老师,现在搞清楚了.GOSUB,CALL要两个字节的HW STACK;每个局部变量使用两个字节的SW STACK; 转换子程序INPUT num, or STR(), 或 VAL(),决定使用的framesize.

出0入0汤圆

发表于 2007-11-28 23:38:42 | 显示全部楼层
最好看看帮助文件中硬件部分的内存使用一节,里面讲得很清楚。
我一般在写程序时有不明白的首先想到的是手册(帮助文档),如果找不到相关解决方法,就自己写一些短的测试代码,专门测试需要的功能,确实不行Google看看,再不行就发问。
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-5-22 13:00

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表