CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Produce a 2Mhz square wave
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jul 05, 2014 1:59 pm     Reply with quote

Sounds really 'fuzzy' to me....as most "multi-axis accelerometer chips" have access to registers to configure the device.
I'm 'thinking' this 'device' works as follows...
PIC sends a 'strobe' signal down the 'strobe' line......
DEVICE sends 'data' to PIC up the 'data' line....

Simple and easy to do IF you KNOW the format of the device's communications protocol. It's all in the details, NONE of which we are allowed access to.Sigh..as this is interesting to me.

Presumably once the 'strobe' signal is sent the device sends a stream of data, a series of ones and zeros. Unknown quantity of bits, unknown rate....it could be 'fixed' at a 'baudrate' hence the UART reference, though again we're left 'in the dark'.

Another option is that the PIC sends a series of 'strobe' signals to the device where each 'strobe' tells the device to send back one data bit. So if the datastream has 44 bits the PIC would need to send 44 'strobes'. This way is somewhat harder to do..as WHAT defines the beginning or end of the datastream?

Clear as mud !

I have reversed engineered 'black box' devices in the past, including a nice 22 bit serial protocol that interlaced control and data on ONE wire and ground (long before the Dallas 'one wire' stuff came out, so I am interested in this thread.

Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 05, 2014 2:26 pm     Reply with quote

If you want to waste your time on it, Google for "multi-axis sensor with
data buffer". You will quickly find the QuickLogic Sensor Hub or "Sensor
Fusion" device. Google for that (a little detective work) and you will find
articles in the trade press that say it has a "low power i2c" or SPI interface.

That fits his "strobe" requirement. In a previous post, he says the
maximum clock frequency in his data sheet is given as 2 MHz. That could
easily be the SCL or SCLK maximum for a low power, battery operated,
wearable QuickLogic device. You can spend all afternoon as an amateur
sleuth trying to ferret out his actual chip.
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jul 06, 2014 5:07 am     Reply with quote

hmm.. I'm guessing if he only has 2 pins, it's really the 'low power I2C ' interface..
not exactly a lot of tech details on their website though....
PCMP's I2C scanner would be a start
While I do like a mind challenge, I've officially lost interest in this thread.

jay
gabirelms



Joined: 28 Jun 2014
Posts: 38

View user's profile Send private message

PostPosted: Sun Jul 06, 2014 5:23 am     Reply with quote

I'm sorry, I explained myself very bad. I'm very new to PIC programming and I'm experimenting with things harder than my level. I really appreciate all replies.

To read data from the buffer memory: pulse STROBE input high and then low to move forward. When STROBE input is low, a low on DATA means a 1 bit and a high means a 0 bit.
The buffer memory has a size of 256 bits.
Maximum STROBE frequency: 2Mhz.

That is why I tried to produce a 2Mhz square wave.
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jul 06, 2014 7:00 am     Reply with quote

1) you really should post ANY/all information ( link ?) to how to access the data, the more WE know the better, faster we can help.

2) forget about the 2MHz clock. Since the strobe is the 'timing' signal, simply create a loop for 256. Do a simple bit set, bit clear of the 'strobe' pin and then read the 'data' pin, put result into a buffer. I'd also send the 'data' to a PC terminal program to see the data coming back. This low level approach should work. Once you've got real data THEN speed up the loop to get the data faster.

I am concerned about HOW you 'sync' the datastream though..as well as the format.

hth
jay
gabirelms



Joined: 28 Jun 2014
Posts: 38

View user's profile Send private message

PostPosted: Sun Jul 06, 2014 7:15 am     Reply with quote

Thanks again for your help.
I will try that.

By the way, this is neither USART nor spi, right ?
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jul 06, 2014 9:59 am     Reply with quote

right...

as posted it's a just another form of serial communications with 'sync' .

jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Sun Jul 06, 2014 11:04 am     Reply with quote

Question.

Is there anything at all to start/stop/reset/identify the transmission?.

What you are describing can be done either quite simply in software or using the USART, _except_ for surviving if an extra pulse is seen, or a pulse is lost.
If this happens, _everything_ from this point on, is going to be corrupted. It _will_ happen. So there needs to be some way to recover. Either something in the data to 'mark' the ends of the data (identify), or a way of resetting the counter in the device. This is what the CS line does for SPI, and while it is possible to have SPI devices without this, it requires a device that has some way of handling recovery (I've done ones for instance where if no clock is seen for half a second, the counters are automatically reset).
So, what is there in the format to help in this?.
Without this, you are in problems.....
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

history history history goose-chase
PostPosted: Sun Jul 06, 2014 2:32 pm     Reply with quote

the originator of this post has a history of
previous questions, with interesting similarities,
especially in the non-resolution of vaguely posed,
equally undocumented pleas for help
But there is a similarity in each, evident
in the last post of each thread.
does anybody else see what i do?
http://www.ccsinfo.com/forum/viewtopic.php?p=188438&highlight=#188438
http://www.ccsinfo.com/forum/viewtopic.php?p=188534&highlight=#188534
http://www.ccsinfo.com/forum/viewtopic.php?p=188445&highlight=#188445
http://www.ccsinfo.com/forum/viewtopic.php?p=188422&highlight=#188422

and now this newest evasively undocumented mystery tour.
Sad Surprised Rolling Eyes Rolling Eyes Rolling Eyes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group