Thread: SPI , I2C , JTAG standards request ... pls help

  1. #1
    Registered User
    Join Date
    Aug 2015
    Posts
    8

    SPI , I2C , JTAG standards request ... pls help

    hi friends,

    I am now studying Microcontrollers and their communication with
    other Devices like ADC .. etc

    I was encountered by SPI and I2C and JTAG ... I searched the
    internet and some friends in another forum helped me to find
    tutorials,
    I read them absorbed them well but they are talking about serial
    and parallel communication in general ... i want what codes
    corresponds to what message .. the duration of response from
    slave to master in synchronous communication ..these are not
    obvious...
    I explain the problem in more details in my post (Abdo_8008)
    at avr freaks , here is the link pls see it to know where i reached there .

    [atmega32 question] Communication with the outside world | AVR Freaks

    thanks

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    If you want detailed descriptions and code samples, go right to the source. I went to the Atmel site, found the page for ATmega32, and went to the "documents" tab. There's a slew of detailed application notes for all sorts of things.

    ATmega32

  3. #3
    Registered User
    Join Date
    Aug 2015
    Posts
    8
    [matticus] thanks for your answer , do you mean that SPI on the Microcontroller transfers data in bytes to the slave
    the microcontroller don't mind what op codes but each slave peripheral have it's own format of op-codes that code be
    stored as constants or something like that and then used by their names in the code of the microcontroller..that's what
    i got when i had fast read to two documents in the link you gave me ... ??

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Quote Originally Posted by abdo_8008 View Post
    do you mean that SPI on the Microcontroller transfers data in bytes to the slave
    Technically, SPI does not have a fixed transmission size of a byte, unlike other serial protocols such as RS-232. As many bits as needed can be sent, though in practice, the number of bits transmitted is almost always going to be a multiple of 4 or 8. It all depends on the agreed-upon communication scheme between devices.

    Quote Originally Posted by abdo_8008 View Post
    the microcontroller don't mind what op codes but each slave peripheral have it's own format of op-codes that code be stored as constants or something like that and then used by their names in the code of the microcontroller
    Well, the master needs to know what certain values represent if it wants to meaningfully communicate with the slave. The slave can then decode data it receives in many ways. One is as you describe - compare the received data to a list of names constants to determine what command/data was sent.

    But again, whether or not the slave actually expects data in 8-bit chunks depends on how the device was designed and/or programmed.

    As a different example, consider the digital potentiometer MAX5481. Its SPI interface expects to receive 24 bits during a single transmission. The data sheet for this device has a table that shows how the 24-bit commands are decoded:

    SPI , I2C , JTAG  standards request ... pls help-digital-pot-png

    As you can see, bits 1 and 2 are always zero. Bits 3 and 4 determine the action to take (whether to write a new value to the wiper, copy its current value to non-volatile memory, or read the value in non-volatile memory back onto the wiper). Bits 5 through 8 are always zero. Bits 9 through 18 are the 10-bit data value for setting the pot. And bits 19 through 24 are "don't care".

    Quote Originally Posted by abdo_8008 View Post
    ..that's what i got when i had fast read to two documents in the link you gave me ... ??
    Instead of reading through the documents quickly, I suggest the following approach:

    • Print out the document in question
    • Give it a read-through
    • Go through it again from the beginning, highlighting important points
    • Go through it again from the beginning, and for each section, extract the basic information and write it down in your own words (right on the sheet itself)
    • Optionally, create a "reference" sheet where you write down all information you extracted in your own words


    The "in your own words" approach ensures you have a record that reflects your own personal understanding on the concepts presented. In addition to helping you comprehend the details, you do not have to "figure out it" again later on when the details fade from memory, since you now have a personalized reference.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Standards and TC1/TC2
    By robwhit in forum C Programming
    Replies: 2
    Last Post: 07-28-2007, 12:04 PM
  2. Sub-standards?
    By Marcux in forum C Programming
    Replies: 5
    Last Post: 05-02-2007, 11:07 AM
  3. New standards
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 10-14-2006, 02:53 AM
  4. new C++ standards
    By Nectron in forum C++ Programming
    Replies: 6
    Last Post: 06-12-2003, 02:38 PM
  5. Using c++ standards
    By subdene in forum C++ Programming
    Replies: 4
    Last Post: 06-06-2002, 09:15 AM

Tags for this Thread