|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: anyone else use the I2C bus?
The New Haven display we used needed to have a jumper soldered onto the PCB traces to enable I2C communication. Check the New Haven literature to see if the model you used needed this jumper. The pads were not drilled so you needed to surface solder a very short piece of bare copper wire across the two adjacent pads.
|
|
#17
|
|||
|
|||
|
Re: anyone else use the I2C bus?
Quote:
Wow… ok I must be overlooking something. Too many people are succeeding so it has to be something in our program. I’ve actually used the I2C bus before. 5 years ago I had three Devantech SRF08’s running from a basic stamp chip so I was aware of the addressing scheme and how to change addresses. We had both a SRF08 Ultrasonic detector and a CMP-S03 connected to the I2C Bus. We could run the demo for SRF08 and get good readings. Then we wanted to also read the CMP-S03 compass. The compass was our priority so we programmed to read it first, then the SRF08. We got data from the compass but nothing from the SRF08. Pretty much the SRF08 should have been a cut and paste of the demo as we left it at default address. We couldn’t see what we were doing wrong and after an hour of rechecking and trying various things, we had to move on and decided to ask the NI guys at the championship. One thing about the NI implementation, to read the Devantech CMP-S03 compass you do a write for the register number you want to read but the write doesn’t need a data byte sent. It will output one or two bytes on the next read according to which register you addressed. I opened up the VI I2C.lvlib:write.vi block diagram and looked at the I2C config, which requires you to send at least one byte of data but it has a password lock so there is no way for me to modify it to write the register number to the device without actually sending a byte of data. I would have to rewrite the vi but there just wasn’t time for that. Hope I didn’t slander the NI guys. They were really busy trying to be in two places at once. |
|
#18
|
||||
|
||||
|
Re: anyone else use the I2C bus?
Quote:
|
|
#19
|
|||
|
|||
|
Re: anyone else use the I2C bus?
Steve_Alaniz for the CMPS03 you should be able to do a I2C read of 2 bytes from register 2. Haven't tried it but I have one so I will connect it and see.
|
|
#20
|
|||
|
|||
|
Re: anyone else use the I2C bus?
Quote:
Oh we DID do a two byte read initially, but that was too much resolution for our application so we dropped back to a one byte read. Steve |
|
#21
|
|||
|
|||
|
Re: anyone else use the I2C bus?
Steve, I have tried 1 and 2 byte reads on CMPS03 without problem with SRF08 running at the same time.
I also found a way to cause the I2C bus to hang with both devices being accessed at the same time. Difference hang: 2 parallel while loops, 1 accessing CMPS03, 1 accessing SRF08 no hang: 1 while loop, accessing SRF08 then CMPS using a sequence If you remove 1 or the other device physically from the bus but leave the code running both 'work'. But with both connected it may hang - it normally works for a while then hangs the while loop - I would expect this unless the I2C FPGA code has locking behavor for multiple accesses, you would end up with multiple conflicting bus accesses. So you probably want to put all I2C accesses in 1 thread, store the results in local/global variables and access the variables when needed. |
|
#22
|
|||
|
|||
|
Re: anyone else use the I2C bus?
Quote:
Thank you Tim... good information. We'll give it a try. Steve |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Does anyone else use the Dvorak layout? | Michael Hill | Chit-Chat | 12 | 25-03-2006 23:47 |
| Ultrasonic Rangefinder Operating On I2C Bus | CapnBFG | Electrical | 10 | 04-06-2005 01:31 |
| Does anyone else NOT use a long arm to place a tetra on top of the Goal? | mad_cloversc | General Forum | 29 | 08-03-2005 00:44 |
| Anyone else pumped for Bash @ the Beach? | rocknthehawk | Off-Season Events | 24 | 08-10-2004 16:12 |
| Anyone else irresponsibly overlooked by the judges? | archiver | 2001 | 12 | 24-06-2002 03:31 |