Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Re: [AVR-Chat] C programming Q

Re: [AVR-Chat] C programming Q

2004-06-10 by Valerij Avrealij

Çäðàâñòâóéòå, Javier.

Âû ïèñàëè 10 ôåâðàëÿ 2005 ã., 14:31:54:

  
> Hey all, i have a little C  programming question....
> I am using a Atmel Dataflash Library which contais the  next sentence
>  
>      DF_DD|=(1<<DF_MOSI)|(1<<DF_SCK)|(1<<DF_SS);     // Set SCK, MOSI & SS as outputs 
>  
> i am  defining:
>     #define  DF_DD            DDRB      // SPI Port Data Direction  Register
>     #define  DF_PORT          PORTB     // SPI Port Register
>     #define  DF_SS           PORTB.4    // Chip Select bit
>     #define  DF_SCK         PORTB.7     // SPI Clock bit    
>     #define  DF_MOSI        PORTB.5    //  SPI Master Out bit
>     #define  DF_MISO        PINB.6      // SPI Master In bit 
>     #define  DF_RDY          PINC.5     // RDY/BSY Flag  (Hardware)

Use such definitions
     #define  DF_SS           4    // Chip Select bit
     #define  DF_SCK          7     // SPI Clock bit    
     #define  DF_MOSI         5    //  SPI Master Out bit
     #define  DF_MISO         6      // SPI Master In bit 
     #define  DF_RDY          5     // RDY/BSY Flag  (Hardware)
 
You are using an bit shifting. You cann't shift an C extension
(POTRX.<digit>)

-- 

 Valerij

Where is it?

2005-02-05 by JChavez@soboce.com

Hi all,

I was trying to read both mmc and sd cards and finally did it. Jesper
Jansen´s code helped me understand the secrets of mmc cards. I did minor
changes on init procedure to use sd cards thogh the same code worked also.
So many thanks to Jesper Jansen to share his asm code.

This time what I want is something different. I want to build something to
localize objects. The object would send some signals from time to time. On
the other side I want to measure this signal. The closer the object the
higher the intensity of the signal, at least that´s what I think. It would
be ease to show the signal intensity on a LCD display. 100 feet would be
fine.
If someone has some info about it , that´ll be great. I´ll apreciate any
help or link.

Javier

Re: [AVR-Chat] Where is it?

2005-02-07 by Jim Wagner

Javier -

Doing what you suggest is difficult. It is not difficult to
measure signal strength (of many signals, including radio).
The problem is that, at almost all frequencies (from audio
to light) there are reflections that result in constructive
or destructive interferance. Light tends to be less
susceptable because of the short wavelength. You could use
a light source (LED) and pulse it. The pulse signature
could be used to separate the desired signal from the
background (ambient). But, sensing the signal over a wide
field of view isn't so easy.

Just an idea. Maybe others will have more suggestions.

Jim

---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

Re: [AVR-Chat] Where is it?

2005-02-07 by Mike Murphree

Jim Wagner said:
>
> Javier -
>
> Doing what you suggest is difficult. It is not difficult to
> measure signal strength (of many signals, including radio).
> The problem is that, at almost all frequencies (from audio
> to light) there are reflections that result in constructive
> or destructive interferance. Light tends to be less
> susceptable because of the short wavelength. You could use
> a light source (LED) and pulse it. The pulse signature
> could be used to separate the desired signal from the
> background (ambient). But, sensing the signal over a wide
> field of view isn't so easy.
>
> Just an idea. Maybe others will have more suggestions.

I'm not sure that I remember the original question, but:

At work, we use quadrant detectors for laser tracking.

Imagine a detector array that looks like this:


      AB
      CD

Where A, B, C, and D are separate (but usually on the same
substrate) light sensors.

Up and down detection is given by:     (A+B) - (C+D)
Left and right detection is given by:  (A+C) - (B+D)

With some decent detectors and optics, you can get a
quasi-proportional output to steer your gimbal mechanism.

Equal output on each of the four sensors is achieved when
you are dead on target.

A fellow on eBay with an id of: thane*grooms  has occasionally
had some PIN diode quadrant detector arrays for sale with
integrated optics.

Mike

C programming Q

2005-02-10 by Javier Fiasche

Hey all, i have a little C programming question....
I am using a Atmel Dataflash Library which contais the next sentence
DF_DD|=(1<
i am defining:
#define DF_DD DDRB // SPI Port Data Direction Register
#define DF_PORT PORTB // SPI Port Register
#define DF_SS PORTB.4 // Chip Select bit
#define DF_SCK PORTB.7 // SPI Clock bit
#define DF_MOSI PORTB.5 // SPI Master Out bit
#define DF_MISO PINB.6 // SPI Master In bit
#define DF_RDY PINC.5 // RDY/BSY Flag (Hardware)
but the sentences seem to hace no effect when debugging it with Avr Studio, i am using Codevision C compiler
Here goes the question: How should be defined DF_MOSI, etc., so the code has effect???? i do not much understand this kind of senteces (rather use PORTC.1=1) but as they appear in lots of libraries and sample code i am trying to get used to them.
In the mega32.h portb, etc , are define as: ; sfrb PORTB=0x18;
Any suggestions??
Thanksd a lot,
Javier
Visita www.tutopia.com y comienza a navegar más rápido en Internet. Tutopia es Internet para todos.

RE: [AVR-Chat] C programming Q

2005-02-10 by Javier Fiasche

Ok thanks, think that problem solved
Javier
-----Mensaje original-----
De: Valerij Avrealij [mailto:avrealij@pisem.net]
Enviado el: Jueves, 10 de Junio de 2004 09:50 a.m.
Para: Javier Fiasche
Asunto: Re: [AVR-Chat] C programming Q

Çäðàâñòâóéòå, Javier.

Âû ïèñàëè 10 ôåâðàëÿ 2005 ã., 14:31:54:


> Hey all, i have a little C programming question....
> I am using a Atmel Dataflash Library which contais the next sentence
>
> DF_DD|=(1<>
> i am ; defining:
> #define DF_DD DDRB // SPI Port Data Direction Register
> #define DF_PORT PORTB // SPI Port Register
> #define DF_SS PORTB.4 // Chip Select bit
> #define DF_SCK PORTB.7 // SPI Clock bit
> #define DF_MOSI PORTB.5 // SPI Master Out bit
> #define DF_MISO PINB.6 // SPI Master In bit
> #define DF_RDY PINC.5 // RDY/BSY Flag (Hardware)

Use such definitions
#define DF_SS 4 // Chip Select bit
#define DF_SCK 7 // SPI Clock bit
#define DF_MOSI 5 // SPI Master Out bit
#define DF_MISO 6 // SPI Master In bit
#define DF_RDY 5 // RDY/BSY Flag (Hardware)

You are using an bit shifting. You cann't shift an C extension
(POTRX.)

--

Valerij


Visita www.tutopia.com y comienza a navegar más rápido en Internet. Tutopia es Internet para todos.

Re: [AVR-Chat] C programming Q

2005-02-10 by Kathy Quinlan

Valerij Avrealij wrote:

Valerij you PC clock is out mate, this message showed up as 8:49pm (GMT 
+ 8:00) 10/06/04

-- 
---------------------------------------------------------------
K.A.Q. Electronics	Website: www.kaqelectronics.dyndns.org
IM: Yahoo: PinkyDwaggy  MSN: katinka@kaqelectronics.dyndns.org
For Everything Electronics     Phone: 0419 923 731
---------------------------------------------------------------	


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 7/02/2005

Re: [AVR-Chat] C programming Q

2005-02-10 by Valerij Avrealij

Hello, Kathy.

You wrote:

>    Valerij Avrealij wrote:

>  Valerij you PC clock is out mate, this message showed up as 8:49pm (GMT
>  + 8:00) 10/06/04

 Thanks. Now I solved this data/time difference. I played with
 computer clock and forgot restore it's value.


-- 

  Valerij Avrealij

Re: [AVR-Chat] C programming Q

2005-02-10 by Kathy Quinlan

Valerij Avrealij wrote:

> Hello, Kathy.
> 
> You wrote:
> 
> 
>>   Valerij Avrealij wrote:
> 
> 
>> Valerij you PC clock is out mate, this message showed up as 8:49pm (GMT
>> + 8:00) 10/06/04
> 
> 
>  Thanks. Now I solved this data/time difference. I played with
>  computer clock and forgot restore it's value.
> 
> 
Your Welcome :)

-- 
---------------------------------------------------------------
K.A.Q. Electronics	Website: www.kaqelectronics.dyndns.org
IM: Yahoo: PinkyDwaggy  MSN: katinka@kaqelectronics.dyndns.org
For Everything Electronics     Phone: 0419 923 731
---------------------------------------------------------------	


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 7/02/2005

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.