Results 1 to 7 of 7

Thread: atmega16 programming help.

  1. #1

    Default atmega16 programming help.

    Hello experts,
    I have a very little problem but very big for me.I want to send bit by bit hex data from one of the I/O pin of atmega16.i can send it using SPI but i can't solve my problem from that becoz i have to give the time limit of each and evry bit of the data.Actually i m doing a RFID Reader based project.I need it to program the RFID Transceiver.

    please help

    regards
    mfsaban

  2. #2

    Default

    So what's the problem?

  3. #3
    Senior Member T-1000
    Join Date
    Mar 2005
    Location
    Bangalore
    Posts
    728
    Blog Entries
    7

    Default

    I guess you need the uc to act like a shift register. If thats the case, you can implement a subroutine, which does so. If you want the data to be transferred to another controller of any kind i would recommend the USART.

    I hope i got your question right. It would be better if you explain your question a bit more.
    .... I didnt do it ! ....

  4. #4

    Default atmega16 programming help.

    >I guess you need the uc to act like a shift register. If thats the case, you >can implement a subroutine, which does so. If you want the data to be >transferred to another controller of any kind i would recommend the >USART.

    >I hope i got your question right. It would be better if you explain your >question a bit more.


    Hello,
    You got the question right but i can't use usart because usart is busy for the Serial communication with computer.i m try to explain my question.
    I have to send bit by bit by user define time interval, means for the high bit the pin will be high for 150 usec and for the low bit the pin will be low for 100 usec.
    these all bits are of a hex number.Now i m sending data through SPI but as you know in SPI the hexnumber is transfer to shift register but i can't specify the timing between the bits present in shift register.
    I think you have got what i want ,hope you will help me.

    regards
    mfsaban

  5. #5
    Member Advanced User
    Join Date
    Oct 2005
    Location
    India
    Posts
    41

    Default

    I guess your problem is to is to set a I/O pin high or low with certain time intervals in between so as to program your RFID Transceiver or other.

    Well you can use delays for that. You may either write your own delay subroutine or use already defined delay subroutines like _delay_us() ( defined in util/delay.h ) since you need delays in us.
    Or
    you may use hardware timers, it will be precise but for very short delays, the overhead of setting up a hardware timer is too much compared to overall delay ( as in ur case its 100-150us)

    select the bits one by one, change the I/O pin corresponding to the bit , induce the delay, then the next bit ....

  6. #6

    Default atmega16 programming help.

    Hello abhijit,
    You are right but when i use delay then the program will be very much long.tell me one thing how can you send hex data from one pin of microcontroller without using SPI.

  7. #7
    Senior Member T-1000
    Join Date
    Mar 2005
    Location
    Bangalore
    Posts
    728
    Blog Entries
    7

    Default

    if the time delay is very important, i will suggest timers.
    The algorithm depends on what all other things you will be doing.. (like external keypad, Usart, etc)
    By using timer interruts, the code can be optimised. However, if execution speed is not htat important, you can go for polling or software delays.
    .... I didnt do it ! ....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •