
StrangerM
-
Content Count
57 -
Joined
-
Last visited
-
Days Won
5
Reputation Activity
-
StrangerM got a reaction from Fmilburn in Using Harware QEI on Tiva Launchpad
I have played with QEI. I have two quadrature encoders with index. But where they are? FR4133 was close . And I have made the simple emulator of encoder with index.
I have connected FR4133 with Tiva. P1.3->PD3+PE1 (INDEX&Interrupt) ; P1.4->PD7 (PhB) ; P1.5->PD6 (PhA)
The code from here and from http://forum.43oh.com/topic/8875-problems-using-qei-with-ek-tm4c123gxl/ was used for Tiva program.
#include <stdint.h> #include <stdbool.h> #include "inc/hw_gpio.h" #include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #define PART_TM4C123GH6PM #include "driverlib/pin_map.h" #include "driverlib/qei.h" #include "driverlib/sysctl.h" #define I PE_1 volatile uint32_t pos1; volatile uint32_t pos_index ; volatile uint32_t vel; volatile int32_t dir; void config_QEI() { SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); //Unlock GPIOD7 // HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY; // HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= 0x80; // HWREG(GPIO_PORTD_BASE + GPIO_O_AFSEL) &= ~0x80; // HWREG(GPIO_PORTD_BASE + GPIO_O_DEN) |= 0x80; // HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0; // Enable QEI Peripherals SysCtlPeripheralEnable(SYSCTL_PERIPH_QEI0); //Set Pins to be PHA0 and PHB0 GPIOPinConfigure(GPIO_PD6_PHA0); //GPIOPinConfigure(0x00031806); //0x00031806 =>GPIO_PD6_PHA0 GPIOPinConfigure(GPIO_PD7_PHB0); //GPIOPinConfigure(0x00031C06); // 0x00031C06 => GPIO_PD7_PHB0 GPIOPinConfigure(GPIO_PD3_IDX0); // // GPIO_PD3_IDX0 //Set GPIO pins for QEI GPIOPinTypeQEI(GPIO_PORTD_BASE, (GPIO_PIN_3 |GPIO_PIN_6 | GPIO_PIN_7 )); // GPIOPinTypeQEI(GPIO_PORTD_BASE, (GPIO_PIN_6 | GPIO_PIN_7 )); //HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_M; // Configure quadrature encoder, use an arbitrary top limit of 1000-1 and enable QEI QEIConfigure(QEI0_BASE,(QEI_CONFIG_CAPTURE_A_B | QEI_CONFIG_RESET_IDX | QEI_CONFIG_QUADRATURE | QEI_CONFIG_NO_SWAP), 999); QEIEnable(QEI0_BASE); //Set position to a middle value QEIPositionSet(QEI0_BASE,500); //Configure and enable velocity QEIVelocityConfigure(QEI0_BASE, QEI_VELDIV_1, SysCtlClockGet()/2); // Divide by clock speed to get counts/sec QEIVelocityEnable(QEI0_BASE); } void setup() { config_QEI(); pinMode(I, INPUT); Serial.begin(9600); Serial.println("Start:"); Serial.println("--------"); attachInterrupt(I, blink, RISING ); } void loop() { // detachInterrupt(I) ; Serial.print("pos_index="); Serial.println(pos_index); Serial.print("pos1="); Serial.println(pos1); Serial.print("vel=");Serial.println(vel); Serial.print("dir=");Serial.println(dir); Serial.println("--------"); delay(1000); } void blink() { vel = QEIVelocityGet(QEI0_BASE); dir = QEIDirectionGet(QEI0_BASE); pos_index = QEIPositionGet(QEI0_BASE); delayMicroseconds(400); pos1 =QEIPositionGet(QEI0_BASE); } This is the code of emulator
#include <msp430.h> #include "LCD_Launchpad.h" #define M P2_6 #define M1 P1_2 #define IDX P1_3 #define PA P1_4 #define PB P1_5 int t=500 ; int n=0 ; LCD_LAUNCHPAD myLCD ; void setup() { // put your setup code here, to run once: myLCD.init(); pinMode(M, INPUT_PULLUP); pinMode(M1, INPUT_PULLUP); pinMode(IDX, OUTPUT); pinMode(PA, OUTPUT); pinMode(PB, OUTPUT); digitalWrite(PA, LOW); digitalWrite(PB, LOW); digitalWrite(IDX, LOW); Serial.begin(9600) ; myLCD.clear(); Serial.println(100); } void loop() { // put your main code here, to run repeatedly: n=n+1 ; digitalWrite(PB, HIGH) ; delayMicroseconds(t); if(n==1) {digitalWrite(IDX, LOW); } digitalWrite(PA, HIGH); delayMicroseconds(t); digitalWrite(PB, LOW); delayMicroseconds(t); digitalWrite(PA, LOW); delayMicroseconds(t); digitalWrite(PB, LOW); if(n==1000) {n=0 ; digitalWrite(IDX, HIGH); } } This is result
pos_index=999
pos1=4
vel=6282
dir=1
--------
pos_index=999
pos1=4
vel=6282
dir=1
--------
pos_index=999
pos1=4
vel=6282
dir=1
--------......
This is useful system for studying QIE and QIE API
-
StrangerM got a reaction from energia in FR6989 - internal RTS & Temperature sensor
In low-power mode. CPU is stopped & runs only in interrupt subroutine.
FR6989 - RTC & Temperature sensor by RTC interrupt 1 per sec
#include "LCD_Launchpad.h" int n ; int s ; int m ; int h ; int d ; int M ; int y ; LCD_LAUNCHPAD myLCD ; void setup() { pinMode(P1_0, OUTPUT); digitalWrite(P1_0,LOW) ; Serial.begin(9600) ; myLCD.init(); WDTCTL = WDTPW | WDTHOLD; // Stop Watchdog Timer PJSEL0 = BIT4 | BIT5; // Initialize LFXT pins // Configure LFXT 32kHz crystal CSCTL0_H = CSKEY >> 8; // Unlock CS registers CSCTL4 &= ~LFXTOFF; // Enable LFXT do { CSCTL5 &= ~LFXTOFFG; // Clear LFXT fault flag SFRIFG1 &= ~OFIFG; } while (SFRIFG1 & OFIFG); // Test oscillator fault flag CSCTL0_H = 0; // Lock CS registers // Configure RTC_C RTCCTL0_H = RTCKEY_H; // Unlock RTC // RTCCTL0_L = RTCTEVIE | RTCRDYIE; // enable RTC read ready interrupt // enable RTC time event interrupt RTCCTL1 = RTCBCD | RTCHOLD | RTCMODE; // RTC enable, BCD mode, RTC hold /* RTCYEAR = 0x2017; // Year = 0x2017 RTCMON = 0x2; // Month = 0x02 = Feb RTCDAY = 0x18; // Day = 0x18 = 18 RTCDOW = 0x07; // Day of week = 0x07 = Sun RTCHOUR = 0x21; // Hour = 0x21 RTCMIN = 0x46; // Minute = 0x46 RTCSEC = 0x45; // Seconds = 0x45 RTCADOWDAY = 0x2; // RTC Day of week alarm = 0x2 RTCADAY = 0x20; // RTC Day Alarm = 0x20 RTCAHOUR = 0x10; // RTC Hour Alarm RTCAMIN = 0x23; //*/ RTCCTL1 &= ~(RTCHOLD); // Start RTC RTCCTL0_L = RTCRDYIE; // enable RTC read ready interrupt // enable RTC time event interrupt __bis_SR_register(LPM3_bits | GIE); // Enter LPM3 mode w/ interrupts } void loop() { // Serial.print(14); // Serial.println(100); /* if(RTCSEC!=n){ Serial.print(RTCSEC, HEX); Serial.print(":"); Serial.print(RTCMIN, HEX); Serial.print(":"); Serial.print(RTCHOUR, HEX); Serial.print(":"); Serial.print(RTCDAY, HEX); Serial.print(":"); Serial.print(RTCMON, HEX); Serial.print(":"); Serial.println(RTCYEAR, HEX); n=RTCSEC ; //if(n==59){n=-2;} //RTCCTL0_L = RTCTEVIE | RTCRDYIE; // enable RTC read ready interrupt // enable RTC time event interrupt // __bis_SR_register(LPM3_bits | GIE); // Enter LPM3 mode w/ interrupts */ } } #pragma vector=RTC_VECTOR __interrupt void RTC_ISR(void) { // __bic_SR_register_on_exit(LPM3_bits); // Exit active CPU // Serial.println(116); s=RTCSEC ; m=RTCMIN ; h=RTCHOUR ; d=RTCDAY ; M=RTCMON ; y=RTCYEAR ; myLCD.clear(); myLCD.print(h,HEX); myLCD.print(m,HEX);myLCD.println(s,HEX); RTCCTL0_L = RTCRDYIE; __bis_SR_register(LPM3_bits | GIE); } #include "LCD_Launchpad.h" #define CALADC12_12V_30C *((unsigned int *)0x1A1A) // Temperature Sensor Calibration-30 C //See device datasheet for TLV table memory mapping #define CALADC12_12V_85C *((unsigned int *)0x1A1C) // Temperature Sensor Calibration-85 C unsigned int temp; volatile float temperatureDegC; volatile float temperatureDegF; int n ; int s ; int m ; int h ; int d ; int M ; int y ; LCD_LAUNCHPAD myLCD ; void setup() { // pinMode(P1_0, OUTPUT); // digitalWrite(P1_0,LOW) ; // Serial.begin(9600) ; myLCD.init(); WDTCTL = WDTPW | WDTHOLD; // Stop Watchdog Timer //////////////////////////////// REFCTL0 |= REFVSEL_0 + REFON; // Enable internal 1.2V reference analogReference(INTERNAL1V2) ; /* Initialize ADC12_A */ ADC12CTL0 &= ~ADC12ENC; // Disable ADC12 ADC12CTL0 = ADC12SHT0_8 + ADC12ON; // Set sample time ADC12CTL1 = ADC12SHP; // Enable sample timer ADC12CTL3 = ADC12TCMAP; // Enable internal temperature sensor ADC12MCTL0 = ADC12VRSEL_1 + ADC12INCH_30; // ADC input ch A30 => temp sense ADC12IER0 = 0x001; // ADC_IFG upon conv result-ADCMEMO // while(!(REFCTL0 & REFGENRDY)); // Wait for reference generator // to settle ADC12CTL0 |= ADC12ENC; /////////////////////////////// PJSEL0 = BIT4 | BIT5; // Initialize LFXT pins // Configure LFXT 32kHz crystal CSCTL0_H = CSKEY >> 8; // Unlock CS registers CSCTL4 &= ~LFXTOFF; // Enable LFXT do { CSCTL5 &= ~LFXTOFFG; // Clear LFXT fault flag SFRIFG1 &= ~OFIFG; } while (SFRIFG1 & OFIFG); // Test oscillator fault flag CSCTL0_H = 0; // Lock CS registers // Configure RTC_C RTCCTL0_H = RTCKEY_H; // Unlock RTC // RTCCTL0_L = RTCTEVIE | RTCRDYIE; // enable RTC read ready interrupt // enable RTC time event interrupt RTCCTL1 = RTCBCD | RTCHOLD | RTCMODE; // RTC enable, BCD mode, RTC hold /* RTCYEAR = 0x2017; // Year = 0x2017 RTCMON = 0x2; // Month = 0x02 = Feb RTCDAY = 0x18; // Day = 0x18 = 18 RTCDOW = 0x07; // Day of week = 0x07 = Sun RTCHOUR = 0x21; // Hour = 0x21 RTCMIN = 0x46; // Minute = 0x46 RTCSEC = 0x45; // Seconds = 0x45 RTCADOWDAY = 0x2; // RTC Day of week alarm = 0x2 RTCADAY = 0x20; // RTC Day Alarm = 0x20 RTCAHOUR = 0x10; // RTC Hour Alarm RTCAMIN = 0x23; //*/ RTCCTL1 &= ~(RTCHOLD); // Start RTC // ADC12CTL0 |= ADC12SC; // Sampling and conversion start RTCCTL0_L = RTCRDYIE; // enable RTC read ready interrupt // enable RTC time event interrupt __bis_SR_register(LPM3_bits | GIE); // Enter LPM3 mode w/ interrupts } void loop() { Serial.print(14); } #pragma vector=RTC_VECTOR __interrupt void RTC_ISR(void) { // __bic_SR_register_on_exit(LPM3_bits); // Exit active CPU // Serial.println(116); s=RTCSEC ; m=RTCMIN ; h=RTCHOUR ; d=RTCDAY ; M=RTCMON ; y=RTCYEAR ; temp = ADC12MEM0; temperatureDegC = (float)(((long)temp - CALADC12_12V_30C) * (85 - 30)) / (CALADC12_12V_85C - CALADC12_12V_30C) + 30.0f; // Temperature in Fahrenheit Tf = (9/5)*Tc + 32 temperatureDegF = temperatureDegC * 9.0f / 5.0f + 32.0f; myLCD.clear(); myLCD.println(temperatureDegC); // ADC12CTL0 |= ADC12SC; RTCCTL0_L = RTCRDYIE; __bis_SR_register(LPM3_bits | GIE); } FR4133 - Temperature sensor by ADC iterrupt #include <msp430.h> #include "LCD_Launchpad.h" #define CALADC_15V_30C *((unsigned int *)0x1A1A) // Temperature Sensor Calibration-30 C // See device datasheet for TLV table memory mapping #define CALADC_15V_85C *((unsigned int *)0x1A1C) // Temperature Sensor Calibration-85 C float temp; float IntDegF; float IntDegC; LCD_LAUNCHPAD myLCD ; void setup() { // put your setup code here, to run once: myLCD.init(); // Serial.begin(9600) ; // Serial.println(12); WDTCTL = WDTPW | WDTHOLD; // Stop WDT PM5CTL0 &= ~LOCKLPM5; // Disable high-impedance mode TA0CCTL0 |= CCIE; // TACCR0 interrupt enabled TA0CCR0 = 65535; TA0CTL = TASSEL__ACLK | MC__UP; // ACLK, UP mode // Configure ADC - Pulse sample mode; ADCSC trigger ADCCTL0 |= ADCSHT_8 | ADCON; // ADC ON,temperature sample period>30us ADCCTL1 |= ADCSHP; // s/w trig, single ch/conv, MODOSC ADCCTL2 |= ADCRES; // 10-bit conversion results ADCMCTL0 |= ADCSREF_1 | ADCINCH_12; // ADC input ch A12 => temp sense ADCIE |=ADCIE0; // Enable the Interrupt request for a completed ADC_B conversion // Configure reference PMMCTL0_H = PMMPW_H; // Unlock the PMM registers PMMCTL2 |= INTREFEN | TSENSOREN; // Enable internal reference and temperature sensor __delay_cycles(400); // Delay for reference settling __bis_SR_register(LPM3_bits | GIE); // LPM3 with interrupts enabled // __no_operation(); // Only for debugger myLCD.clear(); } void loop() { // myLCD.clear(); // myLCD.print(int(IntDegC)); myLCD.println("C"); // Serial.println(IntDegC); //delay(500); } // ADC interrupt service routine #pragma vector=ADC_VECTOR __interrupt void ADC_ISR(void) { // __delay_cycles(400); temp = ADCMEM0; // Temperature in Celsius IntDegC = (temp-CALADC_15V_30C)*(85-30)/(CALADC_15V_85C-CALADC_15V_30C)+30; // Temperature in Fahrenheit IntDegF = 9*IntDegC/5+32; myLCD.clear(); myLCD.print(int(IntDegC)); myLCD.println("C"); __delay_cycles(400); } // Timer A0 interrupt service routine #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer_A (void) { ADCCTL0 |= ADCENC | ADCSC; // Sampling and conversion start } -
StrangerM reacted to Fmilburn in Introduction to Finite State Machines
I recently became interested in Finite State Machines and ended up writing a tutorial which has been posted on the 43oh blog: http://43oh.com/2017/02/how-to-implement-finite-state-machines-using-energia/
The example uses Energia but adapting it to C / C++ for use with Code Composer Studio or other IDEs would be simple. While conceptually easy, working through the details and applying the concepts in a more structured manner were instructive for me. The tutorial is just an introduction but there are additional references at the bottom. If you are aware of other good resources feel free to post them below.
-
StrangerM got a reaction from bluehash in FR6989 - internal RTS & Temperature sensor
Two examples. I
-
StrangerM got a reaction from Fmilburn in FR6989 - internal RTS & Temperature sensor
In addition to 2 examples. Examle for FR4133.
#include <msp430.h> #define CALADC_15V_30C *((unsigned int *)0x1A1A) // Temperature Sensor Calibration-30 C // See device datasheet for TLV table memory mapping #define CALADC_15V_85C *((unsigned int *)0x1A1C) // Temperature Sensor Calibration-85 C float temp; float IntDegF; float IntDegC; void setup() { // put your setup code here, to run once: Serial.begin(9600) ; Serial.println(12); // WDTCTL = WDTPW | WDTHOLD; // Stop WDT PM5CTL0 &= ~LOCKLPM5; // Disable high-impedance mode TA0CCTL0 |= CCIE; // TACCR0 interrupt enabled TA0CCR0 = 65535; TA0CTL = TASSEL__ACLK | MC__UP; // ACLK, UP mode // Configure ADC - Pulse sample mode; ADCSC trigger ADCCTL0 |= ADCSHT_8 | ADCON; // ADC ON,temperature sample period>30us ADCCTL1 |= ADCSHP; // s/w trig, single ch/conv, MODOSC ADCCTL2 |= ADCRES; // 10-bit conversion results ADCMCTL0 |= ADCSREF_1 | ADCINCH_12; // ADC input ch A12 => temp sense ADCIE |=ADCIE0; // Enable the Interrupt request for a completed ADC_B conversion // Configure reference PMMCTL0_H = PMMPW_H; // Unlock the PMM registers PMMCTL2 |= INTREFEN | TSENSOREN; // Enable internal reference and temperature sensor __delay_cycles(400); // Delay for reference settling // __bis_SR_register(LPM0_bits | GIE); // LPM3 with interrupts enabled // __no_operation(); // Only for debugger } void loop() { Serial.println(IntDegC); delay(500); } // ADC interrupt service routine #pragma vector=ADC_VECTOR __interrupt void ADC_ISR(void) { // __delay_cycles(400); temp = ADCMEM0; // Temperature in Celsius IntDegC = (temp-CALADC_15V_30C)*(85-30)/(CALADC_15V_85C-CALADC_15V_30C)+30; // Temperature in Fahrenheit IntDegF = 9*IntDegC/5+32; } // Timer A0 interrupt service routine #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer_A (void) { ADCCTL0 |= ADCENC | ADCSC; // Sampling and conversion start } All examples were taken from MSP430Ware_3_60_00_10 and adapted for Energia
-
StrangerM got a reaction from energia in FR6989 - internal RTS & Temperature sensor
In addition to 2 examples. Examle for FR4133.
#include <msp430.h> #define CALADC_15V_30C *((unsigned int *)0x1A1A) // Temperature Sensor Calibration-30 C // See device datasheet for TLV table memory mapping #define CALADC_15V_85C *((unsigned int *)0x1A1C) // Temperature Sensor Calibration-85 C float temp; float IntDegF; float IntDegC; void setup() { // put your setup code here, to run once: Serial.begin(9600) ; Serial.println(12); // WDTCTL = WDTPW | WDTHOLD; // Stop WDT PM5CTL0 &= ~LOCKLPM5; // Disable high-impedance mode TA0CCTL0 |= CCIE; // TACCR0 interrupt enabled TA0CCR0 = 65535; TA0CTL = TASSEL__ACLK | MC__UP; // ACLK, UP mode // Configure ADC - Pulse sample mode; ADCSC trigger ADCCTL0 |= ADCSHT_8 | ADCON; // ADC ON,temperature sample period>30us ADCCTL1 |= ADCSHP; // s/w trig, single ch/conv, MODOSC ADCCTL2 |= ADCRES; // 10-bit conversion results ADCMCTL0 |= ADCSREF_1 | ADCINCH_12; // ADC input ch A12 => temp sense ADCIE |=ADCIE0; // Enable the Interrupt request for a completed ADC_B conversion // Configure reference PMMCTL0_H = PMMPW_H; // Unlock the PMM registers PMMCTL2 |= INTREFEN | TSENSOREN; // Enable internal reference and temperature sensor __delay_cycles(400); // Delay for reference settling // __bis_SR_register(LPM0_bits | GIE); // LPM3 with interrupts enabled // __no_operation(); // Only for debugger } void loop() { Serial.println(IntDegC); delay(500); } // ADC interrupt service routine #pragma vector=ADC_VECTOR __interrupt void ADC_ISR(void) { // __delay_cycles(400); temp = ADCMEM0; // Temperature in Celsius IntDegC = (temp-CALADC_15V_30C)*(85-30)/(CALADC_15V_85C-CALADC_15V_30C)+30; // Temperature in Fahrenheit IntDegF = 9*IntDegC/5+32; } // Timer A0 interrupt service routine #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer_A (void) { ADCCTL0 |= ADCENC | ADCSC; // Sampling and conversion start } All examples were taken from MSP430Ware_3_60_00_10 and adapted for Energia
-
-
StrangerM got a reaction from Fmilburn in FR6989 - internal RTS & Temperature sensor
Two examples. I
-
StrangerM got a reaction from chicken in How to save variables in FRAM ( MSP430FR4133 ).
"uint8_t lo __attribute__ ((section (".text"))) ; " does not work. http://forum.43oh.com/topic/5474-energia-and-wolverine-tips/
But.... it runs.
Simple example
#include <msp430.h> #include "LCD_Launchpad.h" #define M P2_6 #define M1 P1_2 uint8_t L ; LCD_LAUNCHPAD myLCD ; uint8_t lo __attribute__ ((section (".text"))) ; void setup() { myLCD.init(); pinMode(M, INPUT_PULLUP); pinMode(M1, INPUT_PULLUP); // Serial.begin(9600) ; myLCD.clear(); } void loop() { if (digitalRead(M)==0 ){ SYSCFG0 &= ~PFWP; // Program FRAM write enable lo=5; // Record in FRAM SYSCFG0 |= PFWP; // Program FRAM write protected (not writable) } if (digitalRead(M1)==0 ){ SYSCFG0 &= ~PFWP; // Program FRAM write enable lo=3; // Record in FRAM SYSCFG0 |= PFWP; // Program FRAM write protected (not writable) } myLCD.print(lo); myLCD.print("Lo"); delay(1000); // Serial.println(lo); } -
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
I used HAT with USB/COM cable and have checked up by RasPI test generator.
Excellent.
-
StrangerM reacted to chicken in [POTM] dAISy - A Simple AIS Receiver
For those with a dAISy USB or BoosterPack, I just published a new firmware version 4.11 on GitHub.
https://github.com/astuder/dAISy/tree/master/Firmware
It introduces the greatest incremental improvement since firmware 4.02. Turns out, slower channel hopping works A LOT better. Same range, but in my tests the change results in about 25-30% more messages received.
I also fixed bug in serial communication that only occurs when you try to connect dAISy to an Android device. That bug was introduced a month ago, and impacts only a few customers that ordered units between December 20 2016 and January 18 2017.
As always, please let me know if you run into any issues.
-
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
It`s for TIVA-C. As is...
AIS_dAISy_TIVANEW.zip
-
StrangerM reacted to chicken in [POTM] dAISy - A Simple AIS Receiver
@@StrangerM just tried with a MSP430F5529 LaunchPad and it works for me.
I tried both ways entering the bootloader, either pressing the BSL button when plugging in or the B command in the debug menu.
I can see two potential issues:
1) Make sure your firmware file is not corrupted. Some browsers seem to save HTML code instead of plain text when downloading a .txt from Github. I just uploaded them to Github as ZIP file to avoid that issue.
2) On my LaunchPad, only the GND, 5V and 3.3V jumpers are in. The other jumpers on the debug connection are empty.
Regards,
Adrian
-
StrangerM reacted to Fmilburn in [POTM] dAISy - A Simple AIS Receiver
Find code for dAISy and the TMC123G and F5529 LaunchPads with a CC3100 BackPack to send data to MarineTraffic using Energia here: https://github.com/fmilburn3/dAISy_marinetraffic
Note that for the F5529 it is necessary to increase the serial ring buffer size in Energia (HardwareSerial.cpp) to get stable operation, e.g. #define SERIAL_BUFFER_SIZE 512. The TMC123G runs without any modifications to Energia. It should also work with the CC3200 although I haven't been able to test it with this latest version of the code.
And here is a screen capture...
-
StrangerM got a reaction from bluehash in [POTM] dAISy - A Simple AIS Receiver
ESP01 consumes too much current. So WiFi is good but USB is better.However,
I made upgrade NASA ENGINE3. I inserted the GPS shield with 9600 baud and the Arduino nano (for chenging 9600 to 4800) in ENGINE3. ENGINE3 can insert GPS string with 4800 in 34800 ENGINE3 sending by COM port. I inserted step down converter 12V->3.3V and ESP01 in ENGINE3. ESP01 sends summary signal in WiFi telnet port (23). So there is a new ENGINE3.
NEW .................If to add GPS shield we can get a alarm device of dangerous closing.... It`s a alarm device of dangerous closing (module with generic STM32f103c8). (12V 150 mA)
-
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
ESP01 consumes too much current. So WiFi is good but USB is better.However,
I made upgrade NASA ENGINE3. I inserted the GPS shield with 9600 baud and the Arduino nano (for chenging 9600 to 4800) in ENGINE3. ENGINE3 can insert GPS string with 4800 in 34800 ENGINE3 sending by COM port. I inserted step down converter 12V->3.3V and ESP01 in ENGINE3. ESP01 sends summary signal in WiFi telnet port (23). So there is a new ENGINE3.
NEW .................If to add GPS shield we can get a alarm device of dangerous closing.... It`s a alarm device of dangerous closing (module with generic STM32f103c8). (12V 150 mA)
-
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
Also we can use Bluetooth http://www.aliexpress.com/item/wholesale-hc-05-HC-05-RF-Wireless-Bluetooth-Transceiver-Module-RS232-TTL-to-UART-converter-and/819803955.html
or
CD4011 (RX & TX) - DD1 & DD2 for ex.
-
StrangerM reacted to gmtii in [POTM] dAISy - A Simple AIS Receiver
hi,
this is how to setup an ais server with your rpi, cubieboard or beaglebone, dAISy and Marinetraffic. This is how I did but I'm sure there are better ways to do it ...
When you a server @ Marinetraffic, they'll send an email with IP and unique port where you have to send dAISys output, e.g. 5.9.207.224 7604. We have to redirect dAISy serial output to this IP and unique port with some awful scripts:
First, install screen utility: sudo apt-get install screen
Plug dAISY USB and check if /dev/ttyACM0 is there; if not, then you need a kernel with support for CDC_ACM devices; rpi, cubieboard or beaglebone stock kernels should support these out the box.
Test if your dAISy is working with any serial terminal of your choice as minicom or just enter 'screen /dev/ttyACM0'. (CTRL+A and K to exit from screen session). This is how AIS sentences looks like:
!AIVDM,1,1,,A,1CF4kT3000Nm`Kl@BHKJC@IH0000,0*37
!AIVDM,1,1,,B,4028jOQur1laeNlMIL@<`8O00@JU,0*5F
We'll use this script to redirect serial output to Marinetraffic site; if connection is dropped, it'll reconnect in 5 seconds:
#!/bin/sh
while true;
do
echo "Start: " `date`
nc 5.9.207.224 7604 < /dev/ttyACM0
echo "Restart: " `date`
sleep 5
done
done
5.- save as /home/foo/ais.sh
6.- run the script in a separate console with this command: "screen -dmS ais sh /home/foo/ais.sh". You can connect with this console with this command "screen -r ais" and kill it with CTRL+A and the press K.
From now you can logout and let the box running alone. Add before exit(0) @ /etc/rc.local if you want automatic startup...
Esteban.
-
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
Hello. It`s dAISy BoosterPack (thank you very much, Adrian) + GPS USB + RaspberryPI 2 = WiFi AIS+GPS
-
StrangerM got a reaction from Fmilburn in [POTM] dAISy - A Simple AIS Receiver
Hello. It`s dAISy BoosterPack (thank you very much, Adrian) + GPS USB + RaspberryPI 2 = WiFi AIS+GPS
-
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
Hello everybody. Several days ago I have received dAISy. It once worked well at my home. I used J antenna.
At my home dAISy works not worse NASA ENGIINE3. But I have checked up also my test generator. And it works well. Zip file includes the short video about it.
11092015.zip
-
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
I made the test generator for dAISy on the basis of the cheap Chinese FM transmitter (http://www.aliexpress.com/item/Free-Shipping-1Pcs-76-110MHz-FM-Radio-Wireless-Transmitter-Module-MP3-Audio-Repeater-Module/2042607191.html ) and wav files with AIS signal. In the transmitter I have changed the coil and the capacitor. I have changed its frequency having used for control DVBT USB and SDR Sharp
The test generator is not so useful. As it has bad temperature stability and is difficult at adjustment. Nevertheless.
-
StrangerM got a reaction from chicken in [POTM] dAISy - A Simple AIS Receiver
A decoder (AIVDM -> coordinates, speed etc.) is very interesting. If to add GPS shield we can get a alarm device of dangerous closing.
I have made a draft variant of such decoder for 1 type of message. :-) CMX589+TIVA-C+wav
!AIVDM,1,1,,A,13P`Et00002:@<0R@nsU?4A`0L0S,0*E
MMSI=235542000
NS=0
ROT=0
SOG=0.00
COG=134.00
HDG=136
DIST=9936.11M
!AIVDM,1,1,,A,14bBhV8P012:C@<R@q2u=Owb08O<,0*5B
MMSI=312783000
NS=0
ROT=-128
SOG=0.10
COG=338.10
HDG=511
DIST=9690.07M
!AIVDM,1,1,,A,144cN<00002:I9PR@rmdPS3h00Rq,0*3C.............................
I have made a draft variant of such decoder for 1 type of message. :-) CMX589+TIVA-C+DVBT+SDR SHARP+J-antenna
-
StrangerM got a reaction from bluehash in [POTM] dAISy - A Simple AIS Receiver
OK. Good news. It are some my steps. Your project -> Energia. Tekmanoid->Arduino. And It`s my boat (Stranger :-))
-
StrangerM got a reaction from bluehash in [POTM] dAISy - A Simple AIS Receiver
Thanks you!
There is a photo of already finished device.
I did the project simply. I collected all C-files in one. So it turned out better because of features of the Energia compiler. I added h-files in the project. I changed interrupt operators and input-output operators. It does not look well, nevertheless the device works. Now the project is disorder and contains errors. Therefore I would not like to publish it, but I can send it to you (as author of the project :-)).
PS Sorry. I collected not all C-files in one. And I added not all h-files in the project. I used needed files from your project. It was in April (or May)and I don`t remember everything well.