Menu

Problem programming Mega328P/Nano v3

Help
lhatch
2015-05-19
2018-06-10
  • lhatch

    lhatch - 2015-05-19

    I normally use GCB with PIC chips, but ordered an arduino nano v3 mega328P. I have a program that compiles fine, but when I go to flash I get an error it can not fine the USB device.

    ~~~Done (Compile time: 2.595 seconds)

    Summary:
    Read by GCBASIC:
    Input lines: 61
    Variables: 4
    Constants: 315
    Subroutines: 209
    Chip resource usage:
    Program Memory: 42/32768 words (.13%)
    RAM: 4/2048 bytes (.2%)

    Assembling program ...
    Building symbol table ...
    Generating machine code ... 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99% 100%
    Program assembled successfully!
    flashAVR.bat

    avrdude.exe: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'

    avrdude.exe done. Thank you.

    ERROR running: "C:\GCB@Syn\G@Stools\flashAVR.bat" with parameters "C:\Program Files\GCBASIC\nano.hex" MEGA328P

     
  • Marc in the Dark

    Hi lhatch. Are the Arduino drivers installed on you system? Can you see the Arduino in the device manager under ports?

    Then have you edited the flashAVR.bat file in SynWrite to set the correct COM port?

     
  • lhatch

    lhatch - 2015-05-19

    Hi Mark,

    That was it. Need to remove the default, and turn on arduino and com8: Thanks. I think its work, 188 bytes written

     
  • Marc in the Dark

    Awesome.
    Glad I could Help.

     
  • lhatch

    lhatch - 2018-06-09

    I made a post and do not see it. Going to bump this thread and see if somehow my account is not working. I get GCB stuff all day. I posted and like it never made it. I guess mods have to approve new topics or something (if I see this comment show up). Like to get keypad working this weekend...

     
  • lhatch

    lhatch - 2018-06-09

    Since this is my thread. I will post here. I grab some code and made the below. Keypad it on order, but will just short a row and column. When I run it I get my "> " and 13 (with no row/col shorted. If I short 7 and 8 still a 13 on display. Anyone see what I missed?

    ~~~
    #chip mega328p, 16
    #include <UNO_mega328p.h>

    HI2CMode Master
    #define HI2C_DATA
    #define LCD_IO 10
    #define LCD_I2C_Address 0x4e '// Change to 0xFE for SainSmart
    #define LCD_Backlight_On_State 1 '// These may need to be reversed
    #define LCD_Backlight_Off_State 0

    #define KEYPAD_ROW_1 DIGITAL_11
    #define KEYPAD_ROW_2 DIGITAL_10
    #define KEYPAD_ROW_3 DIGITAL_9
    #define KEYPAD_ROW_4 DIGITAL_8
    #define KEYPAD_COL_1 DIGITAL_7
    #define KEYPAD_COL_2 DIGITAL_6
    #define KEYPAD_COL_3 DIGITAL_5
    #define KEYPAD_COL_4 DIGITAL_4

    dim Temp as Byte

    ' Main
    cls
    print "> "

    Do
    'Get key
    Temp = KeypadData
    'If a key is pressed, then display it
    If Temp <> KEY_NONE Then
    Print Temp
    'Wait until key is released
    wait while KeypadData <> KEY_NONE
    End If
    Loop
    End

     
  • stan cartwright

    stan cartwright - 2018-06-09

    I made a post and do not see it.
    me to. my next similar post ok.
    Are you using 98.08?
    the edit program preference is now mouse driven. uno or nano, left click and drag to top then edit and change com port if needed

     

Log in to post a comment.