Hey Seth,
Thanks for the response. I'm shooting for the Xbox 1 controller and my pin layout is tentative on how this may turn out.
Right now here is my recent start on this. RAW but this is where I'm at:
//******************* ****************************************************************
*
* Pin Assignments
* VDD PIN 1 Power
* VSS PIN 8 Ground
* RA5 PIN 2 A Button @ a Later Date //Hope to add function later..
* RA4 PIN 3 LT Button
* RA0 PIN 7 B Button
* RA1 PIN 6 RT Button
* RA2 PIN 5 LED
* RA3 PIN 4 MOD Button **SYNC BUTTON, BUTTON To GND, ETC..
* ***************************************************************
* /
#include <pic12f1822>
#include <stdint.h>
#include <stdlib.h>
#include <xc.h>
#define _XTAL_FREQ 4000000 // Osc Freq for _delay()
/**Configuration**/
// CONFIG1
#include <xc.h>
#pragma config FOSC = INTOSC // Oscillator Selection (INTOSC oscillator: I/O function on CLKIN pin)
#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled)
#pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled)
#pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input)
#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Memory Code Protection (Data memory code protection is disabled)
#pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset disabled)
#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin)
#pragma config IESO = ON // Internal/External Switchover (Internal/External Switchover mode is enabled)
#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled)
// CONFIG2
#pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off)
#pragma config PLLEN = ON // PLL Enable (4x PLL enabled)
#pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset)
#pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.)
#pragma config LVP = OFF // Low-Voltage Programming Enable (Low-voltage programming enabled)
/**MAIN PROGRAM**/
void main(void)
{
//****Initializaion
OSCCONbits.IRCF = 0b1101 //4MHz
OPTION_REGbits.nWPUEN = 0; ///enable weak pull ups (global)
WPUAbits.WPUA3 = 1; //ENABLE ra3 pullup
WPUA = 1<<3; //enable pull up RA3 only
// Configure Ports
LATA = 0;
TRISA = 0b00011110; // Only RA1, RA2 tO start with, RA3, AND RA4 as Input PINS 3,4,5,6
PORTA = 0b00000000; // All Pins Set to low
ANSELA = 0b00001000; // Set RA3 as Digital input
// Led Blink DS
TRISA.bitsTRISA2 = 0;
delay_ms(400)
TRISA.bitsTRISA2 = 1;
//**Main Loop**
for (;
{ //loop forever
;
}