ATMega8 SPI Problem

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

so after days of trying to get SPI working on my ATMega8 i capitulate and ask you for help. I've connected a VS1001k trough SPI with my Mega8 like it was done in the yampp7 (www.yampp.com) project. After writing a byte to SPDR register i can wait till i'm 80 for the SPIF Flag.

I've configured MOSI, SS and SCK as Outputs while MISO is an Input.
I've set the SPE and the MSTR Bit in the SPCR register.
I've tryed setting SS as Input or Output, pulled low and pulled high,... but the programm hangs alsways when i'm testing the SPIF bit...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have posted in the wrong forum!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the wrong forum?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello tobias,
it would be helpful if you post your code.

i would assume that the avr ist the spi-master so you should not use the SS as output! use any other output-port as the CS for the VS10001 (see also schematic of yampp7).

btw: already implemented mmc-interface?

greetings
gerhard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not using the SS as CS for the VS1001. And SS should be configured in master mode as output or input pulled up to VCC because otherwise the AVR switches into slave mode.
After trying to rewrite my code the ATMega was not programmable any more. So i had to unsolder the device and solder a new TQFP32 ATMega8 onto my board. Because the PCB's are not high qulity the curcuit got damage while unsoldering with a normal solder-iron and a cigarette lighter. So the project is lying on ice by now. I've got my PCB for a SD-Card Interface this days and i will work on the Interface using an other ATMega8 Board. That's all by now.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Tobias,
if you ever must desolder a chip from the board:
use a lot of soldering tin and put it on and over every pin.
If it's done, put ones more on it until you have 4 Fat nuggets around the Case.
Heat the tin solder up, until it becomes liquid. All 4 sides after an other.
ones a time the Chip will "swimming" in his own (liquid) soldering tin. Now shake the Board... The chip will fly away;-o. uups, do not use this at home, the soldering tin fly also up and away - so be carefull!
But do not use a knife or your soldering iron as lever to lift the chip.
Any mechanical Stress will bring your PCB down. Temperature stress is not so critical, if you do not push or pull or scratch on the surface of the PCB.

So i have save some Boards with 120pin 0.4mm pitch Hitachi-Controller (was 90° wrong).

But , i have ho idea about the SPI Bus, sorry.
CU
AxelR

sorry for poor english, but it should be for all.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo Axel, hättest auch auf Deutsch schreiben können :)