Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - rudydevolder

Pages: [1]
1
This is my sub-class:
Code: [Select]
Class UART_Debug
    Shared ser As Uart
    Shared Buffer As ListOfByte
   
    Public Sub New()
        //Lplan.SetMidPowerMode(2000)
        ser = Uart.Create(9600, Pin.Pin1, Pin.Pin0) // Pin 1 to Rxd and pin 0 to TxD; Dev-Board default jumper config
        ser.Write("DEBUG-TERMINAL started") ser.Write(13) ser.Write(10)
        Buffer = New ListOfByte
    End Sub
   
    //Shared Event Uart0Receive() Doesn't work in a class so I try to call this in the main-program but it doesn't work either.
    Public Sub UartReceive()
        Dim chr As Integer = ser.Read
        While chr >= 0
            If chr = 13 Then ' CR echo as CR/LF
                ser.Write(10)
                ParseBuffer()
            Else
                Buffer.AddByte(chr.ToByte)
            End If
            ser.Write(chr.ToByte)
            chr = ser.Read()
        End While
    End Sub
   
    Public Sub print(S As String)
        ser.Write(S)
    End Sub
   
    Public Sub println(S As String)
        ser.Write(S)
        ser.Write(13) ser.Write(10)
    End Sub
   
    Private Sub ParseBuffer()
        Dim S As String
        S = Buffer.ToString
        If S = "help" Then
            ser.Write("Wait I'm going to help you\n\r")
        End If
        Buffer.Clear
    End Sub
End Class

And this is my main-program:
Code: [Select]
Class UART_Terminal_v2
    Shared Terminal As UART_Debug
   
    Shared Event Boot()
        Lplan.SetMidPowerMode(2000)
        //Data = New ListOfObject()
        Terminal = New UART_Debug
    End Event
   
    Shared Event Uart0Receive()
        Terminal.UartReceive()
    End Event
   
    Shared Event Every15Seconds() RaiseEvent Every 15000 milliSeconds
       
        Terminal.println("Every 15 seconds")
       
    End Event
   
End Class

The message is printed every 15 seconds. But the Uart0Receive() Event isn't doing anything.  ???

2
After just adding a file to my project, and only calling the constructor my MC-120 module hangs, I can't connect any more and I must first connect via MC-OTA-updater to erase the script.

So the only instructions executed in my Class are:

   
Class WaterTank
    Shared Address As Byte
    Shared Sensor As I2c

    Public Sub New(_address As Byte)
        Address = _address
        Sensor = I2c.Create(400000, Pin.SCL, Pin.SDA, Address)
    End Sub
    .......
End Class


And in my main program:

    Shared UartTerm As UART_Debug
    Shared WaterTank1 As WaterTank
   
    Shared Event Boot()
        Lplan.SetMidPowerMode(1)
        Lplan.SetBeaconTime(2)
        UartTerm = New UART_Debug()
        WaterTank1 = New WaterTank(0x10)
    End Event


I'm thinking maybe a memory leak in I2C  ???

3
I have succesfully made a connection with a PSoc 4200 as a I2C slave with a McMod110 even at 400kHz ;D
But now I want to use the McDevelopment board it doesn't work any more.
I can see there are 2 LED's placed on that bus. So I presume the signal is BUFFERED and no pull-up resistors are used.
When I use my Digital scope to analyze what's on the I2C bus, I got a NACK. :(
But when I look on my analog scope I only see a noisy signals of around 0,5 Volts on SCL and around 200 milliVolts for SDA, clearly no pull-ups.
So I tried to add pull-up resistors, I tried everything 10k, 4k7, 2k2, 1k. I can see the signal improving by scope from 10k to 4k7, but at 1k I don't see much difference, the slope from the buffer is to slow I guess, even at 100kHz. I will try tommorow with lower frequencies because I think the buffer doesn't support high frequencies. Or is it safe to put lower value resistors?

[SOLVED] Read reply for this incredible story.





4
mc-Dev Board / [SOLVED] UART console example not working on mcMod120
« on: July 31, 2017, 02:58:57 am »
The jumpers for pin 0 & 1 are in default position which means connected.
and I tried the UART terminal example after adapting the pins like this:

       Define PinMode Pin1 As DigitalInput
       Define PinMode Pin0 As DigitalOutput

        ser = Uart.Create(9600, Pin.Pin0, Pin.Pin1)

I can compile & run it but nothing seems to happen.  ???

5
mc-Dev Board / McModule not recognized.
« on: July 31, 2017, 02:51:46 am »
I always need to power on the mc-module separately via the switch "module power" otherwise the module isn't recognized via the connect-tools and "Testboard Gateway" wich seems to be the Dev-board.
I can see the mc-Module is boot up if I go to the other gateways though.
But turn the switch "module-power" off and back on solves the problem.

6
My gateway worked at first but then I started to do all kind of updates: ( it has been while ago I did this )
First I update all my McModules to VM Version:1v08r376  :)
Than I updated my firmware of my gateway hostprocessor to v. 0.8-24 via the USB stick.   :)
I tested again, but could connect to my gateway again but not to any of my McModules  :(
So I thought ok, I must also update the McModule on my Gateway, but I did it the same way as my other mcModules instead of using the mcGw110.bin
So I erased the data-store and updated with the normal McMod110xxxx.bin   :-\
After that I couldn't find my gateway anymore in mcStudio although all the Led's shows normal and I can see my gateway is connected via Newt-Pro.
Than I realized I used the wrong firmware and tried to flash the McDongle on the correct firmware: mcGw110.bin but no luck:
I got the message : Total firmware size exceeds free upload space available in the device. Unable to proceed the update  ???
Help I'm stuck !!! ::)

OK, solved it:
=============

I just chose the wrong file in mcOTAupdater  :P
Mixed up mcGw110.bin and mcGwHost110.bin

I thought maybe to remain this message instead of deleting it. So you can read my stupidities and maybe also solve yours ;)


7
Can somebody give me a reference or the spacing?
I want to order male and female headers and maybe some kind of breakout-board so I can easily change and connect my module. :D

8
mc-Module / [SOLVED] SPI problems
« on: August 03, 2016, 01:56:27 am »
First of all it took me a while to figure out I had to place Spi.Create in the Shared Boot Event() instead of in Sub New()
At least to get some signal out, I don't know why but when I place Spi.create in Sub new() nothing happens on the spi-bus with Transfer.
But placed spi.create in the Shared Boot Event I can see the clock-signal and the CS working but the data is always xFF whatever I try to send and whatever speed or mode I use.
I can clearly see the amount of bytes I've send with the Transfer() command but my logic analyser shows every byte as 0xFF, indeed when I try to connect my WS2801 Leds the only thing I get out of it is plain white and no colors.

9
Red LED flashes every 5 seconds.
Beacon updates: I cannot even see it in devices.  :-[
I assume the module is resetting (hence red led flashes every 5 seconds), but I can't connect to try to reload the program/script.
All firmware and software are the latest versions. I found another topic almost the same that said to install firmware 0.7 v361, I already had this installed, so I tried to upgrade again.
The upgrade works, but the problem remains.  >:(
I read there will be an option to erase the script in the new OTA-update software. I hope this version will be available soon::)
- Last update: Bricked a second module, found the problem: I used Shared Event Boot() only did some Dim's in it and a for next loop with a Type-Casting inside.


Pages: [1]