Jump to content
Forum sending old emails Read more... ×

johnrdorazio

Members
  • Content Count

    5
  • Joined

  • Last visited

About johnrdorazio

  • Rank
    Noob Class

Contact Methods

  • Website URL
    http://www.johnromanodorazio.com

Profile Information

  • Location
    Rome, Italy
  • Interests
    programming,electronics,philosophy,religion,music,art
  • Github
    https://github.com/Lwangaman/jQuery-Clock-Plugin
  1. I saw that all 8 digital pins are not needed to display the characters, but they seem to be needed to write the characters into memory in the first place (using the "lcd.createChar()" function), or at least using only 4 digital pins was not working for me when trying to "lcd.createChar", but it worked fine when using all 8... Maybe it's not needed to create the characters either (in fact the example for Arduino only uses 4 digital pins), but for some reason that seems to be the only way it worked for me.
  2. In fact in the end we just copied the library over from the MSP430 folder and pasted it into the CC3200 folder, and it works just fine. I'm using it like this: #include <LiquidCrystal.h> //DEFINE LIQUID CRYSTAL PINS #define LQCR_RS 2 #define LQCR_EN 3 #define LQCR_D0 4 #define LQCR_D1 5 #define LQCR_D2 6 #define LQCR_D3 7 #define LQCR_D4 8 #define LQCR_D5 9 #define LQCR_D6 10 #define LQCR_D7 30 //INITIALIZE LIQUID CRYSTAL DISPLAY LiquidCrystal lcd(LQCR_RS, LQCR_EN, LQCR_D0, LQCR_D1, LQCR_D2, LQCR_D3, LQCR_D4, LQCR_D5, LQCR_D6, LQCR_D7); void setup(){ //SETUP LCD columns and rows: lcd.begin(16, 2); lcd.clear(); delay(20); lcd.print("***** READY ****"); delay(100); lcd.setCursor(0,1); lcd.print("Set..."); delay(100); lcd.setCursor(9,1); lcd.print("GO !!!"); } This is using all 8 digital pins, if you want to write custom characters into the 8 custom character slots. If this is not needed, then 4 digital pins are enough for printing to the display.
  3. Now that CC3200 support has been added to Energia in the past few releases, I am wondering if the core libraries will be made available for the CC3200. Specifically I am trying to use a 16x2 LCD, but I see that the LiquidCrystal library is not available for the CC3200. May I ask for CC3200 support for the LiquidCrystal library?
  4. I have just found this thread, I also am needing to use a DS18S20 sensor with the OneWire library. I can use the OneWire library by Paul Stoeffregen without any problem in Arduino. I tried to download the library attached here http://forum.43oh.com/topic/3314-energia-library-onewire-ds18b20-430-stellaris/#entry29813 But Energia 0015 will not start, I receive an error saying that the application cannot be launched. As soon as I delete the library, Energia launches again just fine. I believe there is some kind of incompatibility with the latest Energia version? EDIT: I see the problem was simply that the example folder cannot be included with the library as is, this will block the application. Removing the example folder let me use the library nicely on an MSP430G2553.
  5. johnrdorazio

    howto: porting libraries - some help needed

    Following up on this, I need some help with the definitions needed to port the OneWire library for Arduino to Energia for the MSP430. The hardware abstraction layer in the library has this: // Platform specific I/O definitions #if defined(__AVR__) #define PIN_TO_BASEREG(pin) (portInputRegister(digitalPinToPort(pin))) #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin)) #define IO_REG_TYPE uint8_t #define IO_REG_ASM asm("r30") #define DIRECT_READ(base, mask) (((*(base)) & (mask)) ? 1 : 0) #define DIRECT_MODE_INPUT(base, mask) ((*((base)+1)) &= ~(mask)) #define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+1)) |= (mask)) #define DIRECT_WRITE_LOW(base, mask) ((*((base)+2)) &= ~(mask)) #define DIRECT_WRITE_HIGH(base, mask) ((*((base)+2)) |= (mask)) #elif defined(__MK20DX128__) #define PIN_TO_BASEREG(pin) (portOutputRegister(pin)) #define PIN_TO_BITMASK(pin) (1) #define IO_REG_TYPE uint8_t #define IO_REG_ASM #define DIRECT_READ(base, mask) (*((base)+512)) #define DIRECT_MODE_INPUT(base, mask) (*((base)+640) = 0) #define DIRECT_MODE_OUTPUT(base, mask) (*((base)+640) = 1) #define DIRECT_WRITE_LOW(base, mask) (*((base)+256) = 1) #define DIRECT_WRITE_HIGH(base, mask) (*((base)+128) = 1) #elif defined(__SAM3X8E__) // Arduino 1.5.1 may have a bug in delayMicroseconds() on Arduino Due. // http://arduino.cc/forum/index.php/topic,141030.msg1076268.html#msg1076268 // If you have trouble with OneWire on Arduino Due, please check the // status of delayMicroseconds() before reporting a bug in OneWire! #define PIN_TO_BASEREG(pin) (&(digitalPinToPort(pin)->PIO_PER)) #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin)) #define IO_REG_TYPE uint32_t #define IO_REG_ASM #define DIRECT_READ(base, mask) (((*((base)+15)) & (mask)) ? 1 : 0) #define DIRECT_MODE_INPUT(base, mask) ((*((base)+5)) = (mask)) #define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+4)) = (mask)) #define DIRECT_WRITE_LOW(base, mask) ((*((base)+13)) = (mask)) #define DIRECT_WRITE_HIGH(base, mask) ((*((base)+12)) = (mask)) #ifndef PROGMEM #define PROGMEM #endif #ifndef pgm_read_byte #define pgm_read_byte(addr) (*(const uint8_t *)(addr)) #endif #elif defined(__PIC32MX__) #define PIN_TO_BASEREG(pin) (portModeRegister(digitalPinToPort(pin))) #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin)) #define IO_REG_TYPE uint32_t #define IO_REG_ASM #define DIRECT_READ(base, mask) (((*(base+4)) & (mask)) ? 1 : 0) //PORTX + 0x10 #define DIRECT_MODE_INPUT(base, mask) ((*(base+2)) = (mask)) //TRISXSET + 0x08 #define DIRECT_MODE_OUTPUT(base, mask) ((*(base+1)) = (mask)) //TRISXCLR + 0x04 #define DIRECT_WRITE_LOW(base, mask) ((*(base+8+1)) = (mask)) //LATXCLR + 0x24 #define DIRECT_WRITE_HIGH(base, mask) ((*(base+8+2)) = (mask)) //LATXSET + 0x28 #else #error "Please define I/O register types here" #endif Looking around some forums I found that these definitions might work for the Tiva / Stellaris boards, though i haven't had a chance to test yet: #elif defined(__TM4C129XNCZAD__) || defined(__TM4C1294NCPDT__) || defined(__LM4F120H5QR__) || defined(__TM4C123GH6PM__) #define portMaskedOutputRegister(base, mask) ((volatile uint8_t *) (base + (GPIO_O_DATA + (((uint32_t)mask) << 2)))) #define PIN_TO_BASEREG(pin) (&((uint32_t)portBASERegister(digitalPinToPort(pin)))) #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin)) #define IO_REG_TYPE uint8_t #define IO_REG_ASM #define DIRECT_READ(base, mask) #define DIRECT_MODE_INPUT(base, mask) #define DIRECT_MODE_OUTPUT(base, mask) #define DIRECT_WRITE_LOW(base, mask) (portMaskedOutputRegister(base, mask) = 0) #define DIRECT_WRITE_HIGH(base, mask) (portMaskedOutputRegister(base, mask) = 0xFF) I would like to know what definitions are needed for the MSP430: #elif defined(__MSP430__) I can't use GPIO_O_DATA in defining "portMaskedOutputRegister", it's not defined for the MSP430...
×