1
AVRDude / BP V4 as STK500 with AVRStudio6
viewtopic.php?f=41&t=4207
Open Source Hardware
This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

memset(data, 0, 24);
for(loop = 0; loop < 24; loop++){
data[loop] = sendcommand(hComm, CMD_READ_BYTE);
printf("%d ", data[loop]);
sleep(2);
}
unsigned char sendcommand(HANDLE hComm, unsigned char command){
int bytes_written, bytes_received;
unsigned char received_byte;
PurgeComm(hComm, PURGE_RXCLEAR);
WriteFile(hComm, &command, 1, &bytes_written, 0);
//sleep(2);
ReadFile(hComm, &received_byte, 1, &bytes_received, 0);
return received_byte;
}][0xA0+0x06+[0xA1+0x30+][][0xA0+0x05+[0xA1+0x03+][][0xA0+0x04+[0xA1+0xCE+]]]]]]
][0xA0+0x06+[0xA1+0x30+][][0xA0+0x05+[0xA1+0x03+][][0xA0+0x04+[0xA1+0xCE+]]]]
][0xA0+0x06+[0xA1+0x30+][][0xA0+0x05+[0xA1+0x03+][][0xA0+0x04+[0xA1+0xCE+]]]]]]
?
General Protocol interaction
---------------------------------------------------------------------------
? This help (0) List current macros
= X Converts X (x) Macro x
~ Selftest [ Start
# Reset ] Stop
$ Jump to bootloader { Start with read
&/% Delay 1 us/ms } Stop
a/A/@ AUXPIN (low/HI/READ) "abc" Send string
b Set baudrate 123
c/C AUX assignment (aux/CS) 0x123
d/D Measure ADC (once/CONT.) 0b110 Send value
f Measure frequency r Read
g Generate frequency/PWM / CLK hi
h Commandhistory CLK lo
i Versioninfo/statusinfo ^ CLK tick
l/L Bitorder (msb/LSB) - DAT hi
m Change mode _ DAT lo
o Set output type . DAT read
p/P Pullup resistors (off/ON) ! Bit read
s Script engine : Repeat e.g. r:10
v Show volts/states <x>/<x= >/<0> Usermacro x/assign x/list all
w/W PSU (off/ON)
HiZ> m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. KEYB
9. LCD
x. exit(without change)
(1)> 3
Set serial port speed: (bps)
1. 300
2. 1200
3. 2400
4. 4800
5. 9600
6. 19200
7. 38400
8. 57600
9. 115200
10. 31250 (MIDI)
(1)> 5
Data bits and parity:
1. 8, NONE *default
2. 8, EVEN
3. 8, ODD
4. 9, NONE
(1)> 1
Stop bits:
1. 1 *default
2. 2
(1)> 1
Receive polarity:
1. Idle 1 *default
2. Idle 0
(1)> 1
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)
(1)> 2
Ready.
UART> W
POWER SUPPLIES ON
UART> (2)
Raw UART input. Space to exit.
2C0077AA4EBF
}else{//get LSB first
tem=tem<<1; //shift data output bits
dat=dat>>1; //shift the data input byte bits
if(di)dat+=0b10000000; //if datapin is HIGH, set MSB
}