Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Development => Topic started by: ian on August 20, 2010, 08:20:56 am

Title: Firmware v5.8
Post by: ian on August 20, 2010, 08:20:56 am
-Any requested changes and extension to servo and PWM
-unify the two PWM functions
Title: Re: Firmware v5.8
Post by: acknack on August 20, 2010, 09:50:56 am
Any plans for a 16-bit word size SPI sniffer mode?
Title: Re: Firmware v5.8
Post by: ian on August 20, 2010, 09:57:42 am
Sjaak is adding 9+bit I/O in terminal mode (software libraries).

How would it work for the sniffer? What is the difference between a 16bit sniffer and combining 2 8bit bytes from the sniffer?
Title: Re: Firmware v5.8
Post by: acknack on August 20, 2010, 10:12:48 am
My idea was to set MODE16 bit in the SPI Control register when running the sniffer. Will combining 2 8bit bytes give the same result?
Title: Re: Firmware v5.8
Post by: ian on August 20, 2010, 10:18:34 am
Yes. We can do it in hardware, but it just combined two 8 bit bytes (0x90 0x80 becomes 0x9080). It is much simpler (thus faster snooping with more features) if you do it on the host computer instead.

I'm working on an SPI sniffer app right now, hopefully it will be working in a few minutes. It could be modded to spit out 16bit (or any number of bit) words if you like.
Title: Re: Firmware v5.8
Post by: acknack on August 20, 2010, 10:32:10 am
I did not get to work last time i tried. I will need to test again.

Just to be sure that we talk about the same thing. If you look in the data sheet below on page 10 at the bottom  this is how the bus behaves. It is 16 bits per SELECT transaction.
http://www.hoperf.com/upfile/RF01.pdf (http://http://www.hoperf.com/upfile/RF01.pdf)
Title: Re: Firmware v5.8
Post by: ian on August 20, 2010, 10:45:45 am
Timing diagram attached. 16bits is just 2 8bit bytes, it should work. You could try with the most recently updated firmware. It's possible that the bus is too fast and the Bus Pirate can't keep up.
Title: Re: Firmware v5.8
Post by: acknack on August 20, 2010, 11:06:33 am
The bus speed is 32kHz so it should work. I will try it during the weekend. Thanks!
Title: Re: Firmware v5.8
Post by: ian on August 27, 2010, 04:28:35 pm
To do:
SPI polarity macros
LCD - pins HiZ when not used?
ring buffer return error flag on overflow
Title: Re: Firmware v5.8
Post by: rsdio on August 28, 2010, 01:27:46 am
In another topic, we discussed how 16-bit SPI is different from two 8-bit SPI transactions because the Chip Select stays constant throughout the 16-bit word but transitions twice for two 8-bit words.

If you're bit-banging, with Chip Select called via subroutine, then you could implement it as "select, send8, send8, deselect" but if you're using hardware SPI then they're not equivalent.
Title: Re: Firmware v5.8
Post by: ian on August 28, 2010, 09:06:06 am
Quote
16-bit SPI is different from two 8-bit SPI transactions because the Chip Select stays constant throughout the 16-bit word but transitions twice for two 8-bit words

Isn't that only for auto frame sync on high-speed devices where DMA transfers are involved? The Bus Pirate doesn't use/support auto frame sync (yet). The CS line is controlled manually via the [ and ] commands.

8bit SPI write: [0x00]
16bit SPI write: [0x00 0x00]
Title: Re: Firmware v5.8
Post by: rsdio on August 28, 2010, 09:39:43 am
[quote author="ian"]The Bus Pirate doesn't use/support auto frame sync (yet). The CS line is controlled manually via the [ and ] commands.

8bit SPI write: [0x00]
16bit SPI write: [0x00 0x00]
[/quote]OK, that sounds like it should work.  Like I said, if you're bit-banging then you can manually control the select and deselect.  Sorry for the distraction.  I don't use the Bus Pirate, but I do code for several SPI chips on various processors, and it seems like every SPI peripheral has a different flavor.  Some require the frame sync even without DMA, but depending upon how the clock is controlled it might not matter.  Just beware that it could be an issue, and you can see how it goes in the real world.  It might even be necessary to add alternate modes to support chips that are a little different, or at least that fits my experience.
Title: Re: Firmware v5.8
Post by: ian on August 28, 2010, 09:44:36 am
No worries! Thank you so much. I always appreciate another set of eyes on the design. I'll so some investigating of the frame sync in the PIC24 and see if we can do something nifty or useful with it.
Title: Re: Firmware v5.8
Post by: Sjaak on August 28, 2010, 09:16:54 pm
Just checked in r491:

- fixed bug in basic scripting engine ( http://dangerousprototypes.com/forum/in ... opic=906.0 (http://dangerousprototypes.com/forum/index.php?topic=906.0) )
- updated the nightly builds.
Title: Re: Firmware v5.8
Post by: Sjaak on August 29, 2010, 02:23:06 pm
Just checked in r492 into the svn:

- partial read/write are extended to max 16 bit
- only the bits used in partial read/write are displayed
- autoswiching between 8  and 16 bit display
- no need to enter 'NEW' when entering the first program into the scripting engine.
- updated the nighly builts

NB: only raw2wire and raw3wire support partial and 16bit write ATM.

some examples of the altered display:
Code: [Select]
2WIRE> 0xFFFF
WRITE: 0xFF
2WIRE> 0xFFFF;16
WRITE: 0xFFFF
2WIRE> 0xFFFF;12
WRITE: 0x0FFF;12
2WIRE> 0xAA;8
WRITE: 0xAA
2WIRE> 0x5A;4
WRITE: 0x0A;4
Title: Re: Firmware v5.8
Post by: Sjaak on August 29, 2010, 02:39:11 pm
Also updated the wiki to reflect the changes..
Title: Re: Firmware v5.8
Post by: ian on August 30, 2010, 01:57:05 pm
I need to look at adding 9bit writes to the UART mode with your new command. It is a config option, but there is no way to do it :)
Title: Re: Firmware v5.8
Post by: Sjaak on September 12, 2010, 10:40:50 pm
There wasn't much activity here, so I decided to bump this thread a bit ;)

I added 9 bit comms to the UART library. When 9 bits is selected, the numbits is automatically set.

Shall we also add 8bit, mark (1) and 8bit, space (0) as data/parity option?
Title: Re: Firmware v5.8
Post by: ian on September 13, 2010, 08:30:49 am
Fantastic. We should do a release this week, there's some good updates in the SVN.

Is the 8bit mark and space a way of always setting the 9th bit to the same value?
Title: Re: Firmware v5.8
Post by: Sjaak on September 13, 2010, 10:00:27 am
[quote author="ian"]
Is the 8bit mark and space a way of always setting the 9th bit to the same value?
[/quote]

To my understanding it is. We could do the same for 7 bits.
Title: Re: Firmware v5.8
Post by: ian on September 28, 2010, 04:03:24 pm
Hey Sjaak - are your changes documented in the wiki yet?

I added documentation for the new SPI macros and SPI binary flashrom command today. I'll try to add anything you have added too.
Title: Re: Firmware v5.8
Post by: Sjaak on September 28, 2010, 04:15:50 pm
the parial write is documented. Fixing the UART is just a bugfix ;)

I didn't add Mark/Space to parity to the firmware
Title: Re: Firmware v5.8
Post by: ian on September 28, 2010, 09:03:17 pm
Thanks! I'll compile and release this tomorrow.
Title: Re: Firmware v5.8
Post by: ian on September 29, 2010, 12:36:46 pm
Running way late today, but I'm going to compile and release this now.

Here's the changelog I added to the post:

Quote
    *  SPI sniffer updates
    * new fast SPI write/read command for flashrom
    * added SPI settings macros to change phase/polarity/clock edge on the fly
    * added continuous binary ADC sampling for oscilloscope
    * fixed bug in basic scripting engine
    * partial read/write are extended to max 16 bit (currently raw2wire, raw3wire only)
    * only the bits used in partial read/write are displayed
    * auto-switching between 8  and 16 bit display
    * no need to enter 'NEW' when entering the first program into the scripting engine
    * added 9 bit coms to the UART library. When 9 bits is selected, the numbits is automatically set

Title: Re: Firmware v5.8
Post by: engkan2kit on October 12, 2012, 09:59:32 am
Hi,

It's been a while.

Is the MODE16 for SPI in BP accessible in this firmware version already?
Title: Re: Re: Firmware v5.8
Post by: ian on October 12, 2012, 03:13:28 pm
I believe so, though you might want to check the latest firmware for all the updates:
http://dangerousprototypes.com/docs/Bus_Pirate#Download (http://dangerousprototypes.com/docs/Bus_Pirate#Download)

( ! ) 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.01282136976session_write_close ( )...(null):0
20.01312268568ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01312269344Database_MySQL->query( ).../DatabaseHandler.php:119
40.05912408072Database_MySQL->error( ).../Db-mysql.class.php:273