Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - CheezeWiz

1
Bus Pirate Support / BusPirate & SPI with MAX31855 Thermocouple
Good afternoon,

I have a arduino sketch that compiles fine and it runs my code as expected and I thought it would be neat to try and do the same thing with a bus pirate... further my lack of knowledge on SPI...

Digging through the library in the source I found
Code: [Select]
  SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));  // Defaults
  data.bytes[3] = SPI.transfer(0x00);
  data.bytes[2] = SPI.transfer(0x00);
  data.bytes[1] = SPI.transfer(0x00);
  data.bytes[0] = SPI.transfer(0x00);
  SPI.endTransaction();
 
  digitalWrite(cs, HIGH);

What I would like to understand is how to properly do the same thing with bus pirate syntax?
I know I need to use [ to pull CS low and it looks like it sends data, then reads data, then sends data exct...

Could someone help out with the syntax when you go into the SPI mode? and then perhaps what string to type in on the command line?

http://http://www.adafruit.com/datasheets/MAX6675.pdf
Datasheet for you folks.


Thank you much,
--Aaron
2
Bus Pirate Support / Re: General i2C question
Oh very cool,

Ian I assumed it was a little less intelligent then your answer :) I was  thinking it was just because if I scan and I'm at 0xAA then the receiver is always at 1bit higher 0xAB..

Great stuff to read thank you.
--Aaron
3
Bus Pirate Support / Re: General i2C question
Ahh great thank you Ian.

Light bulb went off,

Is the macro mode (1) only sending out
[0x00] - [0xff] then waiting for an ACK, if NACK then skip?
Then since the send address is always 1 bit lower then you can label each of the two "Ack'ed" responses appropriately... right?

Knowing this, is there only 255 I2C device ID's? if that's the case it seems like a limited amount, or can you have 4 byte device IDs?

Hey thanks again,
--Aaron
4
Bus Pirate Support / Re: Bus Pirate syntax usage in arduino | Idea?
I'm new to C++ stuff in general just taking baby steps in the moment... that's the basic jist of it though.
The BP syntax just seems like it would be a good match to quickly mash out code for anyones projects... trying to get opinions and get others thinking about this...  I don't have the skill to create something like it... I'm just full of ...somewhat? interesting ideas.


Thanks,
--Aaron
5
General discussion / Re: DS0 Quad for sale.
I used it for measuring PWM/PPM stuff to verify things were working. I would say its usable and most likely better then the china knockoffs. I know which video you speak of! I watched EEVBlog and MikesElectronicStuff his reviews are quite funny... both of them are pretty good. **Edit, this was NOT the portable Oscope that the EEVBlog guy reviewed.... Would be nice to see him review it though..

It does have a metal back, it has two Oscope Probes + Two Voltage probes and I also bought 4 MMCX to BNC adapters so you can use real probes, I'll take a picture of everything that I'll include with this deal.

Once I get home tonight I'll take some higher resolution photos of the device and post them here. please PM me your address I'll figure how much it is to ship it to you with tracking.

I'll include some probes I got with the newer Oscope... as I can't use them... I don't know how good they are but everyone likes more stuff :)

Let me see how much shipping, if shipping is like $30 or something I'll add on like $20 to the price.
6
Bus Pirate Support / Re: General i2C question
you mention the i2c does not use chip selects, by that do you mean the syntax [ and ] ?

I have an L3GD20 connected up here to the BP
0xd6 is write 0xd7 is read

If I send 0xd6 it respond with nack
if I send [0xd6] it responds with ack

Based off that I would guess you are incorrect? or did I miss something here.

Also you mention a bit indicating data direction in or out, which I'm guessing thats why the read and write addresses are one value apart?

That PDF is quite long and will give me something to read as I fall asleep too!
--Aaron
Thank you :)
7
General discussion / Re: DS0 Quad for sale.
Hi Sjaak,

I have a desktop oscilloscope I bought off ebay a ATTEN ADS1102CAL

It's alright, I didn't feel like spending gangbusters amount of money on one, but this works alright for me.

The button configuration on the quad isn't bad, since its open source someone could fix it, its a little quirky to use, but for what I was using it for was pretty easy, just measuring pwm/ppm stuff nothing major.

I like desktop things rather then portable items.. that's really it though :)

--Aaron
9
Bus Pirate Support / General i2C question
Hi there,

I'm trying to learn the basics of how the BP works with I2c and how I2c works in general, the conciseness seems to be syntax like this
I2C>[0xee 0xF4 0x2E] [0xef r:4]
StartClock WriteChipID Register EndClock StartClock ReadChipID ReadRead EndClock

From what I have gathered what's pretty much static is
PullCS Low | Identify chip "0xEE" | Select the register the data is in "0xF4" and any additional info "0x2E" | PullCS High | PullCS Low again| Select read register "0xE4" | then immediately read 4 bytes of data depending on what the spec sheet says it responds with |


From a "this is how all i2c devices work" is this the norm? or are there any tid bits of information that I'm lacking.

Thanks,
--Aaron
10
General discussion / Re: SPI 4 digit 7 segmet displays
So I have 30 of these things and I doubt I'll use them all.. or any of them at this point.... if anyone is in the US/CA I could sell a bunch to you... but you have to promise me you will make something awesome and show me photos.

I suppose it was a spontaneous buy :)

Ahh Ha! I knew it you can use a shift register! those things keep popping up everywhere..

However I think I kind of like those deal extreme displays better... and I still don't know what I'm going to use them for.....


--Aaron
11
Bus Pirate Support / Bus Pirate syntax usage in arduino | Idea?
Morning/Afternoon


Hi,

Last night I was poking around with my Bus Pirate and a i2c adafruit gyro thingy I had to buy and then It hit me...

I'm looking at sample code for things i2c and C++ and it seems to me ...that the amount of code that goes into writing i2c things from the arduino IDE seems like there might be a somewhat more interesting way to interface it.

Aside from owning a BusPirate "everyone should have one" I don't really know how people debug/attempt to program their arduino and interface an i2c device from scratch, granted there is a lot of sample code out there so I can't imagine anyone really starts with nothing these days when it comes to arduino sketches....

The idea I have is to be able to take the BusPirate i2c syntax and specify that right within the arduino sketch. Is this stupid?
value = [0x7d 0xf4][0x7e r:3]  <--- Wouldn't that be fantastic.

About a month ago the bus pirate syntax didn't make much sense, now after looking at some data sheets with i2c devices I understand what does what, and the syntax is so easy....


What do you guys think?

--Aaron
12
General discussion / Re: SPI 4 digit 7 segmet displays
Hi Mattbarn,

I'm thinking what you could use is a shift register with multiple outputs, then clock the CS line to display1, 2, 3, x with multiple ticks..

It might work? although if the shift register fubared up a tick it might be difficult to recover from it, other then reseting your project.

Maybe these displays suck? :)
13
Bus Pirate Support / BusPirate + BMP085 Baro sensor
Hi there,

I picked up a BMP085 Baro/Temp i2c sensor off Dealextreme two weeks ago and connected it up to the BusPirate the other night and have been poking around with getting it working, the sensor is documented pretty well and there are guides online to interface it with the BP.

Before I get into the technical details, I'm pretty new to spi/i2c and other modes with the BP so if you spot something that's ovbious feel free to comment on it.

The sample code I found was from sparkfun located here
http://http://www.sparkfun.com/tutorial/Barometric/BMP085_Example_Code.pde

I found a guide to use the BP with the same sensor I have located here
http://http://www.maartendamen.com/2011/04/bus-pirate-talking-to-chips-bmp085-used-as-sample/

What I'm trying to do is read the uncompensated temp reading off the sensor and I have succussfully done this, except it's strange why this works.

The example I saw was to read register 0xAC which contained a single byte of data.
I2C>[0xEE 0xAC [0xEF r] this is the same as I2C>[0xEE 0xAC] [0xEF r] This returns 0xFB ... thinking great I typed something in that worked.

0xEE is the device write address, 0xAC is the register that contains the data, 0xEF is the device read address, then r is read a single byte.

Moving on..

Looking at the sample code above "1st link" I scrolled down to the part where it shows sample uncompensated temp

I send the following statement from the BP Interface
I2C>[0xee 0xF4 0x2E [0xef r:4]
It returns
READ: 0x0A  ACK 0x00  ACK 0x61  ACK 0x0A
READ: 0x0A  ACK 0x00  ACK 0x61  ACK 0x0E <-- A few moments later after my finger is on the sensor to warm it up "its working"


so noticing that it looks like the first two bytes are junk.... or are they?????????

I change the syntax to

I2C>[0xee 0xf6 0x2e [0xef r:2] .. I'm incrementing the register two bytes to read "only the portion I need" and only reading two bytes. I am thinking doing this should give me
READ:ACK 0x61  ACK 0x0E
rather then
READ: 0x0A  ACK 0x00  ACK 0x61  ACK 0x0E

This is where it gets weird,

if I type in
I2C>[0xee 0xf6 0x2e [0xef r:2]
it returns
READ: ACK 0x61  ACK 0x0E

Now if I put my finger on the sensor to heat it up or cool it down it *ALWAYS returns back the last sample it made....

WHY does it do this? Am I doing something horribly incorrect?

Thank you,
--Aaron

Honestly these posts are getting so complicated it might be easy to just skype with someone for a couple moments...

Thanks again,
14
General discussion / Re: SPI 4 digit 7 segmet displays
rajabalu

Bit of an update,
I chained them together and able to get the first display to light up! I also get the erronous lit display on the right with another weird one.. I'm guessing its noise?

I'm not an expert at SPI... by far... I'm still wrapping my head around it.. but I would have to think the data out pin would have to different then the data going into data in for the device to fully increment/carry over to the next display.
.. I know that devices have addresses although if these are all the same I don't get how I could have one display carry to the other for an 8 digit display..

On the off chance I was thinking with something like a shift register.. This would make the command [0x02][0x40][0x8F][0xC0,0x3F] turn into something with some clock ticks before to shift up the register send data, shift it again, send some more data to the 2nd display.

Right?

Or am I thinking about this whole shindig incorrectly.

Thanks,
--Aaron
15
General discussion / Re: SPI 4 digit 7 segmet displays
Well I can try chaining them together.

.. I really have NO idea what I'll do with these things at all. I thought they were neat and picked them up off ebay.

I'm pretty new to C++ and things like this are pretty interesting to play around with learning how SPI works, seeing the buspirate syntax while being able to sift though the sample C code is actually handy to see how both function.

I however, need to be able to get the C++ code and the BusPirate syntax from looking at the part documentation.... that's the goal at least.

I still need to find out what I'm going to do with 5x of the 16 char displays from deal extrem.. those are pretty cool as well.. I ordered a I2c or SPI Baro sensor, thought about doing a test with displaying with baro pressue on a display..

the other idea is use the displays stacked 5x16 as somehow a larger display....again no idea just poking around really.

I'm going to try fiddling with these things tonight and let you know if I find anything interesting.

I'm courious on how you display something on the 2nd display while keeping the first one blank if you have them chained together? Since It has the feature of Dout I'm guessing the mfg has somehow included this feature.

--Aaron

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01532448000session_write_close ( )...(null):0
20.01562579600ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01562580376Database_MySQL->query( ).../DatabaseHandler.php:119
40.05952719112Database_MySQL->error( ).../Db-mysql.class.php:273