> AT91SAM7S adc usart, ,
V
iadept
Aug 29 2012, 08:49
#1





:
: 5
: 29-08-12
: 73 303



arduino ... AT91SAM7S64, KEIL
PIO , ADC .
, adval = 0x000003FF, ...

, at91sam7sxx_adc_rv keil'

/* Enable peripheral clocks */
*AT91C_PMC_PCER = (1<<AT91C_ID_ADC) | /* enable ADC, */
(1<<AT91C_ID_US0); /* enable USART0 */

init_serial(); /* Initialize Serial Interface */

/* Setup the A/D converter */
pADC->ADC_CR = AT91C_ADC_SWRST; /* reset ADC */
pADC->ADC_CHER = AT91C_ADC_CH0 |
AT91C_ADC_CH1; /* enable ADC channels 0..3 */
pADC->ADC_MR = AT91C_ADC_LOWRES_10_BIT |
(9<<AT91C_ADC_PRESCAL_SHIFT); /* set 10-bit res., prescale = 9 */

while (1) { /* loop forever */

pADC->ADC_CR = AT91C_ADC_START; /* start ADC0 conversion */
while ((pADC->ADC_SR & AT91C_ADC_EOC0) == 0); /* wait for ADC0 conversion */

/* Read result of ADC conversion */
adval = (unsigned int) pADC->ADC_CDR0 & AT91C_ADC_DATA;

/* Output 0-1023 AD0 value without using floating-point */
printf ("AD0 Output Value %4u = %01u.%04u Volts\r",
(unsigned) adval,
(unsigned) (adval * VREF) >> 10, /* Output Integer Portion */
(unsigned) ((adval * VREF * 10000UL) >> 10UL) % 10000); /* Output Decimal Portion */
}
}

usart, , At91 ... ... Board, , ...

Go to the top of the page
 
+Quote Post
 
Start new topic
(1 - 5)
GDI
Aug 29 2012, 09:04
#2



*****

:
: 1 235
: 14-05-05
: -
: 5 008



USB Serial - . .
, , , . ( ).


--------------------
Go to the top of the page
 
+Quote Post
subver
Aug 29 2012, 09:05
#3



**

:
: 185
: 4-06-05
:
: 5 726



(iadept @ Aug 29 2012, 15:49) *
usart, , At91 ... ... Board, , ...

USART? USART USB.
, .
Go to the top of the page
 
+Quote Post
iadept
Aug 29 2012, 09:35
#4





:
: 5
: 29-08-12
: 73 303



Arduino , ...

iadept - Aug 29 2012, 09:37
Go to the top of the page
 
+Quote Post
iadept
Aug 29 2012, 10:55
#5





:
: 5
: 29-08-12
: 73 303



.

Universal Serial Bus Converter RS-485 to USB, R/TXD0
Realterm yooް!o@... 2. / .
Go to the top of the page
 
+Quote Post
iadept
Aug 29 2012, 11:59
#6





:
: 5
: 29-08-12
: 73 303



!
Go to the top of the page
 
+Quote Post
« · ARM · »
 

Reply to this topicStart new topic
1 . (: 1, : 0)
: 0

 

: : · · :

· · ·


RSS : 27th July 2025 - 15:13
@Mail.ru


0.01406 7
ELECTRONIX 2004-2016