搜索
bottom↓
回复: 2

LPC2292/LPC2294/01的SSP的使用方法?

[复制链接]

出0入0汤圆

发表于 2009-3-27 21:30:27 | 显示全部楼层 |阅读模式
因为我要和DSP2407进行双机通讯,最好数据位能达到16位。我查过LPC2292最新PDF说LPC2292和LPC2294的01板是带SSP的(SSP可以16位)。那么这个寄存器的地址是什么呢?
    于是,我先用了LPC2148头文件的SSP寄存器,但是当初始化SSP时会出现取指令中止,后来又用了MDK的头文件库里的SSP寄存器地址,编译是通过了,但是执行时用示波器看,连sck驱动时钟都没有,真是太郁闷了。
    到底这个版本的SSP应该怎么用的?请教一下,谢谢

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

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

 楼主| 发表于 2009-3-27 21:40:58 | 显示全部楼层
欧,群里有人告诉我了,

首先用MDK的LPC2200头文件是对的

再次要在Power Control for Peripherals register (PCONP)要设置位10(PSPI1)和位23(PCSSP),复位默认是SPI1方式

Remark: Setting this bit to 1 and bit 10 (PSPI1) to 0, selects the SPI1
interface as SSP interface. At reset, SPI1 is enabled.


补充一下

While the SSP and SPI1 peripherals share the same physical pins, it is not possible to
have both of these two peripherals active at the same time. Bit 10 (PSPI1) and bit 21
(PSSP) residing in the Section 6–10.3 control the activity of the SPI1 and SSP module
respectively. The corresponding peripheral is enabled when its control bit is 1, and it is
disabled when the control bit is 0. After power-on reset, SPI1 is enabled, maintaining the
backward compatibility with other NXP LPC2000 microcontrollers. Any attempt to write 1
to PSPI1 and PSSP bits at the same time will result in PSPI = 1 and PSSP = 0.

To switch on the fly from SPI1 to SSP and back, first disable the active peripheral’s
interrupt(s), both in the peripheral’s and VIC’s registers. Next, clear all pending interrupt
flags (if any set). Only then, the currently enabled peripheral can be turned off in the
PCONP register. After this, the other serial interface can be enabled.
It is important to disable the currently used peripheral by clearing its bit in the PCONP
register only at the very end of the peripheral’s shut-down procedure. Otherwise, having 0
in a bit in PCONP will disable all clocks from coming into the peripheral controlled by that
bit. Then, reading from the peripheral’s registers will not yield valid data and write and/or
modify access will be banned, i.e. no content can be changed. Consequently, if any of the
interrupt triggering flags are left active in the peripheral’s register(s) when the peripheral is
disabled via the PCONP, the invoked ISR may not be able to successfully service pending
interrupt, and the same interrupt may keep overloading the microcontroller even though its
peripheral is disabled.

出0入0汤圆

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

本版积分规则

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

GMT+8, 2024-7-23 13:16

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

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