Menu

Help on an Arduino NANO PortD / TX/RX .0 .1

Help
lhatch
2017-09-19
2017-09-20
  • lhatch

    lhatch - 2017-09-19

    I want to use PortD on the Mega328p. For some reason PortD.0 (RX) and PortD.1 (TX) are always high (can not set off)?

    Is this a Arduino bootloader issue as they are marked TX/RX? Maybe I have a bad nano. Anyone found this before?

     
  • Anobium

    Anobium - 2017-09-19

    Not a lot of information to go on.

    Assume you have an UNO or UNO clone. This has a USB port. The USB port is connected to the USB to Serial chip. The USB to Serial chip is connected to Mega328p to portd.0 and portd.1. And, portd.0 and portd.1 is pulled high by the USB to Serial chip.

    See

    This assumes you have an UNO board.

     
  • lhatch

    lhatch - 2017-09-19

    It is a NANO. But seems the same issue as the UNO. Should I not be able to set portd.1 off and drive it down.

    The USB cable was use to program it via the bootloader, but was not connected when in-circuit. Power is running on RAW pin using the onboard regulator. Hope someone has figure it out before.

     
  • Anobium

    Anobium - 2017-09-19

    Change the firmware on the chip. There are many options, look at TinyBootloader+ as this is very good but you may have to adapt the bootloader to give you the freedom you need.

    Have to ask... why do you need these specific ports?

     
  • lhatch

    lhatch - 2017-09-19

    Teaching someone GCB and wanted a full 8 bit port got a 5.5" 7 segment display, can use PORTC and fake the one bit, but I wanted to keep it simple.

     
    • Anobium

      Anobium - 2017-09-19

      ok. Good luck.

       
  • stan cartwright

    stan cartwright - 2017-09-19

    I tried this program on a uno and there's a square wave on d0 and d1 when powered from usb lead. the leds on the board appear to be contantly lit but are flashing. So you can use d0 and d1 and the terminal if you use resistors to the load on d0,d1. Try-

    #chip mega328p
    dir portd.0 out
    dir portd.1 out
    do
    portd.0=!portd.0
    portd.1=!portd.1
    wait 1 ms
    loop
    

    It uses the boot loader that came when I bought it, already programmed..normal one, whatever

     

    Last edit: stan cartwright 2017-09-19
  • lhatch

    lhatch - 2017-09-19

    chip mega328p,16

    dir portd.0 out
    dir portd.1 out
    do
    portd.0=!portd.0
    portd.1=!portd.1
    wait 1 sec
    loop

    Get gcasm symbol 11.0 has not been definded

     
    • Anobium

      Anobium - 2017-09-20

      Not a lot of information again.

      My guess. You are using an old version of Great Cow BASIC. Always download latest version. If you wait until 23rd September 2017 you can download the next release.

       

      Last edit: Anobium 2017-09-21
  • Anobium

    Anobium - 2017-09-20

    So, I will update the chip database to the information in the file? This is a Y or N answer.

    Any issues with any other part of chip initialision needs another thread.

    For those following this thread ... the database I am updating contains the basic configuration of a chip which includes the internal oscillator frequencies. If a maximum internal frequency is not correct the compiler will assume an external clock source for a frequency above the information in the database.

     

    Last edit: Anobium 2017-09-21
  • lhatch

    lhatch - 2017-09-20

    I will update the compiler tonight and see if that helps. Not sure on not enough info either time...

    Last post has source code, error and assembler program name. Also, first post on the UNO assumtion, in the title I mentioned the Arduino name (NANO),.

    Also lost on the Y or N part?

     

    Last edit: Anobium 2017-09-21
    • Anobium

      Anobium - 2017-09-21

      Totally incorrect posting by me! The right answer to the wrong question.

      lol

       
  • stan cartwright

    stan cartwright - 2017-09-20

    lhatch,2027 is a long wait :)
    I think your prob is from using arduino ide where system stuff is pre defined..like tx/rx and timer x is used by the pause or ms command..I've never used arduino c++ ide though.or a nano.
    To GCB it's just another chip and if nano is 328p should work.
    My code worked so tx/rx is always high,as in 1st post, is incorrect.
    I set a 1 ms delay to scope output but you set 1 s so should show hi/lo on multimeter.

     
  • lhatch

    lhatch - 2017-09-20

    I have never use the Arduino IDE (other that the (ESP). Only GCB on uC/AVR.

    On TX/RX high. The user has used two NANOs and same results. I will be on vacation tomorrow and bread board it with 2 LEDS and see what I get. Workng with someone that likes Arduino, all new to me. Normally I use a PIC and AVR and asm or GCB.

     

Log in to post a comment.