搜索
bottom↓
回复: 26

应用(应用实例:AVR图形声音发生器范例),把结果告诉大家:

[复制链接]

出0入0汤圆

发表于 2004-12-28 16:00:09 | 显示全部楼层 |阅读模式
应用图像——改为中国使用pal制式隔行50hz*625行。

没应用声音——不会!看不懂!谁(那个水坛的影儿)把实例全部翻译以下,在考虑。

结果:成功轮流显示出?1234及汉字。不过没声音,就没啥意思。

后续:可以搞出来一个小动画。将画面数据缩小到32*50/8,16k可以保存几十副图片。以5副/s显示,可以达到10秒钟。

//atmega16-16pi(iccavr c)

//12Mhz

//C.1 is sync:1000 ohm + diode to 75 ohm resistor

//C.0 is video:330 ohm + diode to 75 ohm resistor

//无隔直电容

点击此处下载armok0131322.txt(包含两个文件*.C、*.H)



改动原因:

贴的文件太大,导致打开速度太慢。该为链接。


-----此内容被SUN0_LIANG于2005-01-18,10:51:45编辑过
头像被屏蔽

出0入0汤圆

发表于 2004-12-28 17:32:06 | 显示全部楼层
很不错啊!



我还以为这个实验没有人肯动手呢。

出0入0汤圆

 楼主| 发表于 2004-12-29 08:43:32 | 显示全部楼层
能不能让影儿把范例翻译一下,看声音是如何应用的?

出0入0汤圆

发表于 2005-1-17 22:50:36 | 显示全部楼层
啊 ??范例里还有声音啊,晕

出0入0汤圆

发表于 2005-1-17 23:42:26 | 显示全部楼层
是否可以将图像信息存在外部FLASH在中,通过SPI接口读取呢?

出0入0汤圆

 楼主| 发表于 2005-1-18 10:20:55 | 显示全部楼层
不行,速度大概不够快!!!

//画面缓存刷新

      if (framecount>=100)

      {

         framecount=0;

         flashcount++;

         if(flashcount>=9){flashcount=0;}

         for (i=0;i<=799;i=i+1)

          {

            screen=zk1[flashcount];

          }

      }

计算一下:

位:=800*8=6400

SPI时间最小:=6400/10=640US        //设SPI波特率=10M??



图形小,可以!!



改动原因:+计算
-----此内容被SUN0_LIANG于2005-01-18,10:46:06编辑过

出0入0汤圆

 楼主| 发表于 2005-1-18 10:26:15 | 显示全部楼层
crazyeda :看了你的贴子,我久久不能平静。-_-

AM:  -_-

请问:“AVR图形声音发生器范例”里有关声音吗??

标题为:

Cornell University

Electrical Engineering 476

Video Generation with AVR microcontrollers//为何翻译为AVR图形声音发生器范例??



改动:找到原文“声音”

Adding Sound



Since most TVs have a sound input, it would be nice to be able to generate some sound from the program. Two modifications of the video program are necessary to generate sound on the Mega163. (Note that sound on the Mega32 is much easier, see the next section.) First, a bit needs to be toggled in the the interrupt which handles the sync generation. Care must be taken to make all conditionals use the same number of cycles, to avoid video jitter. Second, to save a few microseconds, loading resisters for video playback on each line has to be converted to assembler. This example produces a two-octave scale, playing 4 notes/second. The accuracy of the tones is about 1%, which is good enough for sound effects, but will drive some people out of the room. This version of the video program is portable across compiler versions and is compatable with CodeVision version 1.23.7.



The following Matlab code generates the required counts, assuming that the sync interrupt will toggle a bit. The first column of the output is the frequency of the note. The second column is the note duration in units of 63.625 microseconds. The third is the relative error. Between C3 and C6, all note frequencies are within 1% error except for F5 which is flat by 2%.



The output port pin should be connected to ground by a 5 Kohm resistor. The TV should be connected across the resistor. The resistor is necessary because the TV is AC coupled and will slowly charge up and cut off the audio.


-----此内容被SUN0_LIANG于2005-01-18,10:40:03编辑过

出0入0汤圆

发表于 2006-8-11 10:39:14 | 显示全部楼层
请教:中断中有如下:

  if (LineCount==298)            //开始反 synch after line 297



   {



      syncON = B00000010;         //同步=1



      syncOFF = 0;            //同步=0



   }



   if (LineCount==301)            //back to regular sync after line 300



   {



      syncON = 0;               //同步=0



      syncOFF = B00000010;      //同步=1



   }

行同步信号在298行为何反一下,而在301行有恢复,我对电视显示不太懂,能否请大虾解释一下

出0入296汤圆

发表于 2006-8-12 12:37:44 | 显示全部楼层
Adding Sound   

Since most TVs have a sound input, it would be nice to be able to generate some sound from the program. Two modifications of the video program are necessary to generate sound on the Mega163. (Note that sound on the Mega32 is much easier, see the next section.) First, a bit needs to be toggled in the the interrupt which handles the sync generation. Care must be taken to make all conditionals use the same number of cycles, to avoid video jitter. Second, to save a few microseconds, loading resisters for video playback on each line has to be converted to assembler. This example produces a two-octave scale, playing 4 notes/second. The accuracy of the tones is about 1%, which is good enough for sound effects, but will drive some people out of the room. This version of the video program is portable across compiler versions and is compatable with CodeVision version 1.23.7.   



The following Matlab code generates the required counts, assuming that the sync interrupt will toggle a bit. The first column of the output is the frequency of the note. The second column is the note duration in units of 63.625 microseconds. The third is the relative error. Between C3 and C6, all note frequencies are within 1% error except for F5 which is flat by 2%.   



The output port pin should be connected to ground by a 5 Kohm resistor. The TV should be connected across the resistor. The resistor is necessary because the TV is AC coupled and will slowly charge up and cut off the audio.   



尝试翻译了下,请大家指正。



添加声音

自从大部分电视机拥有音频输入起,能够利用程序来发出声音就是一件非常美妙的事情。利用Mega163来发出声音就需要两个经过修改的视频程序。(提示:利用Mega32发出声音要更简单一些,相关内容请参见下一个章节)首先,需要利用1个数据位来关联同步中断。为了避免干扰视频信号,我们需要特别小心统一使用相同的周期。其次,为了节省程序运新周期,声音的回放程序最好使用汇编代码。这个例子用来演示两个8度音节,使用4分音符。音调的误差为1%,这对于实现震撼的音效来说已经足够了,但是,可能会把屋子里的一些人吓跑。这个视频程序的版本简单的由编译器的版本号和代码的版本号组成。



下面的Matlab代码将产生我们需要的统计数据。

假设同步中断占用1个数据位。

第一个柱状图表示输出音符的频率,第二个柱状图表示音符的持续时间(单位/63.625ms)第三个柱状图表示的是相对误差。

在C3和C6之间,除了F5的频率降低了2%之外,所有音符频率的误差都为1%。



输出端口需要通过一个5K的电阻接地。电视需要通过电阻来连接。这个电阻是必须的,因为电视使用的是交流电,这会在信号线之间缓慢的充电,并最终阻断音频信号。

出0入0汤圆

发表于 2009-2-20 15:41:00 | 显示全部楼层
mark!

出0入0汤圆

发表于 2009-2-21 09:09:51 | 显示全部楼层
这个好,做个记号,建议楼主发个图,这样更直观一些。。。

  我很想做这个实验,想学习一下..

出0入0汤圆

发表于 2009-2-22 01:21:42 | 显示全部楼层
留个记号!谢谢了

出0入0汤圆

发表于 2009-2-22 09:06:55 | 显示全部楼层
记号

出0入0汤圆

发表于 2009-2-22 10:26:33 | 显示全部楼层
Mark一下!

出0入0汤圆

发表于 2009-2-22 10:27:30 | 显示全部楼层

出0入0汤圆

发表于 2009-2-22 12:16:59 | 显示全部楼层

出0入0汤圆

发表于 2009-5-20 13:15:28 | 显示全部楼层
记号

出0入0汤圆

发表于 2009-9-19 00:27:36 | 显示全部楼层

出0入0汤圆

发表于 2009-10-29 05:45:21 | 显示全部楼层
用av接口不是更简单

出0入0汤圆

发表于 2009-11-6 13:17:13 | 显示全部楼层
mark...

出0入0汤圆

发表于 2009-12-27 22:47:59 | 显示全部楼层
记号!!

出0入0汤圆

发表于 2009-12-28 13:55:14 | 显示全部楼层
mark!

出0入0汤圆

发表于 2010-1-1 23:58:43 | 显示全部楼层
记号

出0入0汤圆

发表于 2010-5-18 22:27:09 | 显示全部楼层
最近狂找这类东西!!!不顶不行!

出0入0汤圆

发表于 2010-5-19 00:00:26 | 显示全部楼层
mark

出0入0汤圆

发表于 2010-5-19 01:26:06 | 显示全部楼层
niu
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-12 01:29

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

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