mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-13 08:25:05 +01:00
Update SMS.ino
This commit is contained in:
parent
4a2d3d81dc
commit
026e774b43
@ -86,7 +86,7 @@ void setup_SMS() {
|
|||||||
Low level functions
|
Low level functions
|
||||||
*****************************************/
|
*****************************************/
|
||||||
void writeByte_SMS(word myAddress, byte myData) {
|
void writeByte_SMS(word myAddress, byte myData) {
|
||||||
// Set Data Pins (D0-D15) to Output
|
// Set Data Pins (D0-D7) to Output
|
||||||
DDRC = 0xFF;
|
DDRC = 0xFF;
|
||||||
|
|
||||||
// Set address
|
// Set address
|
||||||
@ -100,7 +100,7 @@ void writeByte_SMS(word myAddress, byte myData) {
|
|||||||
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
||||||
|
|
||||||
// Switch CE(PL1) and WR(PH5) to LOW
|
// Switch CE(PL1) and WR(PH5) to LOW
|
||||||
PORTL &= ~(1 << 1) ;
|
PORTL &= ~(1 << 1);
|
||||||
PORTH &= ~(1 << 5);
|
PORTH &= ~(1 << 5);
|
||||||
|
|
||||||
// Leave WE low for at least 60ns
|
// Leave WE low for at least 60ns
|
||||||
@ -113,12 +113,12 @@ void writeByte_SMS(word myAddress, byte myData) {
|
|||||||
// Leave WE high for at least 50ns
|
// Leave WE high for at least 50ns
|
||||||
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
||||||
|
|
||||||
// Set Data Pins (D0-D15) to Input
|
// Set Data Pins (D0-D7) to Input
|
||||||
DDRC = 0x00;
|
DDRC = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte readByte_SMS(word myAddress) {
|
byte readByte_SMS(word myAddress) {
|
||||||
// Set Data Pins (D0-D15) to Input
|
// Set Data Pins (D0-D7) to Input
|
||||||
DDRC = 0x00;
|
DDRC = 0x00;
|
||||||
|
|
||||||
// Set Address
|
// Set Address
|
||||||
|
Loading…
Reference in New Issue
Block a user