I've got a set of routines to implement a SPI bus on a
PIC, but can anybody tell me more about this bus system?
I'm also looking for web pages giving infos about it, and/or
FAQ files or any kind of data about it.
What is an SPI bus, how do I find out more about it?
ie: Books, Web pages, etc
Cliff Rogers (Computer Technician) email usa.netcliffrogers
Absolute Computers Pty. Ltd. Cairns, Queensland, Australia.
SPI stands for serial peripheral interface. You can get information from
Motorola 6805, 6811 and many PIC data sheets. Many other devices support SPI
I call upon the mighty piclist once more....
I've just been asked if I can help with a project involving a dual 12 bit
DAC (MAX144) and a dual 12 bit ADC (MAX5156) which are to be part of a
closed loop control system. The system has to have very fast response time
and the sampling speed will need to be in the region of 50k samples/sec.
This means I will need a part with a built in SPI interface. No problem as
we have an emulator for the 16C63 etc.
However, this system is to be controlled via a 68HC12 over an SPI bus.
Hmmm. Now do any parts have 2 SPI interfaces? Because I think that's what
I'm going to need unfortunately. The PIC will (I suspect) be running pretty
well flat out performing it's control functions so a software implementation
is going to be tricky.
On Tue, 20 Apr 1999 10:50:19 +0100, you wrote:
>I call upon the mighty piclist once more....
>I've just been asked if I can help with a project involving a dual 12 bit
>DAC (MAX144) and a dual 12 bit ADC (MAX5156) which are to be part of a
>closed loop control system. The system has to have very fast response time
>and the sampling speed will need to be in the region of 50k samples/sec.
>This means I will need a part with a built in SPI interface. No problem as
>we have an emulator for the 16C63 etc.
>However, this system is to be controlled via a 68HC12 over an SPI bus.
>Hmmm. Now do any parts have 2 SPI interfaces? Because I think that's what
>I'm going to need unfortunately. The PIC will (I suspect) be running pretty
>well flat out performing it's control functions so a software implementation
>is going to be tricky.
You can configure the SCI to synchronous mode, and maybe get
something useable that way. Note that the UART and SSP have the
opposite bit-order, but you could compensate for this at the other end
if using SCI for the comms.
Remember that the SCI has double-buffering on TX and RX, which can
help if the CPU is very busy..
I'd look at running the adc/dacs off a timer int to guarantee the
sample rate, and polling the 68HC11 interface. If you can make the
HC11 send slowy enough you could do it all in software.
You might also look at using the SCI for the ADC/DAC, as it has
independent TX/RX, and the double-buffering could leave more CPU time
for other tasks, but watch out for th bit-order issue.
Mike, you need to provide a chip-select for each device on the SPI bus.
I've found that it's much easier to do the SPI bus in software as many
devices, such as 12-Bit converters, require more overhead with a hardware
At 10:50 AM 4/20/99 +0100, Michael Rigby-Jones wrote:
I have considered doing the SPI in software. However, the SSP module can
transmit and receive at the same time. Hopefully this means I can write 8
bits to the DAC whilst reading 8 bits from the ADC. If this is correct then
with a bit of cunning I can save lots of cycles. Can anyone confirm this or
I still think things are going to be extremely tight as I have to implement
a PID controller in the remaining time. At 20MHz I get a 200ns instruction
cycle. At 50k samples/sec I have a loops time of only 20us which is only
100 instuctions. Not possible IMHO. I have haggled the sampling speed down
to 20k samples/sec which give me quite a bit more time, I still suspect it's
going to be difficult though.
Out of interest does the Hi-Tech C compiler support the Scenix chips, or can
the ASM output be hacked to make it compatible?
AFAIK, the HiTech compiler doesnt support Scenix. (I could be wrong).
Check out http://www.geocities.com/SiliconValley/Station/7733/
This is the home page for AS2SX, a util that will allow you to take the
HiTech PIC-C compiler code and end up with a SX compatible hex file.
>From the doc:
"Magic sequence for powerful SX application:
C_SOURCE -> PIC_C -> AS_SOURCE -> AS2SX -> Nice_CODE_for_SX."
I've not used it, I simply know about it. Let us know how it works :)
At 10:21 AM 4/22/99 +0100, you wrote:
Sr. Systems Engineer
OEM, Carrier Sales, Healthcare
184 Shuman Blvd., Suite 200
Naperville, IL. 60563
Phone: 630-717-2960 x 3072
At 12:32 04/22/99 -0500, Paul Davis wrote:
>AFAIK, the HiTech compiler doesnt support Scenix. (I could be wrong).
>Check out http://www.geocities.com/SiliconValley/Station/7733/
>This is the home page for AS2SX, a util that will allow you to take the
>HiTech PIC-C compiler code and end up with a SX compatible hex file.
>From the doc:
>"Magic sequence for powerful SX application:
>C_SOURCE -> PIC_C -> AS_SOURCE -> AS2SX -> Nice_CODE_for_SX."
i wonder what they do about the code in the libs (which typically doesn't
show up in the created assembler source). you can try to include the
necessary lib routines from the provided sources, though...
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- New search...