PDA

View Full Version : SPI configuration PIC versus Atmel



Pedro Santos
- 10th July 2007, 12:03
Hello
For a Atmel controller is this the configuration for the SPI to communicate to a lcd and it works very good.

Using the buildt-in hardware-SPI interface of the ATMega, which is defined here:
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 1
Spiinit '''Initializing of the SPI interface
Set Spsr.spi2x '''double the spi output speed

But i'm a PIC controller and PBP Pro Fan and want to continue use it, but how can i configure the 18F452 or 18F4520 to use the hardware SPI like this Atmel
SPI configuration, the experience that i have maked with the 18F452 was all unsucessful.

Please help me

Kind regards

Pedro

skimask
- 10th July 2007, 16:28
Hello
For a Atmel controller is this the configuration for the SPI to communicate to a lcd and it works very good.
Pedro

You sure the LCD uses SPI and not just a plain ol' serial interface?

dhouston
- 10th July 2007, 19:17
There are examples for SPI master & slave on the ME Labs web site.http://www.melabs.com/resources/samples/pbp/spimast.bas
http://www.melabs.com/resources/samples/pbp/spislave.bas