AS7 Simulator - Possible TXENn Display Bug

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

 

I am testing code to toggle the TCENn bit of UCSRnB register and viewing the result in MS7 simulator.

 

I notice that this bit is constantly 'on' on all ports of a 2560 and 328P (I only have those available to me) and also, this bit cannot be toggled with a the mouse. 

 

I have searched the data sheet for info concerning this on a hardware level but cannot find anything obvious. I have not been using AS7/MS7 for long enough to know if this is normal.

 

Is this a bug of Studio or the norm and by design.

 

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Works ok for me, I do a start debug and break, stop the sim, reset, and examine the UCSRB reg all bits are off, I can then toggle the TXEN bit using the mouse.

 

Tell us what steps your using to demo the problem.

 

Jim

 

 

FF = PI > S.E.T

 

Last Edited: Tue. Dec 29, 2020 - 04:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The simulation of 328P is normal in my MS.

 

At 2560, as you say, the display looks strange.
However, the actual operation is normal, so it seems to be a studio problem.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it helps if I have the correct chip selected, M328 vs M8, yes it works for me as well!

 

Jim

 

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim

 

As a matter of interest, what version of Studio are you running? KABASAN above shows the same problem.

 

I upgraded to the latest after using AS7 because of this - but I am experiencing the same 

Thanks

Last Edited: Tue. Dec 29, 2020 - 04:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Docara wrote:
As a matter of interest, what version of Studio are you running?

 

not sure if it is the latest, but I did update it a while back

Jim

 

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's mine.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like I"m behind (again), time to update from AS7 to MC7!  crying

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you correctly simulate M2560 with AS7?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's interesting!!

 

I was running 2397 but couldn't get TXENn to function as expected - I'm now on 7.0.2542.

 

Must be my code - I'll dig it out and check through again.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Docara wrote:

I am testing code to toggle the TCENn bit of UCSRnB register and viewing the result in MS7 simulator.

I must assume this is a typo. Other freaks have auto-corrected this to TXENn . That's probably a good correction because the X & C keys are adjacent but these details are important.

 

Last Edited: Tue. Dec 29, 2020 - 06:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes! Thank you it was a typo!

 

So have eventually found time to revisit this - here is an update.

 

Typing this I can't see my original post - in case I forgot to mention it, I am not using a genuine Atmel 2560 - it's a Robotdyn development board running 16MHz. 

 

I've copied the basic code I used to test functionality of AS7/MS7 when displaying TXENn indicator.

 

Strangely, the code only works on hardware if I include a 7uS (minimum) delay BEFORE I try to change to disable the TXENn bit.  If this is normal behaviour on eith Atmel and/or RobotDyn 2560s?  I would be grateful if someone would let me know either way.

 

Back to AS7 and MS7 TXENn issue:

Ref screen grab, notice both the TXEN2 bit is set onscreen AND the the TXENn bit in UCSR2B is already set when entering code. The data sheet does NOT say that this is the default condition. This bit is unable to be changed with the mouse.

 

I think this is a bug in MS7! 

 

Thanks   

 

#define F_CPU 16000000UL    // Define MCU clock speed (for delays only)

#include <stdint.h>            // Needed for uint8_t
#include <avr/io.h>            // AVR Pin and Register Names
#include <util/delay.h>        // Usage -> milli Seconds  = '_delay_ms(50);' micro Seconds = '_delay_us();'

int main(void)
{

    UCSR0B = 0x18;        // USART 0
    UCSR0C = 0x06;
    UBRR0L = 0x67;
    UCSR1B = 0x18;        // USART 1
    UCSR1C = 0x06;
    UBRR1L = 0x67;
    UCSR2B = 0x18;        // USART 2
    UCSR2C = 0x06;
    UBRR2L = 0x67;
    UCSR3B = 0x18;        // USART 3
    UCSR3C = 0x06;
    UBRR3L = 0x67;

    UDR0 = 0x41;                 // Port 0 - USB     (PC Terminal) 'A'
    //UDR1 = 0x42;               // Port 1 - Bridge             'B'
    UDR2 = 0x43;                 // Port 2 - Arduino + LCD        'C'
    //UDR3 = 0x44;               // Not Used                     'D'

_delay_us (7);                  // Needed - Disabling TXEN2 was only possible after a 7uS delay here???????
    UCSR2B &=0b00011000;        // added for this debugging
    UCSR2B |=(0<<TXEN2);        // added for this debugging
    UCSR2B &=0b00010000;        // added for this debugging    
    // UCSR2B &=0b00000000;     // uncomment when simulating 
    
    // UCSR2B &=0b00010000;     // original code before adding above debugging 
    
    UDR0 = 0x45;                // Port 0 - USB     (PC Terminal)   'E'
    //UDR1 = 0x46;              // Port 1 - Bridge                  'F'
    UDR2 = 0x47;                // Port 2 - Arduino + LCD           'G'
    //UDR3 = 0x48;              // Not Used                         'H'
    
                                // Expected Output should be:- 
                                // Terminal (Terra Term)    = A E
                                // LCD                      = 43

  

    /* Replace with your application code */
    while (1) 
    {
    }
}

 

MS7 debug in Simulation

 

 

 

 

 

Last Edited: Sat. Jan 9, 2021 - 09:35 AM