• Content count

  • Joined

  • Last visited

  • Days Won


zeke last won the day on March 22

zeke had the most liked content!

About zeke

  • Rank
    Level 5

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  • Location
    Calgary, Canada
  1. This is my approach to state machines. Your mileage may vary. Determine all of the sub-systems that you will want to service Commands, Controls and Inputs, User Interface, and Data Setup a system tick timer that fires its interrupt on a regular consistent basis. This system doesn't have to go into LPM4. If it does then periodically wake up the system and cycle through the software service loops then go back to sleep. Setup a series of service flags that are set during the interrupt service routine and cleared after being serviced: Flag(s) for Commands, Flag(s) for Controls and Inputs, Flag(s) for User Interface, and Flag(s) for Data Setup a variable that acts like the system timer odometer. Every Odometer == (DesiredInterval%ServiceFlag_n_now) set the ServiceFlag_n Decide how often you will service the other functional blocks of your code. For example, Update the 2x20 LCD display every one second, or Update the Serial Console every 250ms, or Retrieve the Temperature from a sensor every 15 minutes. Setup an Interrupt Service Routine to catch any characters coming into the Serial Port Buffer. Stuff them into the Input Ring Buffer Set a flag that there's something to service. In the main loop, scan all of the service flags to see if any are set. Call the servicing function for each set flag. Clear the service flag at the end of that process. Configure the program to repeat continuously until Kingdom Come. I've left out significant details about setting up all of the peripherals and general variables so don't forget to do that stuff. This is just the basic gist of my state machines on a bare metal level.
  2. I've never gotten the interrupt driven I2C Master to work reliably but I have gotten the interrupt driven I2C working like a charm. I've done this working on the 2955, the 2553, and the 5529. I've used a state machine to divide up all the functionality between the I2C, the Serial IO, and the GPIO. It's weird to realize that I have never used the ADC nor the PWM yet.
  3. Hi Inscribe. I have all of them still. I will figure out a price and let you know.
  4. I have done both of these tasks for more than one client. The 1-Wire protocol speed ends up being about 15kHz, which is slow but reliable. It's really cool to see on an scope though. I developed the I2C slave code using the sample TI code as the starting point. Here are the research materials that I referred to while writing my I2C code: http://www.nxp.com/documents/application_note/AN10216.pdf http://www.nxp.com/documents/user_manual/UM10204.pdf http://i2c.info/i2c-bus-specification http://www.ti.com/lit/an/slva704/slva704.pdf My slave code just follows the logic of the transaction.
  5. @@bluehash Is this MAVLink?
  6. @@LIJsselstein, I don't have any specific reason for singling out this repository. A long time ago, in another job, I was writing C code for the Z80. The micro had to talk with the on-board metering system of a gigantic mining truck. The protocol used was called PLM2. It has since upgraded to PLM3. It turns out that it is too complex of a protocol for my tinkering. So, I went on the hunt for source code examples which demonstrated packetized communication between the PC and a micro. Specifically, I was hunting for source code examples in python that showed me how to work with structures of packets. Eventually, I would like to have a PC program that creates a SCADA like interface to my micro projects. I want to issue commands to the micro and receive back lots of data. It seemed to me that this pytelemetry was a convenient example to consider. Do you have other source code examples that you would like to share with us? I was on the hunt for source code examples which demonstrated packetized communication between the PC and a micro.
  7. Hi EveryBody! I came across three software libraries on github that I thought I would share: pytelemetry telemetry pytelemetrycli pytelemetry provides high-level communication with any embedded device for remote control and monitoring. Specifically, pytelemetry implements a custom communication protocol, based on the PubSub (Publish/Subscribe) messaging pattern. telemetry is the C implementation of the protocol. It can run on any embedded system, along with official distributions for Arduino and ARM Mbed. pytelemetrycli is a powerful command line interface to interact with embedded devices using the protocol. It enables instant data visualization of any received data, full logging of communications, health monitoring of the serial port and much more. It looks like the libraries have been developed for the mbed and the arduino so far. I've got these on my "to play with" bucket list. YMMV
  8. I found this DSO138 oscilloscope kit on HobbyKing today. It may be of use to some people out there who do have a limited test equipment budget. From what I can tell, it looks like you have to solder in all of the through hole parts to complete the build. And I think the processor comes pre-programmed. I don't own one of these. I just thought it was a cool and inexpensive tool for only $20.
  9. @@AndyD273, Welcome! Dust off that board and get 'er running!
  10. Hi!

    Welcome @@KeithB! Please feel free to start a thread on your specific questions over in the General forum and tell us all about your thoughts and intentions.
  11. Oh, please tell us more about your circuit. Are you using a LaunchPad? Which hardware version is it? Do you about the jumpers that effect the I/O lines?
  12. Okay, I am interested in this section: #ifndef __LCD_H #define __LCD_H #define DATAREG P1OUT |= BIT4 // P2OUT |= BIT4 #define COMMANDREG P1OUT &= (~BIT4) // P2OUT |= BIT4 #define READ P1OUT |= BIT5 // P2OUT |= BIT5 #define WRITE P1OUT &= (~BIT5) // P2OUT &= (~BIT5) #define ENABLE_HIGH P1OUT |= BIT6 // P1OUT |= BIT6 #define ENABLE_LOW P1OUT &= (~BIT6) // P1OUT &= (~BIT6) These three lines look suspicious to me. #define COMMANDREG P1OUT &= (~BIT4) // P2OUT |= BIT4 #define ENABLE_HIGH P1OUT |= BIT6 // P1OUT |= BIT6 #define ENABLE_LOW P1OUT &= (~BIT6) // P1OUT &= (~BIT6) Specifically, I am looking at your commented out code which I understand is what you want to do. Should they be adapted to Port2 somehow? #define COMMANDREG P1OUT &= (~BIT4) // P2OUT |= BIT4 ^^^^ #define ENABLE_HIGH P1OUT |= BIT6 // P1OUT |= BIT6 ^^^^^ #define ENABLE_LOW P1OUT &= (~BIT6) // P1OUT &= (~BIT6) ^^^^^ I put carets underneath the characters that I think are suspicious. What do you think?
  13. Welcome @@dutyfree! There is a lot of small details that could go wrong when you change from Port1 to Port2. Could you do use a favor and post your code so we can see what you are doing? Please use the little blue <> symbol when you are posting your code in your reply message. That will make the code look nice for us to see.
  14. I stumbled across a list of nine open source books on Hacker News today that will help people learn how to program in C. YMMV
  15. I just stumbled upon a program called SKiDL. Never use a lousy schematic editor again! SKiDL is a simple module that lets you describe electronic circuits using Python. The resulting Python program outputs a netlist that a PCB layout tool uses to create a finished circuit board. The author then uses KiCAD to massage the netlist information to complete the PCB layout. I can't say that I will be using this myself but I admit that it's a novel new way of creating circuits. YMMV.