Forum - MCS Electronics
View previous topic :: View next topic
Author
Message
azny Joined: 25 Aug 2008 Posts: 36 Location: usa
Posted: Wed May 02, 2018 5:20 pm Post subject: ATMEGA324PB SPI ERROR
Hello
I am trying to use the SPI on ATMEGA324PB. The chip supports 2 SPI
The Compiler is giving the following error. The error goes away if I comment SPIINIT, SPIIN, SPIOUT keywords
.EQU not found, probably using functions that are not supported by the selected chip [SPDR]
How should I use the SPI of this chip using BASCOM.
Any recommendations please
Code: $regfile = "m324pbdef.dat"
$crystal = 3686400
$hwstack = 80
$swstack = 80
$framesize = 80
Ddra = &B00010110
Ddrb = &B10111011
Ddrc = &B00000000
Ddrd = &B11111010
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 1
Spiinit
(BASCOM-AVR version : 2.0.8.0 , Latest : 2.0.8.1 )
Back to top
albertsm Joined: 09 Apr 2004 Posts: 5913 Location: Holland
Posted: Thu May 03, 2018 9:27 am Post subject:
you need to add a few alias to the DAT file :
Under the [IO] section add these :
[IO]
SPDR = $2E ; alias
SPSR = $2D ; alias
SPCR = $2C ; alias
when in doubt, have a look at the m328pb file. _________________ Mark
Back to top
azny Joined: 25 Aug 2008 Posts: 36 Location: usa
Posted: Thu May 03, 2018 5:06 pm Post subject:
Resolved. Thank you
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum