久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2201|回復: 4
打印 上一主題 下一主題
收起左側

急急急-AD轉換求助

[復制鏈接]
跳轉到指定樓層
樓主
ID:121043 發表于 2016-5-23 22:22 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
求大神幫助我做一個MAX1241的Isis和PRO。以我給的附件中的ADC0832為例,除了AD轉換器換了,其他的都不要改變,keil仿照我給的附件。附件包含 ADC0832模數轉換與顯示的例子。謝謝大神,等著急用

附件.zip

548.16 KB, 下載次數: 6

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:114189 發表于 2016-5-23 23:39 來自手機 | 只看該作者
加我q201792056  發給我 我看一下
回復

使用道具 舉報

板凳
ID:114189 發表于 2016-5-23 23:42 來自手機 | 只看該作者
加我q 201792056 發給我 我看一下吧
回復

使用道具 舉報

地板
ID:22218 發表于 2016-5-24 06:30 | 只看該作者
/*************************************************
Digital voltmeter using an
Maxim MAX1241 ADC
connected to an AT90S8515
using the SPI bus
The measured voltage is transmitted
through the STK200 RS232 interface
Communication parameters: 9600 8N1

CodeVisionAVR C Compiler
(C) 1998-2000 Pavel Haiduc, HP InfoTech S.R.L.

Chip type : AT90S8515
Clock frequency : 4.000000 MHz
Memory model : Small
Internal RAM size: 512
External RAM size: 0
Data Stack size : 128
*************************************************

MAX1241 connections to the AT90S8515

[MAX1241] [AT9S8515 DIP40]
1 VDD=5V
2 Vin
3 /SHDN - 1 PB0
4 REF=5V
5 GND - 20 GND
6 DOUT - 7 MISO
7 /CS - 2 PB1
8 SCLK - 8 SCK

THE ISP CABLE SHOULD BE DISCONNECTED FROM
THE STK200 BOARD AFTER PROGRAMMING THE CHIP!

ALSO THE PORTB LED JUMPERS MUST BE OPEN!
*/

#include

// Standard Input/Output functions
#include

// SPI functions
#include

// delays
#include

// MAX1241 Voltage Reference [mV]
#define VREF 5000

// MAX1241 control signals definitions
#define NSHDN PORTB.0
#define NCS PORTB.1
#define DOUT PINB.6

union adcu
{
unsigned char byte[2];
unsigned int word;
};

// Make one AD conversion and return the value
unsigned int max1241_read(void)
{
union adcu adc_data;
// exit MAX1241 from shutdown
NSHDN=1;
// wait 5us for the MAX1241 to wake up
delay_us(5);
// now select the chip to start the conversion
NCS=0;
// wait the conversion to complete
// DOUT will be 0 during conversion
while (DOUT==0);
// DOUT=1 -> conversion completed
// read MSB
adc_data.byte[1]=spi(0);
// read LSB
adc_data.byte[0]=spi(0);
// deselect the chip
NCS=1;
// enter shutdown
NSHDN=0;
// now format the result and return it
return (adc_data.word>>3)&0xfff;
}

void main(void)
{
// store the conversion result here
unsigned n;

// Input/Output Ports initialization
// Port A
DDRA=0x00;
PORTA=0x00;

// Port B
// the /SS pin is set as an output
// with level 1, it's required by
// the SPI to work in master mode
DDRB=0xA3;
PORTB=0x12;

// Port C
DDRC=0x00;
PORTC=0x00;

// Port D
DDRD=0x00;
PORTD=0x00;

// UART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// UART Receiver: Off
// UART Transmitter: On
UCR=0x08;
// UART Baud rate: 9600
UBRR=0x19;

// SPI initialization
// SPI Type: Master
// SPI Clock Rate: 1000.000 kHz
// SPI Clock Phase: Cycle Half
// SPI Clock Polarity: Low
// SPI Data Order: MSB First
SPCR=0x50;

putsf("MAX1241 Demo using the CodeVisionAVR C Compiler");
putsf("***********************************************\n");

// Make AD conversions and send the results to RS232
while (1)
{
n=max1241_read();
printf("MAX1241-> N=%4u U=%4umV\n",n,(unsigned) ((long) n*VREF/4096));
// 0.3 sec. delay
delay_ms(300);
};
}
回復

使用道具 舉報

5#
ID:121043 發表于 2016-5-24 11:46 | 只看該作者
chinomango 發表于 2016-5-24 06:30
/*************************************************
Digital voltmeter using an
Maxim MAX1241 ADC

沒看懂……我解釋一下吧。使用的是AT89C51芯片,用的是C語言。把我給的里面的ADC0832轉換器換成MAX1241,端口不要改變。然后寫出程序。附件里面有ADC0832的例子。仿照著寫
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 国产91一区 | 亚洲欧美一区二区三区国产精品 | 免费亚洲婷婷 | 欧美在线一区二区三区 | 成人欧美一区二区三区在线观看 | 午夜亚洲| 国产精品久久性 | xxx视频 | 人人澡视频 | 中文字幕 国产精品 | 久草.com | 涩涩视频网站在线观看 | 毛片一级片 | 久久精品一区二区三区四区 | 欧美色综合 | 99久久精品国产毛片 | 中文字幕国产在线 | 91 在线| 欧美乱码精品一区二区三区 | 精品亚洲一区二区 | 玖草资源 | 超碰男人天堂 | 91一区二区三区在线观看 | 亚洲精品九九 | 一区二区三区精品视频 | 国产999精品久久久久久 | 久久一区视频 | 狠狠操av| 九九国产在线观看 | 91亚洲精华国产 | www久久久| 久草网视频 | 亚洲激情在线观看 | 国产精品日本一区二区在线播放 | 亚洲国产免费 | 中文字幕 在线观看 | 精品国产一区二区国模嫣然 | 色伊人网 | 国产欧美日韩综合精品一 | 日韩视频一区二区 | 欧美色欧美亚洲另类七区 |