Hi, I'm continuing Sjaaks work on the demo board v5 firmware, I made this topic so you could add suggestions, and help me out a little :)
Sjaak, could you tell me what's that status last time you looked at it, any bugs you remember, etc...What need to be done for completion..etc..
if you could write a short (hopefully) description of the code..it would help me a lot, thanks
Also, any suggestions on what should be addressed first etc are welcome...
We looked at it together. Filip is testing thought the modes now and writing documentation.
Notes on the board:
*VPU pin missing, makes it hard for BP v3 to give power to the pull ups, since the power v3.3 pin of the io header is busy, thus simple jumpering wont work.
*cap on the PGD/DACOUT pin is interfering with programming, so it must be removed, or a solder jumper added to stop it interfering..
*also the Buffer is giving me problems, but that should work fine...
[quote author="arakis"]Hi, I'm continuing Sjaaks work on the demo board v5 firmware, I made this topic so you could add suggestions, and help me out a little :)
Sjaak, could you tell me what's that status last time you looked at it, any bugs you remember, etc...What need to be done for completion..etc..
if you could write a short (hopefully) description of the code..it would help me a lot, thanks
Also, any suggestions on what should be addressed first etc are welcome...[/quote]
I think i posted somehwhere the current status of the firmware for this somewhere... the i2c part is most complete regarding addressing the peripherals, For the UART part you need to enable the interrupts.
AFAIK the businteractions are working (i2c, spi, uart) it only needs to work out with the peripherals (DAC, ADC, MEM). the hard part is to find a compatibel device to emulate.. All the source is there and broken up into seperate source files.
One thing that is nice to add is some kind or exploration like we did on the easter egg of the buspirate. some kind of adventurre of exploring an i2c or spi bus, this will help the understanding of the different busses (i.e. using pullups on i2c) Would be nice to add an i2c adventure and a spi adventure. Perhaps a blog thing that the first that will achieve the goal willl get a free pcb code (or some other free goodie).
We can give a better prize for first solver but we must remember to remove it from svn :)
Btw good food today Sjaak, what fun!
[quote author="ian"]We can give a better prize for first solver but we must remember to remove it from svn :)
Btw good food today Sjaak, what fun![/quote]
Anytime! Have fun at kwakoe ;)
Ok fixed a few minor bugs...
*5b board jumpers now work as expected..
*I2C ADC now reads analog chanels 3 8 9 trough 0 1 2 commands,,,
so writing ti the write adress 0 and reading the read adress will get you the BP Demo boards analog in chanl0, writing 1 will get ju channl 1 writing 2 will get you chanel 2....any other number will be ignored...this is a fix as oposed to writing the actual ANx number.which was 3 8 and 9...
Now I'm working on the MEM function, but I'll need a little explanation on how this is intended to function..
plz, post commands for writting 10 characters to the mem, and another for reading them...
Since SPI and UART remain to be implemented I need instruction on how to implement PWM/ADC/DAC on each of those....
for example how to read write with SPI to EEPROM, how to SET duty cycle freq for PWM, same for DAC, and ADC....
Also for PWM ove I2c. we have one write one read adress so how to set duty cycle and freqency.
Sounds great, thanks Filip.
For MEM (EEPROM) we want something like like the 24AA and 25AA EEPROMs. You can take liberties though:
http://dangerousprototypes.com/docs/3EE ... I2C_EEPROM (http://dangerousprototypes.com/docs/3EEPROM_explorer_board#24AA_I2C_EEPROM)
There are demos for both there.
Let's focus on the EEPROM mode SPI adn I2C for now. The SPI commands are explained in the tutorial too. You don't have to follow it exactly, just a basic demo. THe simpler the better.
Can we use both addresses to write data? We don't need to give the PWM a read function at all.
guess we could...
for UART the same controll could be implemented as with SPI...since they are both preaty much character by character with no adressing...
The best thing is to emulate the chips exactly so we can borrow the datasheet and the demos on the blog.
Regarding the memory I wouls emulate the 24x02 (i2c) and 25x02 (SPI), We could emulate the /WP with AUX or so
24aa02: http://www.microchip.com/wwwproducts/De ... e=en010774 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010774)
25aa020: http://www.microchip.com/wwwproducts/De ... e=en025534 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en025534)
for adc i found these candidates:
http://www.microchip.com/wwwproducts/De ... e=en533561 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en533561)
http://www.microchip.com/wwwproducts/De ... e=en025692 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en025692)
if there are more bits to emulate sign extend them. Also speed can be an issue but I2C supports clockstretching (although the bpv3 doesn't). There are several adc input (also internal ones) i don't know the best way to select them, perhaps a memory location in eeprom.
ADC here;
http://www.microchip.com/ParamChartSear ... &pageId=79 (http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=11028&mid=10&lang=en&pageId=79)
I'm looking at multi-chanall I2C ADCs form microchip like the MCP3424
we could emulate it,
http://www.microchip.com/wwwproducts/De ... e=en536354 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en536354)
here is how it's configured
When the Master sends an address byte with the R/W bit low (R/W = 0), the device expects one configuration byte following the address. Any byte sent after this second byte will be ignored. The user can change the operating mode of the device by writing the
configuration register bits.
config bit's from 7-0 RDY C1 C0 O/C S1 S0 G1 G0
RDY: Ready Bit
This bit is the data ready flag. In read mode, this bit indicates if the output register has been updated
with a latest conversion result. In One-Shot Conversion mode, writing this bit to “1” initiates a new
conversion.
Reading RDY bit with the read command:
1 = Output register has not been updated
0 = Output register has been updated with the latest conversion result
Writing RDY bit with the write command:
Continuous Conversion mode: No effect
One-Shot Conversion mode:
1 = Initiate a new conversion
0 = No effect
C1-C0: Channel Selection Bits
00 = Select Channel 1 (Default)
01 = Select Channel 2
10 = Select Channel 3
11 = Select Channel 4 //since we have only 3 chanles we could use the 4th to read the temperature, or FVR
O/C: Conversion Mode Bit
1 = Continuous Conversion Mode (Default). The device performs data conversions continuously
0 = One-Shot Conversion Mode. The device performs a single conversion and enters a low power
standby mode until it receives another write or read command
S1-S0: Sample Rate Selection Bit
00 = 240 SPS (12 bits) (Default)
01 = 60 SPS (14 bits)
10 = 15 SPS (16 bits)
11 = 3.75 SPS (18 bits)
G1-G0: PGA Gain Selection Bits (this could be simulated inside software (simply multiply the read values)
00 = x1 (Default)
01 = x2
10 = x4
11 = x8
for PWM emulation we could use some of those 3 channel PWM LED driver with I2C control (to emulate) on is on the AUX pin, the other two are on the two LEDs...
*intro: I'm really new to the Bus Pirate, my first actual project using it's firmware actually...
This project is officially named Murphy's curse.
I spent the whole day yesterday literately, up til 2 in the morning trying to get the i2c slave bulk reads to work...And I didn;t get it.. today when I woke up, I decided to clear the whole function and just look at what the heck is going on...and then I got it..
with a clear function after the interrupt flag the I2C registers 5 interrupts for command [0xa1 rrrr] as it should..but when I add something inside the function 3-4 lines worth, it goes haywire, and registers 3-5 interrupts sporadically, if I add even more, it only registers 3...etc.....This gave the idea that the problem might be that the master isn't respecting the CLK streching that the salve does...and sure enough I looked at the Bus Pirate v3 I had and it doesn't support clock stretching...
In other words I wasted a day and a half on something I should have known from the start, (see * at top). It looks like there is no way to implement bulk reads with the Bus Pirate v3...
So I dusted of my BP v4, dired it up and sure enough everything worked from the go....And I mean everything....
single read, single write, bulk, write, bulk read... Well the bulk read part was making little bugs like skipping a location etc...
so I spent the rest of the day tweeking it to work perfectly. And just at the end of work day, the thing dies, I mean nothing works...
I switch over to the BPv3 and check the function I know worked with it and they still do, but with BPv4 everything died...
Ok so I hook it up to the self test, and sure enough the CLK pin gives a FAIL on the HIZ 1 test...
I look at it with a multimeter, and it's shorted the CLK pin is shorted to gnd, and the BP can;t make it go HiZ....
(this took an hour to check, as my multimeter died, had to resolver a wire)
So I start cleaning the board.....and nothing, so I apply Flux and give it a quick hot air...and clean it, and still nothing....
the dam CLK line is still at GND, even though I theraly check it with a magnifying glass and there just is no GND connection anywhere.......At this point I'm thinking the BPv4 PIC died on that pin...so I hot air remove it...clean the pads, etc...and re-solder it (this took 2h as my hot air died, had to open it up and fix some wiring) ..
I connect it to usb it starts up, but soon dies again, I connect it to MPLAB and check with a Programmer, and its givving the wrong deice ID 00000....so after some more cleaning, fluxing, re soldering, hotairing, cleaning, fluxing re-soldering etc.....it finally start to work, with the CLK pin fixed as welll....(did I mention my micro b cable died in the middle of this, and I had to run to the shops to get another one)......
I other words this board has had everything fail that could have failed, by definition it's Murphy's board....
scrach that, just looked at it again and the CLK is still connected to ground, ~170ohms resistance between GND and CLK pin....this is exacly how it acted before I took it apard, It worked for a while and now it's broken again...
I've had it....I moving on to whatever I can get to work witht he bpV3..and I'll return to this when/if I fix my BPv4 or replace it...
You can enable i2c hardware support on bp (code should br there) or move to a lower bitrate. Also run the bpdemo at a higher clock.
[quote author="Sjaak"]You can enable i2c hardware support on bp (code should br there) or move to a lower bitrate. Also run the bpdemo at a higher clock.[/quote]
Thanks, increasing the clk rate helped it working with the BPv3
so far I got the I2C to work with all devices, so PWM works :)
One question about SPI, what setting do you use with the Bus Pirate, I can easily send data to it, butt reading from it dosen't seem to happen...
I'm using your default code, just to see the communication....
BP SPI settings and a BP SPI read example would be much apreatited, if you got it to send you back a byte...
thanks..
for I2C PWM,
adress is 0x30
0 is period, 1 is duty
so [0x30 0 25 33] sets the period (PR2 to 25, and the duty cycle to 33%)
[0x30 0 99] changes the period to 99.
[0x30 1 72] changes the duty cycle to 72%
reading is the same as eeeprom reads...two consecutive reads when the adres is seto to 0 will return the period and duty cycle
Congrats on the working I2C Fil
I found the old topic about the demoboard (and firmware). I think it is an interesting read about the thoughts (and weird behauviour) we had. it is here: viewtopic.php?f=64&t=3083&hilit=demoboard (http://dangerousprototypes.com/forum/viewtopic.php?f=64&t=3083&hilit=demoboard)
It also describes the spi behaviour you asked. it uses the standard settings of the bp.
One thing i recall is to enable interrupts for UART reception.
thanks, but I got it under control, the TRIS bit for the MISO pin was set insted of cleard :)
Whoo hoo Demo Board Firware complete :)
All devices, and all protocols functional...
UART speed 9600...
controll through macro (1)....
DAC/and PWM peripherals can be controlled through UART, but can't be rad by the BP since, in macro (1) you can't send commands like d (read ADC) or f (read freq, etc)...
Only clean-up and documentation is left....
Ok tested it out with a programed release...
here are the terminals from varius tests, SPI EEPRMOm, and ADC still need some work...
I2c-----------------
I2C/ADC
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
9. DIO
x. exit(without change)
(1)>4
Set speed:
1. ~5KHz
2. ~50KHz
3. ~100KHz
4. ~400KHz
(1)>3
Ready
I2C>W
Power supplies ON
I2C>P
Pull-up resistors ON
I2C>(1)
Searching I2C address space. Found devices at:
0x10(0x08 W) 0x11(0x08 R)
I2C>[0x10 0]
I2C START BIT
WRITE: 0x10 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C>[0x11 r]
I2C START BIT
WRITE: 0x11 ACK
READ: 0xFF
NACK
I2C STOP BIT
I2C>[0x10 1]
I2C START BIT
WRITE: 0x10 ACK
WRITE: 0x01 ACK
I2C STOP BIT
I2C>[0x11 r]
I2C START BIT
WRITE: 0x11 ACK
READ: 0xAC
NACK
I2C STOP BIT
I2C>[0x10 2]
I2C START BIT
WRITE: 0x10 ACK
WRITE: 0x02 ACK
I2C STOP BIT
I2C>[0x11 r]
I2C START BIT
WRITE: 0x11 ACK
READ: 0x56
NACK
I2C STOP BIT
I2C>[0x10 3]
I2C START BIT
WRITE: 0x10 ACK
WRITE: 0x03 ACK
I2C STOP BIT
I2C>[0x11 r]
I2C START BIT
WRITE: 0x11 ACK
READ: 0xFF
NACK
I2C/DAC
I2C>w
Power supplies OFF
I2C>W
Power supplies ON
I2C>(1)
Searching I2C address space. Found devices at:
0x20(0x10 W) 0x21(0x10 R)
I2C>d
VOLTAGE PROBE: 0.00V
I2C>d
VOLTAGE PROBE: 0.00V
I2C>[0x20 128]
I2C START BIT
WRITE: 0x20 ACK
WRITE: 0x80 ACK
I2C STOP BIT
I2C>d
VOLTAGE PROBE: 1.63V
I2C>d
VOLTAGE PROBE: 1.63V
I2C>[0x20 200]
I2C START BIT
WRITE: 0x20 ACK
WRITE: 0xC8 ACK
I2C STOP BIT
I2C>d
VOLTAGE PROBE: 2.56V
I2C>d
VOLTAGE PROBE: 2.56V
I2C>[0x20 255]
I2C START BIT
WRITE: 0x20 ACK
WRITE: 0xFF ACK
I2C STOP BIT
I2C>d
VOLTAGE PROBE: 3.17V
I2C>[0x20 0]
I2C START BIT
WRITE: 0x20 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C>d
VOLTAGE PROBE: 0.00V
I2C/EEPROM
I2C>w
Power supplies OFF
I2C>W
Power supplies ON
I2C>(1)
Searching I2C address space. Found devices at:
0xA0(0x50 W) 0xA1(0x50 R)
I2C>[0xA0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14]
I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0x00 ACK
WRITE: 0x01 ACK
WRITE: 0x02 ACK
WRITE: 0x03 ACK
WRITE: 0x04 ACK
WRITE: 0x05 ACK
WRITE: 0x06 ACK
WRITE: 0x07 ACK
WRITE: 0x08 ACK
WRITE: 0x09 ACK
WRITE: 0x0A ACK
WRITE: 0x0B ACK
WRITE: 0x0C ACK
WRITE: 0x0D ACK
WRITE: 0x0E ACK
I2C STOP BIT
> 0 a ]
I2C>]
I2C STOP BIT
I2C>[0xa0 0]
I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C>[0xa1 r]
I2C START BIT
WRITE: 0xA1 ACK
READ: 0x01
NACK
I2C STOP BIT
I2C>[0xa1 rrr]
I2C START BIT
WRITE: 0xA1 ACK
READ: 0x02
READ: ACK 0x03
READ: ACK 0x04
NACK
I2C STOP BIT
I2C>[0xa1 r:10]
I2C START BIT
WRITE: 0xA1 ACK
READ: 0x05 ACK 0x06 ACK 0x07 ACK 0x08 ACK 0x09 ACK 0x0A ACK 0x0B ACK 0x0C ACK 0x0D ACK 0x0E
NACK
I2C STOP BIT
I2C/PWM
I2C>w
Power supplies OFF
I2C>W
Power supplies ON
I2C>f
AUX Frequency: 2,668,544 Hz
I2C>(1)
Searching I2C address space. Found devices at:
0x30(0x18 W) 0x31(0x18 R)
I2C>f
AUX Frequency: 2,668,544 Hz
I2C>[0x30 0 25]
I2C START BIT
WRITE: 0x30 ACK
WRITE: 0x00 ACK
WRITE: 0x19 ACK
I2C STOP BIT
I2C>f
AUX Frequency: 307,968 Hz
I2C>[0x30 0 255]
I2C START BIT
WRITE: 0x30 ACK
WRITE: 0x00 ACK
WRITE: 0xFF ACK
I2C STOP BIT
I2C>f
AUX Frequency: autorange 31,293 Hz
I2C>[0x30 0]
I2C START BIT
WRITE: 0x30 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C>[0x31 rr]
I2C START BIT
WRITE: 0x31 ACK
READ: 0xFF
READ: ACK 0x32
NACK
I2C STOP BIT
I2C>[0x30 0 50]
I2C START BIT
WRITE: 0x30 ACK
WRITE: 0x00 ACK
WRITE: 0x32 ACK
I2C STOP BIT
I2C>[0x31 rr]
I2C START BIT
WRITE: 0x31 ACK
READ: 0x32
READ: ACK 0x32
NACK
I2C STOP BIT
SPI--------------------------------
SPI/DAC
SPI>[16 15]
/CS ENABLED
WRITE: 0x10
WRITE: 0x0F
/CS DISABLED
SPI>d
VOLTAGE PROBE: 1.52V
SPI>[16 10]
/CS ENABLED
WRITE: 0x10
WRITE: 0x0A
/CS DISABLED
SPI>d
VOLTAGE PROBE: 1.01V
SPI>d
VOLTAGE PROBE: 1.01V
SPI>[16 ] ]1
/CS ENABLED
WRITE: 0x10
WRITE: 0x00
/CS DISABLED
Syntax error at char 7
SPI>d
VOLTAGE PROBE: 0.00V
SPI>[16 31]
/CS ENABLED
WRITE: 0x10
WRITE: 0x1F
/CS DISABLED
SPI>d
VOLTAGE PROBE: 3.17V
SPI/PWM
SPI>f
AUX Frequency: 2,669,568 Hz
SPI>[0 4]
/CS ENABLED
WRITE: 0x00
WRITE: 0x04
/CS DISABLED
SPI>f
AUX Frequency: 1,601,792 Hz
SPI>[0 8]
/CS ENABLED
WRITE: 0x00
WRITE: 0x08
/CS DISABLED
SPI>f
AUX Frequency: 889,856 Hz
SPI>[0 255]
/CS ENABLED
WRITE: 0x00
WRITE: 0xFF
/CS DISABLED
SPI>f
AUX Frequency: autorange 31,284 Hz
SPI>[1 25]
/CS ENABLED
WRITE: 0x01
WRITE: 0x19
/CS DISABLED
SPI>f
AUX Frequency: autorange 31,291 Hz
SPI>[1 25 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x19
READ: 0x19
/CS DISABLED
UART is menu based, the BP talks to the demo board and yo chose trough the options...
setup the terminal to transmit CR for EoL, and recive LF as EOL
UART BP setup and entering menu
UART setup (receve LF) (transmit CR)
--------------------
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
9. DIO
x. exit(without change)
(1)>3
Set serial port speed: (bps)
1. 300
2. 1200
3. 2400
4. 4800
5. 9600
6. 19200
7. 38400
8. 57600
9. 115200
10. BRG raw value
(1)>5
Data bits and parity:
1. 8, NONE *default
2. 8, EVEN
3. 8, ODD
4. 9, NONE
(1)>1
Stop bits:
1. 1 *default
2. 2
(1)>1
Receive polarity:
1. Idle 1 *default
2. Idle 0
(1)>1
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)
(1)>2
Ready
UART>W
Power supplies ON
UART>(1)
UART bridge
Reset to exit
Are you sure? y
mm
Bus Pirate Demo Board v5
FW verison v0.95
Main Menu
-------------
1)ADC
2)PWM
3)DAC
4)EEPROM
Choose(1-4):
*I'll post links to datasheets and the SPI eeprom/ADC fixed code shortly....
Nice job, thanks Filip. I'llprepare this for production next week.
SPI/EEPROM
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
9. DIO
x. exit(without change)
(1)>5
Set speed:
1. 30KHz
2. 125KHz
3. 250KHz
4. 1MHz
(1)>3
Clock polarity:
1. Idle low *default
2. Idle high
(1)>1
Output clock edge:
1. Idle to active
2. Active to idle *default
(2)>2
Input sample phase:
1. Middle *default
2. End
(1)>1
CS:
1. CS
2. /CS *default
(2)>2
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)
(1)>2
Ready
SPI>W
Power supplies ON
SPI>[6]
/CS ENABLED
WRITE: 0x06
/CS DISABLED
SPI>[2 50 1 2 3 4 5 6 7 8 9 10 11 12]
/CS ENABLED
WRITE: 0x02
WRITE: 0x32
WRITE: 0x01
WRITE: 0x02
WRITE: 0x03
WRITE: 0x04
WRITE: 0x05
WRITE: 0x06
WRITE: 0x07
WRITE: 0x08
WRITE: 0x09
WRITE: 0x0A
WRITE: 0x0B
WRITE: 0x0C
/CS DISABLED
SPI>[4]
/CS ENABLED
WRITE: 0x04
/CS DISABLED
SPI>[3 50 r
/CS ENABLED
WRITE: 0x03
WRITE: 0x32
READ: 0x01
SPI>r
READ: 0x02
SPI>r
READ: 0x03
SPI>r
READ: 0x04
SPI>rr
READ: 0x05
READ: 0x06
SPI>rrr
READ: 0x07
READ: 0x08
READ: 0x09
SPI>]
/CS DISABLED
SPI/ADC..
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
9. DIO
x. exit(without change)
(1)>5
Set speed:
1. 30KHz
2. 125KHz
3. 250KHz
4. 1MHz
(1)>2
Clock polarity:
1. Idle low *default
2. Idle high
(1)>1
Output clock edge:
1. Idle to active
2. Active to idle *default
(2)>2
Input sample phase:
1. Middle *default
2. End
(1)>1
CS:
1. CS
2. /CS *default
(2)>2
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)
(1)>2
Ready
SPI>W
Power supplies ON
SPI>[1 0 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x00
READ: 0xFF
/CS DISABLED
SPI>[1 16 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x10
READ: 0xAC
/CS DISABLED
SPI>[1 32 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x20
READ: 0x56
/CS DISABLED
SPI>[1 48 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x30
READ: 0xFF
/CS DISABLED
SPI>[1 48 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x30
READ: 0xCC
/CS DISABLED
SPI>[1 48 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x30
READ: 0xB6
/CS DISABLED
SPI>[1 48 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x30
READ: 0xB4
/CS DISABLED
SPI>[1 48 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x30
READ: 0xB4
/CS DISABLED
SPI>[1 48 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x30
READ: 0xC6
/CS DISABLED
SPI>[1 48 r]
/CS ENABLED
WRITE: 0x01
WRITE: 0x30
READ: 0xBA
/CS DISABLED
Datasheets
I2C ADC.
MCP3428 4chanell ADC
http://www.microchip.com/wwwproducts/De ... e=en545865 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en545865)
general call still unimplemented...
I2C DAC
CP47DA1
http://www.microchip.com/wwwproducts/De ... e=en557693 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en557693)
I2C PWM device we haven't chosen, a single PWM signal generator I2C doesn't exist, I haven't fount it yet..
I2C EEPROM
modeled after 24LC/AA02
http://ww1.microchip.com/downloads/en/D ... 21709J.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/21709J.pdf)
SPI EEPROM modeled after 25AA020A
http://www.microchip.com/wwwproducts/De ... e=en025534 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en025534)
http://ww1.microchip.com/downloads/en/D ... 21833F.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/21833F.pdf)
SPI DAC modeled after MCP4801 http://www.microchip.com/wwwproducts/De ... e=en547815 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en547815)
http://ww1.microchip.com/downloads/en/d ... 22244b.pdf (http://ww1.microchip.com/downloads/en/devicedoc/22244b.pdf)
SPI ADC modeled after...MCP3004 4 chanel 10 bit ADC...
http://www.microchip.com/wwwproducts/De ... e=en010529 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010529)
http://ww1.microchip.com/downloads/en/D ... 21295C.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/21295C.pdf)
ALL have their chanels as folwos C0=ADC pin, C1=2/3 ADC pin, C2 = 1/3ADC pin...C3 = temp sensor
UART is used as a non emulated device, you control the demo board from it trough ASCII UART menu, which the Demo Board Provides, here we could also incude a bootleader through the BP...
*watch out the I2C ADC and DAC were changed from what I posted above, for the DAC you need to send one more 0 before sending the value this time 0-61----
so [addr 0 DACV] will work...
reading the same as before...
ADC works a lot differently
starting the ADC [addr 0x70]
reading is
[addr+1 r r r] or [addr+1 rrr] or [addr+1 r:3]
first byte is the HIGH part of the 10 pit conversion
second byte is the LOW
third id the config...whoses MSB tells you if the conversion has complited since last time you read it...if MSB off config is 0 then conversion was done, if 1 it is pending...
I am also commiting this to the SVN
Congrats arakis! Looking supercool
[quote author="Sjaak"]Congrats arakis! Looking supercool[/quote]
Thanks, it wouldn't have been posible so quickly, without your groundwork
Thanks Filip, this is perfect!
Moved to public forum