To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 4155
4154  |  4156
Subject: 
SPI problems
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 16 Jul 1998 21:51:10 GMT
Original-From: 
Ilya <ilya@flight.uchicago.edu!stopspam!>
Viewed: 
1115 times
  
I am trying to connect my Handyboard with a Motorola 68HC11A1FN chip
inside with a AD7858L- 12-bit ADC.

In my IC code I first write to the DDRD (Port D Data Direction Register)
($1009) and activate SCK(bit4), MOSI(bit3), MISO(bit2).
Then I write to SPCR (SPI Control Register  and set bits 7(SPIE), 6(SPE),
4(MSTR), 2(CPHA), 1(SPR1).
Following I use serial_putchar() from the serialio.c library to initialize
the ADC... so far so good... no errors reported...
The ADC then is supposed to make a conversion and relay the data back to
the Handyboard via SPI. I use serial_getchar()

v1 =(float)serial_getchar();

and the Handyboard crashes.. at least the heart on the LCD stops beating..
serialio.c is loaded on my handyboard! Was the serialio.c library written
for SPI?!?! If not then I guess I found my problem.. but if it is for SPI,
what am I doing wrong? Are my addresses correct?

Can someone please tellme the right addresses for the following:
DDRD, SPCR SPSR, SPDR.

I have read various Motorola documentations and have not came out with a
distinct answer for my HC11A1FN chip. I have also found contradicting
values for the HC11 family so I am completly lost! The program did not
work when I tried to manually receive/send data through SPI.

Please help!


All of the requests will be kindly appreciated!

Thanks in advance

Ilya



Message has 1 Reply:
  RE: SPI problems
 
Serial libraries are wwriten for Serial port,not for SPI port! Are you needing use the spi like a standard oitput port or like a SPI (synchronus serial port)???? Is the device spi compatiible? If yes, you need the portd to work like a SPI port. if (...) (26 years ago, 19-Jul-98, to lugnet.robotics.handyboard)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR