EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / hello ljajay…   in

hello ljajay…   in

|

Microcontroller › AVR › copying rfid tag no in an array for comparision › hello ljajay…   in

February 22, 2011 at 11:16 am #5579
dagakshay
Participant

hello ljajay…

 

in ISR

 

1)

PORTA=0x01;

LED=(1<<PA0);

 

both are same statments according to your program… why you writing the same statment twice??

 

2)

similarly you have done for PORTA=0x02 and LED=(1<<PA1);

 

3)

when you want to turn off your LED you wrote

PORTA=0x02;

LED=(0<<PA1);

 

the first statment says you want to send a high signal on 1st pin of PORTA {PORTA=0x02} and the nest statment itself you turned it off {LED=(0<<PA1);} 

 

4)

i think you are bit confuse between PORTx and DDRx…

PORTx is used to send the value on that port named “x”.

and DDRx is used to set the direction of that port.

refer to the link for more information about PORT and DDR syntax..

http://www.engineersgarage.com/embedded/avr-microcontroller-projects/led-interface-circuit

 

5)

in starting of ISR u had done i++ mean the incoming byte will go to next array block..and you havn’t delcared the varialbe i any where in your code.

let me make it more clear..

i must be global variable according to your code 

when you started the program the value of i will be zero but as soon you enter the ISR the value of variable i is incremented by one so here i becomes 1 then i checks all the if and else condition you wrote and at last the UDR value goes to

mybyte=UDR;

and here i=1, not zero;

when i reaches thirteen you are compairing mybyte[0] which doesn’t make any sense…

 

go through all the points and let me know your progress

RSS Recent Posts

  • Is AI making embedded software developers more productive? June 22, 2025
  • Can I make two inputs from one?? June 21, 2025
  • Behlke swich June 21, 2025
  • Beats Solo 4 June 21, 2025
  • Simple LED Analog Clock Idea June 21, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise