I need a physically small microcontroller for my application (Under 48 pins, smaller is better), and need to read/write to an SD card, as well as USB. There are a few nice XMega chips, but Bascom's USB doesn't support the XMegas. The best chip I can find is the Mega32UC4, which has 2.5K RAM. Realistically, would this be enough RAM? I'm guessing my code (Not including USB and SD) would need around 500-600 bytes.
Thanks!
↧
AVR-DOS : ATMega32UC4 with SD? : NEWTOPIC
↧
BASCOM-AVR : Serialin and data corruption : REPLY
Hi Guys,
The advantage of multiple FETs in parallel is the on resistance,
Lets assume one FET has an on resistance of 0.117R
Now put three FETs in parallel, the on resistance is now 0.039R
This is a legal way to do it with FETs, with transistors, low value current sharing resistors are required.
Same with caps, One cap ESR of .2R (Equivalent Series Resistance, The smaller the better for caps)
Three caps (of the same type in parallel, total ESR is now 0.066666R, but now has a higher surge current capability.
Down side, three time the room required.
Dean
↧
↧
BASCOM-AVR : Serialin and data corruption : REPLY
[quote:8b41bcbfca="Deanus"]
This is a legal way to do it with FETs, with transistors,
[/quote:8b41bcbfca]
But be aware that not all the fet's switching at the exact same moment. The one that switches first gets the full load and can be fried from that.
http://www.nxp.com/documents/application_note/AN11599.pdf
↧
BASCOM-AVR : an idea for the next version f Bascom AVR : NEWTOPIC
hello,
for the new version of bascom, I would appreciate it if there was a change in color of the tab from the main program when amending a .inc or .bas included in the program, like this one would think to recompile before transmitting to the µP
but maybe it is difficult ?
Best regards
:wink:
jp
[b:a3ff488578][color=red:a3ff488578](BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.7.8 )[/b:a3ff488578][/color:a3ff488578]
↧
BASCOM-AVR : interfacing ADS1115 : NEWTOPIC
Hello
I have tried to interface the 16 bit AD converter ADS1115 with very little succes.
I only get ones, FF FF, when reading the chip.
I have used data from the quick start guide in texas instruments datasheet.
I recently put in some delays and start/stop conditions, but that didn't help either.
Perhaps somebody with experience in this can figure out what i'm doing wrong.
/Björn Johansson
[b:c101e988bf][color=red:c101e988bf](BASCOM-AVR version : 2.0.7.7 , Latest : 2.0.7.8 )[/b:c101e988bf][/color:c101e988bf]
↧
↧
BASCOM-AVR : interfacing ADS1115 : REPLY
Hi,
Try the [b:754513f46b]12cscan.bas [/b:754513f46b]example from your Bascom directory to test if the hardware is working fine and if the i2c address matching your settings.
[code:1:754513f46b]
Print "Scan start"
For B = 0 To 254 Step 2 'for all odd addresses
I2cstart 'send start
I2cwbyte B 'send address
If Err = 0 Then 'we got an ack
Print "Slave at : " ; B ; " hex : " ; Hex(b) ; " bin : " ; Bin(b)
End If
I2cstop 'free bus
Next
Print "End Scan"
End
[/code:1:754513f46b]
↧
BASCOM-AVR : interfacing ADS1115 : REPLY
Is the 90s8515 really chip You want to run this code or maybe You have Mega8515 that need "m8515.dat"?
Why don`t You use some chip with TWI. Even on Atmega8 You can use $lib "I2c_twi.lib" and then use Portc.4 and Portc.5
With really old chip`s where I2C was not implemented because it is a Philips patent or when I2C pins are occuped then software I2C make sens.
You should consider using dedicated I2C pin of some newer chip.
↧
BASCOM-AVR : interfacing ADS1115 : REPLY
Thanks.
I tried the scan program and the result was 144 or Hex90
just like i should.
perhaps I could modify the program and see if I get an ack
when reading from the ADS.
↧
BASCOM-AVR : interfacing ADS1115 : REPLY
you need 2R 4.7k pull up on the I2C lines
did you put them ?
jp
↧
↧
Share your working BASCOM-AVR code here : Thingspeak field update example : REPLY
Thank you for sharing your code.
Here are AT commands needed to send data to Thiengspeak with GSM module SIM900.
AT commands were tested with terminal.
[quote:6fa7e6b41a]RDY
+CFUN: 1
+CPIN: READY
Call Ready ' IF BAUD RATE IS FIXED GSM AUTOMATIC ANSWER WITH +CFUN: 1, +CPIN: READY (OR ERROR, THEN YOU MUST PUT PIN CODE), AND +CALL: READY
AT+CSQ ' GET SIGNAL LEVEL
+CSQ: 19,0
OK
AT+SAPBR=3,1,"CONTYPE","GPRS" 'CONNECT TO GPRS
OK
AT+SAPBR=3,1,"APN","internet" ' (FOR USER NAME & PSW USE DATA OF YOUR PROVIDER)
OK
AT+SAPBR=1,1
OK
AT+HTTPINIT
OK
at+sapbr=2,1 'Get GSM local IP
+SAPBR: 1,1,"XXX.XXX.XXX.XXX" 'gsm IP ADDRES GPRS OK. IF ANSWER IS +SAPBR: 1,3,"0.0.0.0" GPRS SI NOT CONNECTED
OK
AT+HTTPPARA="CID",1
OK
AT+HTTPSSL=1 'Enable the SSL function (YOU MUST ENABLE SSL ELSE ANSWER FROM SERVER will be 0,603,0)
OK
AT+HTTPPARA="URL","https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxx&field1=18&field2=32&field3=33"+CRLF 'SEND URL XXXXX YOUR API KEY
OK
AT+HTTPACTION=0 'GET ANSWER FROM SERVER
OK
'mind: TIME TO RECIVE ANSWER is between 1 and 5 seconds
+HTTPACTION:0,200,3 ' ANSWER OK, SEND BACK 3 BYTE
AT+HTTPREAD ' READ ANSWER FROM SERVER
+HTTPREAD:3 'ANSWER IS 3 BYTE LONG
120 ' RECIVED DATA FROM SERVER
OK
AT+HTTPTERM 'TERMINATE HTTP SERVICE
OK
AT+HTTPINIT 'INITIALISE HTTP SERVICE
OK
AT+HTTPPARA="URL","https://api.thingspeak.com/update?api_key=XXXXXXXXXXXXXXXX&field1=18&field2=32&field3=33" +CRLF 'SEND URL XXXXX YOUR API KEY
OK
AT+HTTPACTION=0
OK
'Mind: TIME TO RECEIVE ANSWER (1 - 5 sec)
+HTTPACTION:0,200,3
AT+HTTPREAD
+HTTPREAD:3
121
OK
AT+HTTPTERM 'TERMINATE HTTP SERVICE
OK
AT+SAPBR=0,1 'DISABLE GPRS
OK
[/quote:6fa7e6b41a]
↧
BASCOM-AVR : interfacing ADS1115 : REPLY
Yes, I have a ready made little pcb with the ADS soldered on it.
It has all the pullups and some filtering capacitors.
Also the oscilloscope shows fine pulses 2x8 at the scl line
and 2x high at ada line when reading msb and lsb.
I also tried to capture the ack when reading the chip
with the scan program but it never came.
result 255.
perhaps this is where the problem sits, or did I make a poor
modification of the program.
part of the modified scan program.
I2cstart
I2cwbyte 144
I2cwbyte 0
For B = 1 To 254 Step 2
I2cwbyte B
I2crbyte lbyte, ack
If Err = 0 Then
cls 'we got an ack
lcd "Slave at"
lowerline
lcd B," ";
End If
I2cstop 'free bus
Next
cls
lcd "end ";B
End
↧
BASCOM-AVR : an idea for the next version f Bascom AVR : REPLY
You mean in project mode?
↧
AVR-DOS : ATMega32UC4 with SD? : REPLY
that is plenty of SRAM and sufficient for AVR-DOS.
↧
↧
BASCOM-AVR : interfacing ADS1115 : REPLY
Hi,
did you see datasheet
Write to Config register:
First byte: 0b10010000 (first 7-bit I2C address followed by a low read/write bit) (H90/H91 OK)
Second byte: 0b00000001 (points to Config register)
Third byte: 0b10000100 (MSB of the Config register to be written)
Fourth byte: 0b10000011 (LSB of the Config register to be written)
Write to Pointer register:
First byte: 0b10010000 (first 7-bit I2C address followed by a low read/write bit) (H90/H91 OK)
Second byte: 0b00000000 (points to Conversion register)
Read Conversion register:
First byte: 0b10010001 (first 7-bit I2C address followed by a high read/write bit)
Second byte: the ADS1113/4/5 response with the [b:fe75ea821a]MSB[/b:fe75ea821a] of the Conversion register
Third byte: the ADS1113/4/5 response with the [b:fe75ea821a]LSB[/b:fe75ea821a] of the Conversion register
Try code:
[code:1:fe75ea821a]Config Portd.0 = Output
Dim Hibyte As Byte
Dim Lobyte As Byte
Dim W_addr As Byte
Dim R_addr As Byte
'addr_pin grounded
'address for write to ads1115
W_addr = &H90
'address for read from ads1115
R_addr = &H91
' Configure pins to to use for the I²C bus
Config Scl = Portc.0 'Is serial clock SCL
Config Sda = Portc.2 'Is serial data SDA
I2cinit
'Const Config_high = &B11000000 '6144
'Const Config_high = &B11000010 '4096
Const Config_high = &B11000100 '2048
'Const Config_high = &B11000110 '1024
Const Config_low = &B00000000
I2cstart
I2cwbyte W_addr
I2cwbyte &B00000001
I2cwbyte Config_high
I2cwbyte Config_low
I2cstop
Waitms 25
'******************************************
Do
Gosub Read_ad
Cls
Lcd Hibyte
Lowerline
Lcd Lobyte
Wait 1
Loop
End
Read_ad:
I2cstart ' Generate start code
I2cwbyte W_addr ' send address
I2cwbyte 0
I2cstart ' start condition
I2cwbyte R_addr ' slave address
I2crbyte Lobyte , Ack
I2crbyte Hibyte , Nack
I2cstop
Return[/code:1:fe75ea821a]
↧
AVR-DOS : ATMega32UC4 with SD? : REPLY
Thanks Mark!
Also, on a somewhat related topic, any progress or timetable getting the USB add-on working with the XMegas?
↧
BASCOM-AVR : Print lower case bug !!! : NEWTOPIC
Hi,
This very simple program :
Dim P As Byte
For P = 1 To 100
Print "mworld.be"
Next
give on the Bascom AVR terminal ( ond others like TeraTerm )
ÀÂorÚd.be
ÀÂorÚd.be
ÀÂorÚd.be
I am using version 2.0.7.9 running on AT MEGA 1284 P.
Any idea ?
Best regards
Georges
[b:93c013e5ef][color=red:93c013e5ef](BASCOM-AVR version : 2.0.7.8 )[/b:93c013e5ef][/color:93c013e5ef]
↧
BASCOM-AVR : Print lower case bug !!! : REPLY
Hi
What Crystal are you using? Baudrate?
AVR's generate the clock for Serial comunication using the Crystal divided by a factor. Have a look the the program, show result "Baudrate error". The error should be less than 2%
Regards
Ian Dobson
↧
↧
BASCOM-ARDUINO : TFT 5inches, ssd1963 and Mega 2560 : REPLY
HELLO
I want to ask about the Method of drawing pixels depending XY variable values,
to drawing graph line
Suppose y is the time
x is DC input
↧
BASCOM-AVR : Print lower case bug !!! : REPLY
Hi,
Problem is very strange.
I use a good quartz.
I make many tests with upper case without problem.
Only this string gives errors
The test program :
'
$regfile = "m1284pdef.dat"
$crystal = 18432100
$baud = 9600
Dim P As Byte
For P = 1 To 100
Print "mworld.be"
Next
End
Best regards
Georges
↧
BASCOM-AVR : Print lower case bug !!! : REPLY
Hi,
Problem is very strange.
I use a good quartz.
I make many tests with upper case without problem.
Only this string gives errors
The test program :
'
$regfile = "m1284pdef.dat"
$crystal = 18432100
$baud = 9600
Dim P As Byte
For P = 1 To 100
Print "mworld.be"
Next
End
↧