I've got two pieces of code - one is a small test program, the other a full product firmware.
The AVR-DOS works great in the test program (writes a .csv file to SD card), but when compiling the firmware code, it gives the following error:
Error 127 Invalid Parameter in Config_MMCSD_HC.BAS.
The line in question is the hardware SPI config:
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = High , Phase = 1 , Clockrate = 4 , Noss = 1
The code used by [u:d44da9d137]both [/u:d44da9d137]of my programs is:
Sub Init_mem_card()
'initialize memory card
$include "Config_MMCSD_HC.BAS"
If Gbdriveerror = 0 Then
$include "Config_AVR-DOS.BAS"
Else
Error_code.9 = True
End If
Temp_byte = Initfilesystem(1)
If Temp_byte <> 0 Then
Error_code.9 = True
End If
End Sub
Sub Save_data()
'save data to mem card
Open File_name For Append As #1 'open file
Write #1 , Date_str , Time_str , Msg 'write data
Flush #1 'commit data to mem card
Close #1 'close file
End Sub
How is it that one compiles and works fine and the other does not !?!?
(MCU is AT90USB1287)
Thank you.
↧