Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Serial Comms in PIC micros

Status
Not open for further replies.

Buriedcode

Full Member level 6
Joined
May 6, 2004
Messages
357
Helped
43
Reputation
86
Reaction score
7
Trophy points
1,298
Location
London
Activity points
8,887
Hi,

I've searched the board but I can't find an answer to this question,. And sorry if its in the wrong forum, but it is 'microcontrollers':

Can the SPI peripheral of a PIC micro send frames of data 'back to back'. By that I mean the PIC is constantly exchanging data, so (assuming the PIC is the master) the SCK runs continuously. Or must the be a 'rest period' between bytes?

The reason I'm asking, is that I wish to send about 3MB/s of manchester encoded data across an RF link. I was using a CPLD, but a PIC micro (or any uC for that matter) is more attractive since it has so many other features, and memory. I'm currently trying to use the USART, running at maximum baud sending back to back packets with manchester encoded bytes (4 data bits = 8 manchester bits), but alas, its just not fast enough.

Obviously doing it all in software (bit banging) is virtually impossible at this speed, but with the peripherals microcontrollers offer, it allows me to just put a byte in a register, and the hardware takes care of sending it. And since SPI is data exchange comms, I could read in data from somewhere else at the same time as sending it.

I won't use the SCK, I just want a way to send bits serially at high speed, and it seems that SPI is my only option.

Thankyou, and as always, any idea's, I'm all ears.

BuriedCode.
 

Hi


The SPI shift register is size limit e.g. 8 bit or 16 bit in some micro there for you have to reload the register from packet to packet


All the best

Bobi
 

Hi Bobcat1, thanks for your reply.

I've yet to do a test, but I think it is possible, and as you quite correctly pointed out, I must reload the SSP buffer as soon as a packet has finished (also, read the buffer, according to Microchip). Which will be tough, especially if I use a 20Mhz osc, with a datarate of 2.5Mb/s, each 'bit' lasts two instruction cycles. I think the SSP peripheral has a buffer, which I can load while sending a packet.

Of course, I would only have to load in a new byte every 16 instructions, but I may have to reload a byte as soon as the SPI has finished sending, again, within 2 instructions.

It would be superb if I could get it working. Having a constant stream of data, in MB/s coming out of the PIC, and at the same time, reading in packets from a separate device (running off the SPI clk). It'll save me a load of board space for a CPLD for serializing/deserializing, no to mention I/O's on the PIC. But considering how 'tight' the code will be, I won't have any time to do any complicated functions, so I might have to try the CPLD option. Then again, thats why 'look-up tables' were invented :D

Anyway, thanks again, if I happen to get hold of an oscilloscope, I confirm/deny the feasibility of this.

BuriedCode.
 

Hi


You can allway switch to faster micro like MSP430 who can work in 8 Mips or even

LPC2138 - ARM7 best who can do 50 Mips

For instance with the LPC2138 you can generate SSP with up to 20Mbit per second

All the best


Bobi
 

    Buriedcode

    Points: 2
    Helpful Answer Positive Rating
bobcat,

Good suggestion! As much as I love PIC's, and their versatility, I pobably should branch out to different micros: AVR, philips etc.. And considering the price of these things, its not going to break to the bank ;)

I'll do some research, into programming, languages, and the 'usefulness' compared to PIC's. It only been about 10 months since I first started with micro's, and I always write in assembly. But, onwards and upwards.

Thanks for you help. Once I get round to it, I'll post some results in the 'hobby electronics' forum.

BuriedCode.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top