Skip to content

Instantly share code, notes, and snippets.

void SendData_4094(uint8_t sel,uint8_t data)
{
#define DAT_4094 1<<4
#define CLK_4094 1<<5
#define ENA_4094 1<<6
#define STB_4094 1<<7
uint8_t LOOP, FLAG;
PORTA &= ~ ( ENA_4094 | STB_4094 ) ; PORTB &= ~ ( CLK_4094 ); PORTA |= ENA_4094;
for (LOOP=0; LOOP<8; LOOP++) { PORTB &= ~ ( CLK_4094 ); FLAG=sel&0x80;
if(FLAG==0){ PORTB &= ~ ( DAT_4094 );}
/* Main.c file generated by New Project wizard
* Author: Julio Alexander Aguilar Angulo.
* [email protected]
* alliselectronics.tumblr.com
* Created: jeu. juil. 23 2015
* Processor: PIC16F648A
* Compiler: MPLAB XC8
*/
#include <xc.h>
@JulioAlexanderAguilarAngulo
JulioAlexanderAguilarAngulo / displays.c
Last active August 29, 2015 14:25
Display Multiplex Driving with microcontroller (PICMicro) using interrupts and some tweaks....
/* Julio Alexander Aguilar Angulo. 25 Juillet 2015
* Created: jeu. juil. 23 2015
* Processor: PIC16F648A - Compiler: MPLAB XC8*/
#include <xc.h>
#include <stdint.h>
#include <pic16f648a.h>
// fuse configuration
#pragma config CP=OFF, CPD=OFF, BOREN=OFF, WDTE=OFF//SWDTEN
#pragma config PWRTE=ON, FOSC=INTOSCIO, MCLRE=OFF
/***
STM32 microcontrollers Course
Author: Julio Alexander Aguilar Angulo
Contents: Useful routines to implement control a MAX7219 spi controller without the use of the spi peripheral
( All is based on loops and masking!!) [it's up to you to do the rest !!! good luck]
***/
// declarations based on the ISEN32 board hardware: portA
#define ckmask 1<<5;
@JulioAlexanderAguilarAngulo
JulioAlexanderAguilarAngulo / sleePic.c
Last active August 29, 2015 14:15
Pic Micro Simple Sleep mode Example
/*
* Author: Julio Alexander Aguilar Angulo ([email protected])
* ISEN - Toulon: http://www.isen.fr/toulon/
* myblog: alliselectronics.tumblr.com
* compilateur: XC8. mcu: 12F1840. Intosc:32KHz
* Design notes:
* In order to achieve the ULP features on cpu-circuit,
* we will use the 32Khz LP internal oscillator to sleep-drive a system
*/
#include <xc.h>
@JulioAlexanderAguilarAngulo
JulioAlexanderAguilarAngulo / button01.c
Last active August 29, 2015 14:11
STM32 Tutorial 001b: Using Buttons
/*************************************** STM32 Tutorial v.2015
Authors: Julio Alexander Aguilar Angulo. [email protected]
Elodie Pauly. [email protected]
(c) ISEN-TOULON. 2015. www.isen.fr/toulon/
*******************************************************************************/
/**** Tuto 001b: Using Buttons **********/
/******************************************************************************/
#include "stm32l1xx.h" // prototypes and intrinsic declarations
/* Testboard: STM32L152 NUCLEO */
@JulioAlexanderAguilarAngulo
JulioAlexanderAguilarAngulo / blink001.C
Created December 12, 2014 15:09
STM32 Tutorial 001a: Blinking a led
/*************************************** STM32 Tutorial v.2015
Authors: Julio Alexander Aguilar Angulo. [email protected]
Elodie Pauly. [email protected]
(c) ISEN-TOULON. 2015. www.isen.fr
*******************************************************************************/
/**** Tuto 01a: Blinking a LED (and using registers and bit masking )**********/
/******************************************************************************/
#include "stm32l1xx.h" // prototypes and intrinsic declarations
/* Testboard: STM32L152 NUCLEO */