Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- You have to know what you are physically connecting to, i.e., the wires in the test harness, so you have to define what the board IDs connected to what are. You could define the DIP switch setting of 0000b as the first board, 0001b as the second board etc. --- Quote End --- Ah, of course. So for a 4-bit switch, we'll have 16 board IDs already uniquely defined. 0000b through 1111b. So, suppose, there are 4 boards connected with the addresses: 0000b,0001b,0010b,0011b. As each board has a 74-bit shift register, we know the first board has test-locations 0 through 74, the second has 75 to 149 and on. All of this will be defined in the uC beforehand. However, how would know uC know how many boards are connected? Or does it simply not matter? If there is no board with an address of 0100b, the uC receives no response. OR At startup, the uC can send a ping to all 16 addresses. So suppose it pings 0000b. If it receives no response, it knows there is no board connected there. It then pings 0001b, it the board pings back then the uC knows there is a board connected there. I like this!! --- Quote Start --- Go and read about how I2C devices work. This is sort of the same scheme, except that there is a unique line for output versus input data. The separate lines allow for differential drivers, rather than a common driver. You could in fact use I2C to implement your system too (isolators exist, and I2C is deploying in buildings single-ended, so its fairly robust). --- Quote End --- Yes, as I was reading this thread I felt I2C might work better as it already has addresses in the protocol. --- Quote Start --- You'd need to define the SPI protocol so that your micro can address devices. You can define an address of 32-bits, but then you'd be wasting your time if you're only addressing a few hundred unique locations. So, you write the code with generics, but ultimately you need to synthesize with a fixed value. --- Quote End --- What I meant was, if each board will really ever contain 2 CPLDs (one for output and another for input), can the board ID not be used as the CPLD ID? We really don't have any plans for cascading more than 6 boards - each board having two CPLDs (o/p and i/p each).