Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mamba_arduino.pde #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions mamba_arduino/mamba_arduino.pde
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
* plm.c Libplm library. Contains all functions used by the library and the
* SPI initialization function for use with the PLM-1.
* serial.c Functions used for serial communication.
*
*For compatibility with newers IDE, some changes was made.
* Changes: Changed the function set_output for the register configuration and commented the declaration
* of pins MISO, MOSI, SCK.
******************************************************************************************/

#include <stdio.h>
Expand All @@ -38,10 +42,11 @@
#include "plm1.h"
#include "serial.h"

/*
#define MOSI B,3
#define MISO B,4
#define SCK B,5

*/

/* Timer 0 Configuration */
#define TIMER0_CLOCK_SRC_HZ ( F_CPU / 1024 ) /* Nb ticks per second = 6144000 / 1024 = 6000 */ //15626
Expand All @@ -66,13 +71,17 @@ main( void )
{



/*
PIN_OUTPUT(MOSI);
PIN_OUTPUT(SCK);
PIN_OUTPUT(nPLM_RESET);
PIN_OUTPUT(PLM_CS);
PIN_INPUT(MISO);
*/

DDRB &= ~_BV(4) | ~_BV(1); //clear these bits
DDRB |= _BV(5)| _BV(3)| _BV(2)| _BV(0); // set these bits

/* SPI communication must be initialized before plm1 library. */
spi_init( SPI_SPEED_F16 );

Expand Down Expand Up @@ -219,4 +228,3 @@ SIGNAL(USART_UDRE_vect)
}