Jump to content
43oh

morry

Members
  • Content Count

    19
  • Joined

  • Last visited

Posts posted by morry

  1. Please note that this statement does not allocate any memory for your received string:

    char stringrecv[]="";

     

    There could be strange effects when your code gets more complex since the memory area of your stringrecv array is not protected and could be overwritten by other variables.

     
    An common solution is to define a fixed buffer size:
    #define UART0_BUFFER_SIZE 32
    ...
    char stringrecv[uART0_BUFFER_SIZE]; //32 bytes will be reserved for this array
    ...
  2. Hey Yosef,

    some hints:

    1) in your systick.c file FPCU define is missing a zero. Your FCPU is 5Mhz but should be 50MHz.

    2) You have to pull RS low before writing a instruction, so that the instruction register is selected.

    RS Low --> Put Instruction Data on 4 Data Pins --> Enable High --> Wait >42us --> Enable Low --> Wait >42us

    Your Enable Pulse is just some Instruction cycles long, on 50Mhz these are just a few nanoseconds. That's way too short.

  3. Hi and welcome to the world of easy programming and not-caring-about-register-bits! ;-)

     

    A big advantage of the Stellaris controllers is the driverlib, which makes it very easy to use peripherals like timers.

     

    This is an example of how to configure a periodic 100ms-timer with Timer0A with the driverlib. You can easily switch to 1s timer by changing the divider in the TimerLoadSet function call.

    You have to install StellarisWare to use this code http://www.ti.com/tool/sw-lm3s

    #include "driverlib/timer.h"
    #include"inc/hw_timer.h"
    
    //*****************************************************************
    //Setup Timer0
    //*****************************************************************
    
    TimerIntRegister(TIMER0_BASE, TIMER_A, Timer0IntHandler)
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
    TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet()/10); //Divider 1/10 sec = 100ms
    IntEnable(INT_TIMER0A);
    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    
    //Enable Timer
    TimerEnable(TIMER0_BASE, TIMER_A);
    
  4. Hi! This is a cool project, lots of work! I like that you share your iteration steps, very interesting to see.

     

    Why do you use a seperate 3.3V supply? TI Hercules should have a 3.3V supply on board.

     

    Your reverse voltage protection is a good idea with this mosfet but might be a little oversized. In most cases a reverse protection diode will do the job.

     

    For the relay drivers I can reccomend just simple MOSFET switched controlled by 3.3V - BSS123 is a good type to start.

     

    With DC motor half bridge driving you can use regenerative braking by activating the upper MOSFET, energy flows right back into your 12V battery.

  5. Hi Oldie,

     

    what do you think about this one:

    2014-02-01%2009.36.24.jpg

     

    It has same size as the launchpad, features a STMicro Gyro and Acc-Sensor (no need to place these if you dont need them).

    The voltage regulator is a standard 7805 type, so you can drive the supply with a input voltage up to 35V (but you should avoid high currents due to high power loss at the regulator).

     

    The 120 Ohm terminator is removable by a solder jumper, all connectors are 90 degrees types.

     

    Board is not tested yet, will be tested in february.

     

    Some other features:

    -5V digital output, swithced with mosfet

    -UART3 routed to septerate port to connect bluetooth module

    -seperate CAN Input and output connectors

     

    What do you think?

  6. Hi!

     

    Prescaler (in simple words) means that the clock driving your Timer is divided by 500 - your timer counts 500 times slower than the system clock speed.

    Let's assume a system clock of 80Mhz: 80Mhz / 500 = 160kHz  --> 1/160kHz = 6,25µs for one counter step.

     

    Your Timer is loaded with a start value of 60000 and counts down to 0.

    So you have 60000 steps * 6,25µs = 0.375s - that is your timer period for one full count from 60000 downto 0.

     

    Or as equation - easy to adapt for different values of Prescaler, TimerLoad and System Clock:

    TimerPeriod = 60000 * 500 / 80MHz.

  7. Yeah it's beast. B)  Top speed will not be that high, it's not required in the formula student contests. Top speed is 130km/h (80mph).

    Acceleration is what this car is made for: 0-100km/h (0-60mph) in under 4 seconds.

     

    Engine torque has to be controlled at any time, especially while starting to accelerate. At the moment we produce the steel frame, our drivetrain is already running on a test setup at our university.

     

    I'll put some updates here, especially when the launchpad stuff gets implemented.

  8. That's a nice project, spirilis!

    It's good to see that you could get the MSP430 connected to CAN via the MCP2515! Does the MCP2515 all the CAN Error handling (error counters, error bus off state) on its own?

     

    We aim only for the Stellaris/Tiva-Launchpad because of the built in CAN module, easy programming, API is well documented. MSP430 is no option for us at the moment.

    Our application is a Formula student electric racing car - two high power permanent magnet motors (100kW peak each B) , total power is limited to 85kW by the Formula Student rules) with Stellaris Launchpads everywhere (battery management system master controller, Sensor-to-CAN-boosters, Gyro-booster,...).

     

    Unbenannt.PNG

     

    Greetings from Germany!

    Moritz

  9. Hi!

     

    http://www.youtube.com/watch?v=fRy08v7WnbQ

     

    This is a CAN Booster we developed for our electrical Formula Student Racing Car.

    It features:

    -Microchip MCP2551 CAN Transceiver up to 1Mbit/s

    -switched power supply 12V -> 5V up to 1A for external supply, but can also be supplied via Launchpad

    -LED indicators for RX, TX and 5V Power

     

    The power supply and the LED indicators are not neccesary for function.

     

    Also optional is a Microchip MCP25055 standalone CAN-Module, so this board could also be used without the Launchpad.

     

     

    Let me know which additional features you wish for a small CAN Booster Pack. After that we redesign the board, produce the boards and offer them for you.

     

    Bye!

    Moritz

  10. Hey guys,

     

    this was my very first project on the awesome TI Stellaris Launchpad.

    I don't know if these Carrera Slot Cars are famous all over the world, but in Germany this was a Must-Have for every kids toy collection. :-)

    Carrerabahn_124.jpg

    (Picture from Wikipedia, looping is missing ;-) ).

     

    You set two cars on the track and control their speed with a small controller.

    The fastest car wins the race but main goal is actually to stay on track.  ;)

     

    1. The Mission

    I wanted to have a display, that shows me the current time for each track and the best driven time for each track.

     

    2. How to detect the cars?

    After some considerations about light switches etc. I realized that the cars are hold on track by a small magnet in the back of each car. Perfect for use with Reed-Contacts.

    In the picture you can see the mechanical lap counter and the adaptor board to the Stellaris launchpad. The Reed contacts are mounted from the bottom side next to each track.

    2013-03-09%2022.26.31%20%28Small%29.jpg

     

    3. Display

    There might be good LCD-libraries even for Cortex M4, but for better learning I decided to write my own routines for the display.

    It's a 4 Line LCD with a KS0066 controller (HD44780 compatible) in "good old" 4Bit mode.

    Here's the display with the launchpad adaptor board (and poti for contrast control):

    2013-03-09%2022.33.43%20%28Small%29.jpg

     

    4. The code

    Basically there are two timers set to 1ms intervall, one for each track.

    The reed contacts trigger a GPIO-interrupt, which starts the timers.

    A third timer sets a displayrefresh-flag, which is polled in the main loop.

     

    Here is the code as CCS-Project: https://dl.dropbox.com/u/773191/TI/carrera/carrera.zip

     

    5. LCD-Library

    If you want to use a KS0066 or HD44780-Display, here are my LCD.c and LCD.h for it:

    https://dl.dropbox.com/u/773191/TI/carrera/LCD.c

    https://dl.dropbox.com/u/773191/TI/carrera/LCD.h

    Works also for displays with 1 or 2 lines of course.

    2013-03-09%2022.47.14%20%28Small%29.jpg

     

    6. Some more pictures

    "The Sandwich":

    2013-03-09%2022.48.12%20%28Small%29.jpg

     

    Complete setup:

    2013-03-09%2022.48.20%20%28Small%29.jpg

     

     

    Greets

    Moritz

  11. Hey guys,
     
    I'm new to Stellaristi, awesome forum! I really love my Stellaris Launchpad, since it keeps me away from dealing with nasty register bit settings. 
     
    I developed the same application as nemetila and found his solution yesterday, but my Windows Application is by far not as nice as yours. ;-)
    TempApplication.PNG
    The Applications receives the temperature from a selectable serial port and displays it. 270 means 27.0°C.

     

    Clicking on Red, Green and Blue lights the Launchpad LED in the matching color (just by sending 'R', 'G', or 'B' char via UART).

     


    I connect to my PC via JY-MCU UART-Bluetooth Module from China (http://dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299) on UART3. Took me a long long way to figure out, that PD7 on UART2 is used for supply voltage monitoring on the Launchpad so this UART is not usable without additional coding. Next problem: Uartstdio.h supports only UART0-UART2, so I had to enhance this library a bit to use it for UART3.

    I couldn't use UART1, because their pins are used by the LCD...

     

    2013-03-09%2008.59.49.jpg

     

    Additionaly I use a Nokia 5110 Display module via SSI (as well very cheap from China http://dx.com/p/replacement-1-6-lcd-screen-with-blue-backlight-for-nokia-5110-blue-145860 )

     

    Nice thing about Bluetooth is connectivity to mobile devices such as Android Phones. With "Bluetooth SPP"-App i could easily connect to the Launchpad UART and display the temperature-vaules on my Android phone.

    2013-03-09%2009.21.27.png

    Nice and simple, R, G and B-commands also work.

     

    I will do some code cleanup and share it with you here.

     

    Moritz

×
×
  • Create New...