View previous topic :: View next topic |
Author |
Message |
Neptune769
Joined: 27 Jul 2008 Posts: 55
|
Posted: Sat Apr 30, 2016 2:31 am Post subject: Arduino Uno not taking code |
|
|
Hello Everyone,
I have been away for several years. I just found out that Bascom can be used on Arduino hardware. I copied some code to test. When I compile it, it is okay. However when I try to program the Arduino the TX & RX LEDs flash as if it is sending the program. But it doesn't work like it should. Can anyone tell me what the problem could be? I would appreciate any help. The code I wanted to test is below.
Thank you,
Dennis L.
Code: | $regfile = "m328pdef.dat"
$crystal = 16000000
Config Clockdiv = 1
Config Pinb.5 = Output
Do
Set Portb.5
Waitms 200
Reset Portb.5
Waitms 500
Loop
End |
|
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sat Apr 30, 2016 11:34 am Post subject: Port... |
|
|
Try config portb.5 = output |
|
Back to top |
|
|
Neptune769
Joined: 27 Jul 2008 Posts: 55
|
Posted: Sun May 01, 2016 5:54 pm Post subject: |
|
|
Thanks for the reply. However it still not working. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sun May 01, 2016 6:03 pm Post subject: Stacks... |
|
|
Where are the lines
Hwstack
Swstack
Framesize
Try it without the config clockdiv
There are two Arduino options to program, which one do you use and at what baudrate?
What Bascom-AVR version are you using?
JP Duval wrote a small instruction how to program the Arduinos.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
Neptune769
Joined: 27 Jul 2008 Posts: 55
|
Posted: Sun May 01, 2016 6:24 pm Post subject: Re: Stacks... |
|
|
bzijlstra wrote: | Where are the lines
Hwstack
Swstack
Framesize
Try it without the config clockdiv
There are two Arduino options to program, which one do you use and at what baudrate?
What Bascom-AVR version are you using?
JP Duval wrote a small instruction how to program the Arduinos.
Have fun
Ben Zijlstra |
Hi Ben,
I copied the code from the thread "getting started with Arduino and bascom" by Duval JP. The Hwstack, Swstack & Framesize were not in the code. I wouldn't know what numbers to enter for those.
I will try it without the config clockdiv.
I am using the USB port on the Arduino to program with Programmer set to Arduino with baud rate to 115200 as shown in the zip file from Duval JP.
I am using Bascom ver. 2.0.7.5
Thanks for your help. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sun May 01, 2016 9:10 pm Post subject: add stacks... |
|
|
Add
$hwstack = 40
$swstack = 40
$framesize = 40
Checked, the test led of the Arduino Uno is on Portb.5
If we can not fix it, it is time for JP Duval to have a look
Have fun
Ben Zijlstra |
|
Back to top |
|
|
Neptune769
Joined: 27 Jul 2008 Posts: 55
|
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Mon May 02, 2016 11:19 am Post subject: |
|
|
Ok
The test program I posted been tested, it works.
Have test you the blink example given by Arduino?
Have you tested the led electrically?
is it an official UNO? copies are not controlled, the led may be upside down?
the USB connection is the serial port, you can try "print" and test it with the terminal emulator
as below:
'-------------------------------------------------------------------------------
' ARDUINO-UNO V3.BAS
'
' (c) 1995-2011, MCS Electronics
' This is a sample file for the Mega328P based ARDUINO board
' Select Programmer 'ARDUINO' , 115200 baud and the proper COM port timeout 200
'-------------------------------------------------------------------------------
$regfile = "M328pdef.dat"
$crystal = 16000000
$hwstack = 128
$swstack = 64
$framesize = 128
$baud = 57600
' les config----------------------------------------------------------------------
Config Clockdiv = 1 'par défaut le M328 utilise une clock diviser par 8
Config Pinb.5 = Output
Do
Set Portb.5
Print "led = 1"
Wait 1
Reset Portb.5
Wait 1
Print "led = 0"
Loop
End 'end program
'---------------------------------
JP |
|
Back to top |
|
|
Neptune769
Joined: 27 Jul 2008 Posts: 55
|
Posted: Mon May 02, 2016 11:19 pm Post subject: |
|
|
Duval JP wrote: | Ok
The test program I posted been tested, it works.
Have test you the blink example given by Arduino?
Have you tested the led electrically?
is it an official UNO? copies are not controlled, the led may be upside down?
the USB connection is the serial port, you can try "print" and test it with the terminal emulator
as below:
|
Hi Duval,
There is a program on the Uno that makes an LED fade on & off. That was done with the Arduino IDE so that When the above program is working I will see the difference. That works fine. I have tried it on 3 Unos 1 Official and two copies. They all do the same thing. The LED is good. |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Tue May 03, 2016 10:36 am Post subject: |
|
|
Neptune769
Did you copy and paste Duval JP program
Does bascom show you your chip in the programming screen
Regards Paul |
|
Back to top |
|
|
aphawk
Joined: 23 Jan 2010 Posts: 168 Location: Brazil
|
Posted: Tue May 03, 2016 3:16 pm Post subject: |
|
|
I can confirm that Duval's program works ok.
I use AVRDUDE commands as a command line in Bascom's Programmer Configurations to write to Arduino Uno, for more than 2 years this works very well.
Paulo |
|
Back to top |
|
|
Neptune769
Joined: 27 Jul 2008 Posts: 55
|
Posted: Wed May 04, 2016 12:52 am Post subject: |
|
|
Paulvk wrote: | Neptune769
Did you copy and paste Duval JP program
Does bascom show you your chip in the programming screen
Regards Paul |
Hi Paul,
Yes I copy and pasted the code. Also the chip is listed in the Bascom Options under the Compiler, Chip tabs.
I attached a screen capture.
Thank you, |
|
Back to top |
|
|
Neptune769
Joined: 27 Jul 2008 Posts: 55
|
Posted: Wed May 04, 2016 12:57 am Post subject: |
|
|
aphawk wrote: | I can confirm that Duval's program works ok.
I use AVRDUDE commands as a command line in Bascom's Programmer Configurations to write to Arduino Uno, for more than 2 years this works very well.
Paulo |
aphawk,
Thanks for the info. |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Wed May 04, 2016 10:07 am Post subject: |
|
|
Hello Neptune769
No not that screen
The bascom program chip screen (F4) on key board
Regards Paul |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Wed May 04, 2016 6:27 pm Post subject: |
|
|
I dont understand because this programm works with Win XP, WIN7, win10
did you look where your arduino is connected : com?
JP |
|
Back to top |
|
|
|